/* =============================================
   FONT CONFIGURATION — change here to restyle
   ============================================= */
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter_18pt-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter_18pt-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/assets/fonts/JetBrainsMonoNLNerdFont-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* =============================================
   GLOBAL FONT ENFORCEMENT — do not touch below
   ============================================= */
*, *::before, *::after {
  font-family: var(--font-ui) !important;
}

code, pre, kbd, samp,
.mono, [class*="stat"], [class*="number"], [class*="credit"] {
  font-family: var(--font-mono) !important;
}

/* BOINC dashboard - Web Styles */
html {
  transform: scale(0.67);
  transform-origin: top left;
  width: 149.25%;
  height: 149.25%;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════
   THEME VARIABLES  –  Dark (default) / Light
   Toggle: document.documentElement.dataset.theme = 'light'
   ═══════════════════════════════════════════════════════ */
:root,
html[data-theme="dark"] {
  --font-ui:   'Inter', system-ui, sans-serif;      /* all UI, labels, tables — swap font name here */
  --font-mono: 'JetBrains Mono', monospace;          /* numbers, stats, data columns — swap here */

  --line-1:  #FF5555;
  --line-2:  #EFA554;
  --line-3:  #10b981;
  --line-4:  #5291f7;
  --line-5:  #a079fb;
  --line-6:  #50fa7b;
  --line-7:  #ec4899;
  --line-8:  #06b6d4;
  --line-9:  #E4F34A;
  --line-10: #FF79C6;
  
  --bg: #0f172a99; --fg: #f1f5f9; --card: #1a1a1a; --glow: #fff;

  --bg-body-from: rgba(15,23,42,0.95);  --bg-body-mid: rgba(21,28,43,0.95);  --bg-body-to: #1e293bf2;
  --bg-card: #3a3947;  --bg-card-inset: #ffffff17;
  --bg-surface: #1e293b;  --bg-surface-alt: #334155;  --bg-deep: #0d1421;
  --bg-overlay: rgba(0,0,0,0.95);  --bg-overlay-soft: rgba(0,0,0,0.3);
  --bg-control: #3a3d52;  --bg-control-hover: #4a4d62;  --bg-control-group: #1e222a;  --bg-control-panel: #343a46;
  --bg-input: rgba(68,71,90,0.5);  --bg-input-focus: rgba(68,71,90,0.75);
  --bg-calendar: #1e2229;  --bg-calendar-input: #2d333b;

  --project-selector: linear-gradient(90deg,#4e5063,#343a46);

  --text-primary: #e2e8f0;  --text-secondary: #94a3b8;  --text-muted: rgba(255,255,255,0.5);
  --text-on-accent: #1e222a;  --text-bright: #f8f8f2;  --text-input: #f0f5ff;
  --text-placeholder: rgba(255,255,255,0.4);  --text-placeholder-alt: rgba(255,255,255,0.45);

  --heading-from: #f1f5f9;  --heading-to: #cbd5e1;

  --border-subtle: rgba(148,163,184,0.1);  --border-default: rgba(148,163,184,0.2);
  --border-medium: rgba(148,163,184,0.3);  --border-strong: rgba(148,163,184,0.4);
  --border-control: #4a4d62;  --border-divider: #44475a;
  --border-calendar: #444;  --border-calendar-input: #555;
  --border-white-faint: rgba(255,255,255,0.08);  --border-white-dim: rgba(255,255,255,0.06);
  --border-white-hover: rgba(255,255,255,0.15);  --border-white-soft: rgba(255,255,255,0.2);

  --shadow-sm: rgba(0,0,0,0.2);  --shadow-md: rgba(0,0,0,0.3);  --shadow-lg: rgba(0,0,0,0.4);
  --shadow-xl: rgba(0,0,0,0.5);  --shadow-heavy: rgba(0,0,0,0.6);  --shadow-card: rgba(0,0,0,0.55);

  --accent-blue: #3b82f6;  --accent-blue-hover: #2563eb;  --accent-blue-active: #1d4ed8;
  --accent-blue-light: #697282;  --accent-blue-dim: rgba(59,130,246,0.1);  --accent-blue-glow: rgba(59,130,246,0.4);
  --accent-green: #50FA7B;  --accent-green-dim: rgba(80,250,123,0.3);
  --accent-cyan: #8be9fd;  --accent-cyan-glow: #0ba2c466;
  --accent-teal: #10b981;  --accent-purple: #8b7dff;
  --accent-purple-dim: rgba(139,125,255,0.3);  --accent-purple-hover: rgba(139,125,255,0.5);

  --pill-mode: #8be9fd;  --pill-time: #50fa7b;

  --data-rank: #8be9fd;  --data-user: #e2e8f0;  --data-today: #f59e0b;  --data-yesterday: #a689fa;
  --data-week: #00bafd;  --data-total: #10b981;  --data-percent: #4899ec;  --data-numeric: #fb923c;
  --data-teal: #10b981;

  --trend-hot: #ef4444;  --trend-strong: #4a90c2;  --trend-steady: #6b7280;
  --trend-cooling: #3b82f6;  --trend-slow: #f8f8f2;

  --hover-row: rgba(59,130,246,0.15);  --selected-row: #4a9eff40;
  --compared-row: rgba(16,185,129,0.25);  --owner-row: linear-gradient(90deg,#fbbf2426,#fbbe2416);
  --comparison-row: rgba(100,149,237,0.2);  --hover-name: #3b82f633;
  --active-name: rgba(59,130,246,0.3);  --hidden-user-bg: #00000080;

  --card-hover-border: #0ba2c466;  --card-hover-shadow: 0 2px 9px #0ba2c466;
  --card-sel-border: #0ba2c449;  --card-sel-bg: #3baef631;  --card-sel-shadow: 0 2px 9px hsla(191,89%,41%,0.25);

  --dropdown-bg: rgba(16,18,25,0.9);  --dropdown-item: #dbe7f5;  --dropdown-trigger: #e5ecf5;
  --dropdown-active-bg: linear-gradient(90deg,rgba(79,70,229,0.15),rgba(96,165,250,0.05));
  --dropdown-active-text: #cfe8ff;  --dropdown-arrow: #8be9fd;

  --projsel-bg: linear-gradient(180deg,#181a20e6,#111318db);
  --projsel-shadow: 0 18px 36px #0206178c;
  --projsel-active-bg: linear-gradient(90deg,rgba(79,70,229,0.06),rgba(96,165,250,0.03));
  --projsel-active-text: #8b7dff;  --projsel-item-text: #dfe9f7;

  --tooltip-bg: rgba(0, 0, 0, 0.7);  --tooltip-header-text: #3b82f6;
  --tooltip-header-bg: rgba(0, 0, 0, 0.729);  --tooltip-footer-bg: rgba(0,0,0,0.3);
  --tooltip-footer-text: #e2e8f099;

  --btn-cancel-bg: #374151;  --btn-cancel-hover: #4b5563;  --btn-cancel-text: #d1d5db;
  --btn-danger: #dc2626;  --btn-danger-hover: #b91c1c;  --btn-danger-active: #991b1b;

  --chart-bg-from: #1e293b;  --chart-bg-to: #334155;
  --chart-header-from: rgba(15,23,42,0.95);  --chart-header-to: rgba(30,41,59,0.95);
  --chart-name-bg: rgba(0,0,0,0.3);  --chart-you-from: rgba(59,130,246,0.3);
  --chart-you-to: rgba(99,102,241,0.3);  --chart-you-border: rgba(59,130,246,0.5);
  --chart-grid: rgba(148,163,184,0.2);  --chart-gridline: rgba(148,163,184,0.15);

  --scrollbar-track: #282a36;  --scrollbar-thumb: #6272a4;  --scrollbar-hover: #8be9fd;

  --mode-tab-text: #a6adc8;
  --tab-active-bg: linear-gradient(135deg,#9ff63c 0%,rgb(92,210,246) 100%);
  --tab-active-text: #494343;  --tab-text: #ffffff;
  --scrubber-color: #3b82f6;  --focus-ring: #6F9EFF;  --focus-glow: rgba(111,158,255,0.7);
  --you-line-glow: #E4F34A;  --project-name-color: rgb(80,250,123);
  --thead-accent: #3bd4f6;
  --theme-btn-bg: rgba(59,130,246,0.1);  --theme-btn-border: rgba(77,182,186,0.52);
  --theme-btn-text: rgba(123,208,160,0.75);
  --view-tab-border: rgba(78,246,59,0.3);  --view-tab-text: rgb(59,130,246);
  --sort-arrow: #10b981;  --back-btn-bg: #50FA7B;  --back-btn-text: #000;
  --detective-glow: #ffd70099;  --detective-flicker: #ffd700;  --detective-flicker-alt: #ff4500;
  --arrow-color: #50FA7B;  
  --chart-grid: rgba(255,255,255,0.1);     
  --chart-grid-width: 0.1;                 

    --highlight-shadow-main: drop-shadow(0 4px 12px rgba(0,0,0,0.75)) drop-shadow(0 1px 5px rgba(0,0,0,0.55));
  --highlight-shadow-rim: drop-shadow(0 0 3px currentColor);

--landing-sidebar-label: #FF79C6;

--text-third: #e2e8f0; 
  --highlight-around-you:#e63bf6;
}

/* ════════════ LIGHT THEME ═══════════════ */
html[data-theme="light"] {
  --bg: #fdfefe; --fg: #006400; --accent: #003f64; --card: #ffffffe7; --glow: #000;

    
    --line-2:  #f09d44;
    --line-8:  #06b6d4;
  --bg-body-from: rgba(241,245,249,0.98);  --bg-body-mid: #1041731f;   --bg-body-to: #fdfaf7; 
  --bg-card: #94a3b841;  --bg-card-inset: #00000008;
  --bg-surface: #fafcff;  --bg-surface-alt: #f0f5fa;  --bg-deep: #f0f5fad8;
  --bg-overlay: #fffffffa;  --bg-overlay-soft: #f0f5faa8;
  --bg-control: #1c4a7a2d;  --bg-control-hover: #cbd5e1;  --bg-control-group: #f1f5f9;  --bg-control-panel: #3b455061;
  --bg-input: #e2e8f0b3;  --bg-input-focus: #e2e8f0e6;
  --bg-calendar: #ffffff;  --bg-calendar-input: #f1f5f9;

   --project-selector: linear-gradient(90deg,#7c849670,#626b7540);

  --text-primary: #0f172a;  --text-secondary: #475569;  --text-muted: #1e293bb3;
  --text-on-accent: #1e293b;  --text-bright: #0f172a;  --text-input: #1e293b;
  --text-placeholder: #00000059;  --text-placeholder-alt: #00000066;

  --heading-from: #1e293b;  --heading-to: #475569;

  --border-subtle: #94a3b833;  --border-default: #cccccc;
  --border-medium: #94a3b866;  --border-strong: #94a3b880;
  --border-control: #cbd5e1;  --border-divider: #cccccc;
  --border-calendar: #cbd5e1;  --border-calendar-input: #94a3b8;

  --shadow-sm: rgba(0,0,0,0.06);  --shadow-md: rgba(0,0,0,0.08);  --shadow-lg: rgba(0,0,0,0.1);
  --shadow-xl: rgba(0,0,0,0.12);  --shadow-heavy: rgba(0,0,0,0.15);  --shadow-card: rgba(0,0,0,0.08);

--accent-blue:     #1d4ed8;   --accent-blue-hover:#1e40af;  --accent-blue-active: #1e40af;
  --accent-blue-light: #697282;  --accent-blue-dim: rgba(37,99,235,0.08);  --accent-blue-glow: rgba(37,99,235,0.2);
  --accent-green: #099768;  --accent-green-dim: rgba(53, 133, 82, 0.188);
  --accent-cyan: #0e7490;  --accent-cyan-glow: rgba(8,145,178,0.25);
  --accent-teal: #10b981;  --accent-purple: #6d28d9;
  --accent-purple-dim: rgba(124,58,237,0.12);  --accent-purple-hover: rgba(124,58,237,0.2);

  --pill-mode: #4899ec;  --pill-time: #16a34a;

  --data-rank: #0891b2;  --data-user: #1e293b;  --data-today: #4A90C2;  --data-yesterday: #50A747;
  --data-week: #7D6AB7;  --data-total: #F28C38;  --data-percent: #5F6A6A;  --data-numeric: #ea580c;
  --data-teal: #059669;

  --trend-hot: #dc2626;  --trend-strong: #00d0ff;  --trend-cooling: #2563eb;  --trend-slow: #374151;

  --hover-row: rgba(37,99,235,0.08);  --selected-row: #2563eb26;
  --compared-row: rgba(5,150,105,0.12);  --owner-row: linear-gradient(90deg,#0891b233,#06647c1c);
  --comparison-row: rgba(37,99,235,0.1);  --hover-name: #2563eb1a;
  --active-name: rgba(37,99,235,0.15);  --hidden-user-bg: #0000000f;

  --card-hover-border: #0891b266;  --card-hover-shadow: 0 2px 9px #0891b233;
  --card-sel-border: #08b28d80;  --card-sel-bg: #0891b214;
  --card-sel-shadow: 0 2px 9px rgba(8,145,178,0.15);

  --dropdown-bg: #fffffffa;  --dropdown-item: #334155;  --dropdown-trigger: #1e293b;
  --dropdown-active-bg: linear-gradient(90deg,#2563eb14,#60a5fa0d);
  --dropdown-active-text: #1e40af;  --dropdown-arrow: #b91078;

  --projsel-bg: linear-gradient(180deg,#fffffffa,#f1f5f9f2);
  --projsel-shadow: 0 18px 36px rgba(0,0,0,0.12);
  --projsel-active-bg: linear-gradient(90deg,#5806e60f,#60a5fa0a);
  --projsel-active-text: #7c3aed;  --projsel-item-text: #334155;

  --tooltip-bg: rgba(255, 255, 255, 0.7);  --tooltip-header-text: #2563eb;
  --tooltip-header-bg: rgba(241, 245, 249, 0.86);  --tooltip-footer-bg: rgba(241,245,249,0.8);
  --tooltip-footer-text: rgba(30,41,59,0.6);

  --btn-cancel-bg: #e2e8f0;  --btn-cancel-hover: #cbd5e1;  --btn-cancel-text: #475569;

  --chart-bg-from: #f1f5f9;  --chart-bg-to: #e2e8f0;
  --chart-header-from: rgba(241,245,249,0.98);  --chart-header-to: rgba(226,232,240,0.98);
  --chart-name-bg: rgba(0,0,0,0.04);  --chart-you-from: rgba(37,99,235,0.12);
  --chart-you-to: rgba(124,58,237,0.1);  --chart-you-border: rgba(37,99,235,0.3);
  --chart-grid: rgba(148,163,184,0.3);  --chart-gridline: rgba(148,163,184,0.2);

  --scrollbar-track: #f1f5f9;  --scrollbar-thumb: #94a3b8;  --scrollbar-hover: #64748b;

  --mode-tab-text: #64748b;
  --tab-active-bg: linear-gradient(135deg,#16a34a 0%,#0891b2 100%);
  --tab-active-text: #ffffff;  --tab-text: #334155;
  --scrubber-color: #4A5E78;  --focus-ring: #2563eb;  --focus-glow: rgba(37,99,235,0.35);
  --you-line-glow: #ca8a04;  --project-name-color: #036596;
  --thead-accent: #0891b2;
  --theme-btn-bg: rgba(37,99,235,0.06);  --theme-btn-border: #69aaa1c1;
  --theme-btn-text: rgba(5,150,105,0.8);
  --view-tab-border: rgba(22,163,74,0.3);  --view-tab-text: #2563eb;
  --sort-arrow: #059669;  --back-btn-bg: #16a34a;  --back-btn-text: #fff;
  --detective-glow: rgba(217,119,6,0.4);  --detective-flicker: #d97706;  --detective-flicker-alt: #ea580c;
  --chart-grid: #0000005b;        
  --chart-grid-width: 0.05;  
--highlight-around-you:#283745;
  --arrow-color: #FF5555;
    --highlight-shadow-main: drop-shadow(0 0 1px currentColor);
  --highlight-shadow-rim: none;  

--landing-sidebar-label:#900e4d;
--text-third: #585b64; 
}



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body { 
  background: linear-gradient(135deg, var(--bg-body-from) 0%, var(--bg-body-mid) 0%, var(--bg-body-to) 100%);
  color: var(--text-primary);
  font-family: var(--font-ui); 
  margin: 0; 
  padding: 10px; 
  min-height: 100vh;
  overflow-x: hidden;
}



/* Header */
.header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 20px; 
  padding-left: 0.5rem;
}

.header h1 {
  font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--heading-from), var(--heading-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}



.header p {
  margin: 8px 0 0 0;
  opacity: 0.7;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Chart Title - Main Chart Title for Stats */
.chart-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--heading-from), var(--heading-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

/* Chart Subtitle - Elegant and subtle */
.chart-subtitle {
  font-size: 2rem;
  opacity: 0.7;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.4;
}



/* Controls */
.controls { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin: 15px 0; 
}

/* Main Layout */
.main-layout {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
  position: relative;
}


.subprojects-sidebar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: -3.758rem;
  position: relative;
}


.subprojects-grid {
  /* overflow-x removed to allow dropdown to extend */
}

.chart-section {
  flex: 3;
  min-width: 0;
  padding-left: 0.25rem;
  position:relative;
}


.subprojects-sidebar h3 {
  color: var(--accent);

  font-weight: 200;
}



/* Subprojects - 2 column grid */
.subprojects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: -1.43rem;
}

/* Leaderboard Section */
.leaderboard-section {
  margin-top: 1rem;
  background: var(--bg); border: 1px solid var(--border-subtle);  
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.3rem;
  margin-left: 0.2rem;
  box-shadow: 0 6px 24px var(--shadow-xl);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.leaderboard-header .title h2 {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  font-weight: 600;
  color: var(--text-primary);
}

.leaderboard-header .title p {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.4;
}

.leaderboard-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.leaderboard-controls button {
  padding: 12px 16px;
  font-size: 0.9rem;
}

/* ============================================================================
   USER SEARCH STYLES
   ============================================================================ */

.leaderboard-controls input[type="text"] {
  padding: 12px 36px 12px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-input);
  font-size: 12px;
  width: 200px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  outline: none;
}

.leaderboard-controls input[type="text"]::placeholder {
  color: var(--text-placeholder);
}

.leaderboard-controls input[type="text"]:focus {
  border-color: #6F9EFF; /* subtle bright blue */
  box-shadow: 0 0 8px 2px rgba(111, 158, 255, 0.7);
  background: var(--bg-input-focus); /* slightly darker on focus */
  color: var(--text-input);
}

.view-tabs {
    background: var(--tooltip-header-bg);
    border: 1px solid rgba(78, 246, 59, 0.3);
    color: var(--view-tab-text);
    border-radius: 6px;
    cursor: pointer;
  font-size: 0.85rem;
    transition: 0.3s;
}

.view-tabs .tab {
  padding: 12px 14px;
  background: var(--bg-control-hover);
  border: none;
  color: var(--tab-text);
  font-size: 0.85rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.view-tabs .tab.active {
    background: var(--tab-active-bg);
    animation: 2s ease-in-out infinite pulse;
    color: var(--tab-active-text);
}

/* Table Styles */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.leaderboard-table thead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-deep);
  box-shadow: 0 2px 8px var(--shadow-lg);
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}


.leaderboard-table tbody tr:hover {
  transform: translateX(4px);
}



/* Leaderboard row selection */
.leaderboard-table tbody tr {
  border-bottom: 2px solid var(--border-default);
  transition: all 0.2s;
  cursor: pointer;
}

/* Remove the last row's bottom border to avoid double border */
.leaderboard-table tbody tr:last-child {
  border-bottom: none;
}

.leaderboard-table tbody tr:hover {
  background: var(--hover-row);
  transform: translateX(4px);
}

.leaderboard-table tbody tr.selected {
  background: var(--selected-row) !important;
 /* border-left: 4px solid #3b82f6 !important; */ 
}

.leaderboard-table tbody tr.compared {
  background: var(--compared-row) !important;
 /*  border-left: 4px solid #10b981 !important; */
}



.leaderboard-table td {
  padding: 12px 16px;
  font-size: 0.95rem;
  border: none;
  background: transparent;
}

.leaderboard-table tbody tr td:first-child {
  /* Removed border-radius */
}

.leaderboard-table tbody tr td:last-child {
  /* Removed border-radius */
  text-align: right;
}


.leaderboard-table td:nth-child(3),
.leaderboard-table td:nth-child(4),
.leaderboard-table td:nth-child(5),
.leaderboard-table td:nth-child(6),
.leaderboard-table td:nth-child(7) {
  color: var(--data-numeric);
  font-family: var(--font-mono);
  font-weight: 999;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
  padding-right: 16px !important;
}

.leaderboard-table th:nth-child(3),
.leaderboard-table th:nth-child(4),
.leaderboard-table th:nth-child(5),
.leaderboard-table th:nth-child(6),
.leaderboard-table th:nth-child(7){
  text-align: right !important;
  padding-right: 16px !important;
}


/* Percentage Column */
.leaderboard-table td:nth-child(7) {
/*  text-align: center; */
  font-family: var(--font-mono);
  font-weight: 900;
}
    

.trend-hot {
  color: var(--trend-hot);
  font-weight: 600;
}

.trend-strong {
  color: var(--data-today);
  font-weight: 600;
}

.trend-strong::before {
  content: "🔥 ";
}

.trend-steady {
  color: var(--trend-steady);
  font-weight: 500;
}

.trend-cooling {
  color: var(--trend-cooling);
  font-weight: 600;
}

.trend-slow {
  color: var(--text-bright);
  font-weight: 600;
}

button { 
  background: var(--bg-control);
  border: 1px solid var(--border-control);
  border-radius: 6px;
  color: var(--tab-text);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  justify-content: center;
}

button:hover:not(.mode-tab):not(.time-btn) { 
  background: var(--bg-control-hover);
  border: 1px solid var(--accent-blue-light);
}

/* Chart container */
.chart-container { 
  background: linear-gradient(135deg, var(--chart-bg-from), var(--chart-bg-to));
  border: 1px solid var(--border-default);
  padding: 0rem 0rem 2rem 0rem;
  border-radius: 0.75rem; 
  margin: 10px 0; /* Reduced from 20px */
  box-shadow: 0 4px 12px var(--shadow-md); 
  position: relative;
  overflow: hidden; /* Clip children to border-radius */
  box-shadow: 0 6px 24px var(--shadow-xl);
}

.racing-chart { 
  position: relative; 
  width: 100%; 
  height: 77.3vh; 
}

/* Racing names header */
.racing-names-header { 
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  background: linear-gradient(135deg, var(--chart-header-from) 0%, var(--chart-header-to) 100%);
  border-bottom: 1px solid var(--border-default);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  backdrop-filter: blur(10px);
    display: flex;
  flex-wrap: wrap;
  padding: 16px 20px; 
  min-height: 60px; 
  cursor: default; 
}

.racing-name-item,
.user-name { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-overlay-soft);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer !important; 
  transition: all 0.2s;
}

.racing-name-item:hover,
.user-name:hover {
  background: var(--hover-name);
}

.racing-name-item.active,
.user-name.active {
  background: var(--active-name);
}

.racing-name-item.you,
.user-name.you {
  background: linear-gradient(135deg, var(--chart-you-from) 0%, var(--chart-you-to) 100%);
  border: 1px solid var(--chart-you-border);
}

.racing-name-item span,
.user-name span {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8.1rem;
  color: var(--text-bright);
}


/* Hidden user state - dim and add strikethrough effect */
.racing-name-item.hidden-user,
.user-name.hidden-user {
  opacity: 0.3;
  background: var(--hidden-user-bg);
  text-decoration: line-through;
}

.racing-name-item.hidden-user:hover,
.user-name.hidden-user:hover {
  opacity: 0.6;
  background: var(--hover-row);
}

.racing-name-color { 
  width: 12px; 
  height: 3px; 
  border-radius: 2px; 
}

/* Y-axis */
.racing-y-axis {
  position: absolute;
  left: 0;
  top: 50px;  /* Below the 50px header */
  bottom: 40px;
  width: 80px;
  height: calc(100% - 90px); /* Total height minus header (50px) and footer (40px) */
  font-size: 0.85rem;
  opacity: 0.9;
  color: var(--text-primary);
  text-align: right;
  font-family: var(--font-mono);
  pointer-events: none;
  cursor: default;
}

.racing-y-axis > div {
  position: absolute;
  width: 100%;
  text-align: center;
}

/* Chart area */
.racing-chart-area { 
  position: absolute; 
  top: 50px; 
  left: 80px; 
  right: 20px; 
  bottom: 40px; 
  overflow: hidden; /* CRITICAL: Clips anything outside this box */
  transform: translateZ(0);
  will-change: transform;
  cursor: crosshair;
}

.racing-chart-grid { 
  position: absolute; 
  inset: 0; 
  opacity: 0.05; /* Much more subtle */
  background-image: linear-gradient(to right, var(--chart-grid) 0.5px, transparent 0.5px),
  linear-gradient(to bottom, var(--chart-grid) 0.5px, transparent 0.5px);
  background-size: 14.28% 12.5%;
}

.grid-line { 
  position: absolute; 
  width: 100%; 
  height: 1px; 
  background: var(--chart-gridline);
}

.chart-svg { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%;
  /* Improve line rendering */
  shape-rendering: geometricPrecision;
  /* Prevent browser from scaling strokes */
  overflow: visible;
}

/* ========================================
   SMOOTH TIME SCRUBBER
   ======================================== */

/* Time Scrubber Line */
.time-scrubber {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 10%,
    var(--scrubber-color) 30%,
    var(--scrubber-color) 70%,
    transparent 90%,
    transparent 100%
  );
  pointer-events: none;
  transition: left 0.08s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 
    0 0 8px var(--accent-blue-glow),
    0 0 16px rgba(59, 130, 246, 0.2);
  z-index: 15;
  opacity: 0;
  transform: translateZ(0);
  will-change: left, opacity;
  top: 15px !important;   /* Start below header */
  bottom: 0 !important;   /* Fill to bottom */
}

.time-scrubber.visible {
  opacity: 1;
  transition: opacity 0.2s ease-in;
}

/* Time Indicator Tooltip */
.time-indicator {
  position: absolute;
  top: 0.5rem; /* Just below the top edge of chart area */
  left: 50%;
  transform: translateX(-50%);

  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 
    0 2px 8px rgba(59, 130, 246, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.3);
  color: var(--tab-text);
  letter-spacing: 0.3px;
  border: 1px solid var(--border-white-soft);
}

/* Subtle glow effect on scrubber */
.time-scrubber::before {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: -2px;
  right: -2px;
  background: inherit;
  filter: blur(4px);
  opacity: 0.6;
  z-index: -1;
}

.user-line { 
  fill: none; 
  stroke-width: 1.5;
  opacity: 0.7;
  transition: all 0.1s ease;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-line:hover { 
  stroke-width: 2.5;
  opacity: 1;

}

.user-line-you:hover {
  stroke-width: 2.5;
  opacity: 1;
}

.user-line.locked,
.user-line-you.locked {
  stroke-width: 2.5;
  opacity: 1;
  filter: drop-shadow(0 0 1px currentColor);
}

/* ── LIGHT MODE ── (your favorite colored 1px shadow that pops) */
html[data-theme="light"] .user-line-you:hover,
html[data-theme="light"] .user-line:hover,
html[data-theme="light"] .user-line.locked,
html[data-theme="light"] .user-line-you.locked,
html[data-theme="light"] .user-line-you {
  filter: drop-shadow(0 3px 1px currentColor);
}


/* ── DARK MODE ── (pure dark 3D shadow, no white laser) */
html[data-theme="dark"] .user-line-you:hover,
html[data-theme="dark"] .user-line:hover,
html[data-theme="dark"] .user-line.locked,
html[data-theme="dark"] .user-line-you.locked,
html[data-theme="dark"] .user-line-you,
html[data-theme="dark"] .user-line.auto-highlight-locked {
  filter: 
  drop-shadow(0px 3px 1px #000000bf);
   /* drop-shadow(0 4px 12px #000000bf)
    drop-shadow(0 1px 5px #0000008c);  */
}

/* Auto-highlight in dark mode: same stroke-width as .locked */
html[data-theme="dark"] .user-line.auto-highlight-locked {
  stroke-width: 2.5;
  opacity: 1;
}

/* Light mode 365d: tight shadow for hover/locked/auto-highlight (thin line, wide shadow looks bloated) */
html[data-theme="light"] svg.has-locked-365d .user-line.locked,
html[data-theme="light"] svg.has-locked-365d .user-line.auto-highlight-locked,
html[data-theme="light"] svg.has-locked-365d .user-line:hover,
html[data-theme="light"] svg.chart-is-365d .user-line:hover {
  filter: drop-shadow(0 1px 0px rgba(0,0,0,0.5));
}

svg.has-locked-user .user-line:not(.locked) {   /* to dim the other users in the leadboard table */
  opacity: 0.5 ;
}

/* 365d view: more aggressive dimming, lines are thin and packed */
svg.has-locked-365d .user-line:not(.locked) {
  opacity: 0.35;
}

/* Time labels */
.racing-time-labels { 
  position: absolute;
  bottom: 0;
  left: 80px; 
  right: 20px;
  height: 40px;
  display: flex;
  padding-top: 2rem;
  flex-direction: column;
  justify-content: center;
  cursor: default; /* Not interactive */
}

.tier-numbers { 
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem; 
  color: var(--text-bright);
  padding: 8px 0 2px 0;
  height: 30px;
  align-items: center;
}

.tier-dates { 
  display: flex; 
  justify-content: space-between; 
  width: 100%; 
  margin-top: 4px; 
  font-size: 0.625rem; /* 10px */ 
  opacity: 0.7; 
}

.tier-dates .major-date { 
  color: var(--text-secondary);
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
}

/* Subprojects - 2 column cards */
.card { 
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  padding: 10px 12px; 
  border-radius: 10px; 
  border: 1px solid var(--border-subtle); 
  cursor: pointer; 
  transition: all 0.2s; 

  box-shadow: 
    0 4px 12px -4px var(--shadow-card),
    inset 0 1px 0 var(--bg-card-inset)
}

.card:hover {
  transform: translateY(-4px) scale(1.02);  /* Lift up + slight enlarge */
  box-shadow: 
    0 16px 48px -12px #00000033,   /* Deeper ambient */
    0 12px 24px -6px #00000026,   /* Pronounced drop */
    inset 0 1px 0 var(--bg-card-inset),
    0 1px 0 #ffffff99;       /* Brighter top highlight */
    border-color: var(--card-sel-border);
}

.card.selected { 
  border-color: var(--card-sel-border);
  border-width: 2px;
  background: var(--card-sel-bg);
    box-shadow: var(--card-sel-shadow);
}

.card h3 { 
  margin: 0 0 6px 0; s
  color: var(--accent); 
  font-size: 0.8rem;
  font-weight: 600;
}


.card small {
  opacity: 0.65;
  font-size: 0.7rem;
  display: block;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
  .main-layout {
    flex-direction: column;
  }

  
  .subprojects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .racing-chart {
    height: 350px;
  }
}
/* === TOOLTIP CONTAINER === */
.chart-tooltip {
  position: fixed;
  background: var(--tooltip-bg);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
  min-width: 280px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px var(--shadow-lg);
}

.chart-tooltip.visible { opacity: 1; visibility: visible; }

/* === HEADER === */
.tooltip-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--tooltip-header-text);
  text-align: center;
  border-bottom: 1px solid var(--border-default);
  background: var(--tooltip-header-bg);
  border-radius: 12px 12px 0 0;
}

/* === USER LIST === */
.tooltip-users {
  padding: 4px 0 0 0;                    /* Only top padding */
  max-height: 200px;
  overflow-y: auto;
}

.tooltip-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;                    /* Consistent per row */
  transition: background 0.15s ease;
}

.tooltip-user:hover { background: var(--tooltip-header-bg); }

.tooltip-user-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tooltip-user-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
filter: drop-shadow(0 0 1px currentColor);
}

.tooltip-user-name span {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-user-value {
  color: var(--data-numeric);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-left: 12px;
  flex-shrink: 0;
  font-feature-settings: "tnum";
}

/* === DASHED LINE (only after last user) === */
.tooltip-users::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(to right,
              transparent 0%,
              rgba(148,163,184,0.3) 20%,
              rgba(148,163,184,0.3) 80%,
              transparent 100%);
  margin: 6px 16px 0 16px;   /* Only top margin */
}

/* === FOOTER === */
.tooltip-footer {
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text-primary)99;
  border-top: 1px solid var(--border-white-faint);
  background: var(--bg-overlay-soft);
  border-radius: 0 0 12px 12px;
  text-align: center;
   font-family: var(--font-ui);
}

/* === NO DATA === */
.no-data-message {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* === SCROLLBAR === */
.tooltip-users::-webkit-scrollbar { width: 6px; }
.tooltip-users::-webkit-scrollbar-track { background: var(--bg-overlay-soft); }
.tooltip-users::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.5); border-radius: 3px; }
.tooltip-users::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.7); }





.mode-tab.active {
  background: transparent;
  color: var(--text-on-accent);
  padding: 6px 16px;
  font-size: 1rem;
  letter-spacing: 0.2px;
  border: none;
  border-radius: 0.75rem;
  transition: color 0.15s ease-in-out;
  font-family: var(--font-ui); 
}

/* ═══ SLIDING PILL TOGGLE ═══ */
.mode-toggle-header {
  position: relative;
}

.mode-toggle-header .mode-tab {
  position: relative;
  z-index: 2;
  background: transparent !important;
}

.mode-slider-bg {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  background: var(--pill-mode);
  border-radius: 0.75rem;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.mode-toggle-header.team-active .mode-slider-bg {
  /* JS handles positioning */
}

/* ═══ SLIDING PILL — TIME BUTTONS ═══ */
.time-buttons {
  position: relative;
}

.time-buttons .time-btn {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: none !important;
}

.time-slider-bg {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  background: var( --accent-teal);
  border-radius: 5px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}



.subprojects-grid {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.subprojects-grid > * {
  padding: 0.75rem;
  font-size: 0.9rem;
}


.header-left p {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.4;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
margin-right: 0.5rem;
  margin-top: 2.2rem;
}

.theme-btn, .refresh-btn {
    background: var(--tooltip-header-bg);
    border: 1px solid rgba(77, 182, 186, 0.52);
    color: rgba(123, 208, 160, 0.75);
    padding: 0.5rem;
}

.leaderboard-table thead {
  background: var(--bg-deep) !important;  /* solid deep navy, no transparency */
  border-bottom: 1px solid var(--thead-accent) !important;  
  box-shadow: 0 4px 12px var(--shadow-heavy) !important;
  border-spacing: 0 !important;
}

.leaderboard-table th {
  background: transparent !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px;
  padding: 1rem !important;
}

.leaderboard-table td,
.leaderboard-table th {
  border-left: none !important;
  border-right: none !important;
}

/* Cell colors — from your desktop app */
.leaderboard-table td:nth-child(1) { color: var(--data-rank); font-weight: 700; } /* RANK */
.leaderboard-table td:nth-child(2) { color: var(--text-third); font-weight: 600; } /* USER */
.leaderboard-table td:nth-child(3) { color: var(--data-today); } /* TODAY */
.leaderboard-table td:nth-child(4) { color: var(--data-yesterday); text-align: right; } /* YESTERDAY */
.leaderboard-table td:nth-child(5) { color: var(--data-week) } /* PAST 7D */
.leaderboard-table td:nth-child(6) { color: var(--data-teal);} /* TOTAL CREDIT */
.leaderboard-table td:nth-child(7) { color: var(--data-percent); } /* % OF POINTS */




.leaderboard-table th:nth-child(1) { width: 5%; }   /* RANK */
.leaderboard-table th:nth-child(2) { width: 25%; }  /* USER */
.leaderboard-table th:nth-child(3) { width: 14%; }  /* TODAY */
.leaderboard-table th:nth-child(4) { width: 14%; }  /* YESTERDAY */
.leaderboard-table th:nth-child(5) { width: 14%; }  /* PAST 7 DAYS */
.leaderboard-table th:nth-child(6) { width: 14%; }  /* TOTAL CREDIT */
.leaderboard-table th:nth-child(7) { width: 14%; }  /* % OF POINTS */


/* Show 3 columns when there are many subprojects */
.subprojects-grid.many-items {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: -1.43rem;
}

.subprojects-grid.many-items .card {
  padding: 8px 10px; /* Slightly smaller cards */
  font-size: 0.85rem;

}

/* === CUSTOM DROPDOWN STYLES === */
.custom-dropdown {
  position: relative;
  display: inline-block;
  min-width: 34rem;              
  font-family: var(--font-ui);
  font-weight: 600;
  z-index: 10;
}

.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--project-selector);  /* Or your gradient: linear-gradient(235deg, #1e293b, #334155) */
  border: 1px solid var(--border-white-faint);
  border-radius: 0.75rem;
  color: var(--dropdown-trigger);
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.15s ease-in-out;
  font-weight: 600;
  /* 3D layered shadows: replace/enhance your var(--card-hover-shadow) */
  box-shadow: 
    0 8px 32px -8px rgba(0, 0, 0, 0.15),     /* Ambient diffusion */
    0 4px 16px -6px rgba(0, 0, 0, 0.12),     /* Main drop shadow */
    0 2px 8px -4px rgba(0, 0, 0, 0.08),      /* Subtle contact edge */
    inset 0 1px 0 rgba(255, 255, 255, 0.2);  /* Top light highlight */
}

.dropdown-trigger:hover,
.dropdown-trigger:focus {
  transform: translateY(-3px) scale(1.01);  /* Stronger lift + micro-scale */
  box-shadow: 
    0 20px 48px -12px rgba(0, 0, 0, 0.25),   /* Deeper hover ambient */
    0 12px 32px -8px rgba(0, 0, 0, 0.2),     /* Elevated drop */
    0 4px 12px -4px rgba(0, 0, 0, 0.15),     /* Pronounced edge */
    inset 0 1px 0 rgba(255, 255, 255, 0.3),  /* Brighter highlight */
    0 0 0 1px rgba(255, 255, 255, 0.1);      /* Outer glow rim */
}


.dropdown-text {
  flex-shrink: 0;
  white-space: nowrap;
}

.sub-projects-label {
  opacity: 0.65;
  font-size: 0.85rem;
  white-space: nowrap;
}

.dropdown-arrow {
  flex-shrink: 0;
  width: 1rem;
  color: var(--dropdown-arrow);
  height: auto;
  transition: transform 0.18s ease;
}

/* open state */
.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--dropdown-arrow);
}

/* menu */
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: 100%;
  background: var(--dropdown-bg);
  border: 1px solid var(--border-white-dim);
  border-radius: 0.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 99999;
}

/* Scrollbar styling for dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: var(--bg-overlay-soft);
  border-radius: 0 0.75rem 0.75rem 0;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--accent-green-dim);
  border-radius: 4px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(80, 250, 123, 0.5);
}


/* menu items */
.dropdown-item {
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  color: var(--dropdown-item);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item.active {
  background: var(--dropdown-active-bg);
  color: var(--dropdown-active-text);
  font-weight: 700;
}

/* checkmark shown on active */
.dropdown-item .check-icon {
  margin-left: auto;
  opacity: 0;
  transform: translateX(5px);
  transition: opacity .15s ease, transform .15s ease;
}

.dropdown-item.active .check-icon {
  opacity: 1;
  transform: translateX(0);
}


/* --- Arrow --- */
.project-selector .dropdown-arrow {
  width: 14px;
  height: 9px;
  opacity: 0.85;
  transform-origin: center;
  transition: transform .18s ease;
}

.project-selector.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* --- Menu --- */
.project-selector .dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  background: var(--projsel-bg);
  border: 1px solid var(--border-white-dim);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: var(--projsel-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 99999;
  margin-top: -0.5rem;
}

/* Scrollbar for project selector dropdown */
.project-selector .dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.project-selector .dropdown-menu::-webkit-scrollbar-track {
  background: var(--bg-overlay-soft);
  border-radius: 0 12px 12px 0;
}

.project-selector .dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--accent-purple-dim);
  border-radius: 4px;
}

.project-selector .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple-hover);
}


.project-selector.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Items --- */
.project-selector .dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  cursor: pointer;
  color: var(--projsel-item-text);
  font-size: 1rem;
  transition: background .12s ease;
}

.project-selector .dropdown-item:hover {
  background: #ffffff0a; /* dark mode */
}

[data-theme="light"] .project-selector .dropdown-item:hover {
  background: #00000010; /* light mode - dark tint instead of white */
}

.project-selector .dropdown-item.active {
  background: var(--projsel-active-bg);
  color: var(--projsel-active-text);
  font-weight: 700;
}

.project-selector .dropdown-item .check-icon {
  margin-left: auto;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .12s ease, transform .12s ease;
  color: var(--projsel-active-text);
  font-weight: 700;
  font-size: 1.1rem;
}

.project-selector .dropdown-item.active .check-icon {
  opacity: 1;
  transform: translateX(0);
}

.project-selector .custom-dropdown {
  width: 100%;
  position: static;
}

.project-selector .dropdown-trigger {
  width: 100%;
}

.project-selector .dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.project-selector .custom-dropdown {
  flex: 1 1 auto;
  width: 100%;
  min-width: 180px;
}

.project-selector .dropdown-trigger {
  width: 100%;
}

/* === private users in LHC  === */
.private-user {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.detective-emoji {
  height: 1.2em;
  width: auto;
  vertical-align: -0.15em;
  opacity: 0.9;
  transition: all 0.2s ease;
  image-rendering: -webkit-optimize-contrast; /* Crisp on all screens */
}

.detective-emoji:hover {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 0 3px var(--detective-glow));
}

.detective-emoji:hover {
  animation: flicker 0.4s ease-in-out;
}

@keyframes flicker {
  0%, 100% { filter: drop-shadow(0 0 4px var(--detective-flicker)); }
  50% { filter: drop-shadow(0 0 8px var(--detective-flicker-alt)); }
}

/* ---- CUSTOM DROPDOWN (open state) ---- */
.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 100002;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Sortable table header styles */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

th.sortable:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

th.sortable .sort-indicator {
  display: inline-block;
  margin-left: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  vertical-align: middle;
}

th.sortable .sort-indicator .sort-arrow {
  display: inline-block;
  width: 8px;
  height: 12px;
  color: var(--data-teal);  /* Green color matching your theme */
}

th.sortable.sort-active .sort-indicator {
  opacity: 1;
}

th.sortable.sort-active {
  background-color: rgba(255, 255, 255, 0.08);
}




#page-title {
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0;
}
/* ========================================
   USER ACTIVITY TABLE (USER PROFILE PAGES)
   ======================================== */

#subprojects-grid thead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-deep);
  box-shadow: 0 2px 8px var(--shadow-lg);
}

/* User activity table - use same structure as main leaderboard but with 7 columns in different order */
.user-project-row td:nth-child(1) { color: var(--data-rank);  } /* RANK */
.user-project-row td:nth-child(2) { color: var(--text-primary);  } /* PROJECT */
.user-project-row td:nth-child(3) { color: var(--data-today);  } /* TODAY */
.user-project-row td:nth-child(4) { color: var(--data-yesterday);  } /* YESTERDAY */
.user-project-row td:nth-child(5) { color: var(--data-week);  } /* PAST 7D */
.user-project-row td:nth-child(6) { color: var(--data-teal);  } /* TOTAL CREDIT */
.user-project-row td:nth-child(7) { color: var(--data-percent);  } /* % */

/* ================================================================
   ROW SELECTION - Handled via inline styles in JavaScript
   ================================================================ */

/* Regular user-project-row styling */
.user-project-row {
  cursor: pointer;
}

.user-project-row:hover:not(.selected) {
  background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(96, 98, 138, 0.092));
}



/* ===== GROUP SEPARATOR ROWS (header rows) ===== */

/* Default background for group-separator td elements */
tr.group-separator td {
  background: var(--bg-deep);
  padding: 12px 16px;
}

/* Hover state - only when not selected */
tr.group-separator:hover:not(.selected) td {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Clickable cells get pointer cursor */
tr.group-separator td.clickable {
  cursor: pointer;
}

/* Project name cell styling */
tr.group-separator td.project-name-cell {
  color: var(--project-name-color);
  text-align: left;
}


.user-line.auto-highlighted {
  filter: drop-shadow(0 0 8px currentColor);
  stroke-width: 1.5 !important;
  opacity: 1 !important;
}

@keyframes subtle-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px currentColor); }
  50% { filter: drop-shadow(0 0 10px currentColor); }
}

.pulse-highlight {
  animation: subtle-pulse 2s ease-in-out infinite;
}


.back-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--back-btn-bg);
  color: var(--back-btn-text);                    /* ← this forces the text + arrow */
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* ================================================================
   CUSTOM DATE RANGE PICKER POPUP
   ================================================================ */

.calendar-popup {
  position: absolute;
  top: 60px;
  right: 20px;
  background: var(--bg-calendar);
  border: 1px solid var(--border-calendar);
  border-radius: 8px;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px var(--shadow-heavy);
  min-width: 320px;
  overflow: hidden;
}

.calendar-popup.hidden {
  display: none;
}

.calendar-header {
  background: var(--bg-calendar-input);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-calendar);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.calendar-body {
  padding: 16px;
}

.date-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-input-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.calendar-popup input[type="date"] {
  width: 100%;
  background: var(--bg-calendar-input);
  color: var(--text-primary);
  border: 1px solid var(--border-calendar-input);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calendar-popup input[type="date"]:hover {
  border-color: var(--border-calendar-input);
}

.calendar-popup input[type="date"]:focus {
  outline: none;
  border-color: var(--tooltip-header-text);
  box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

/* Style the date picker icon/calendar icon */
.calendar-popup input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.calendar-popup input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* Only target buttons INSIDE calendar-actions */
.calendar-actions .btn-apply,
.calendar-actions .btn-cancel,
.calendar-actions .btn-clear {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-actions .btn-apply {
  background: var(--accent-blue);
  color: white;
}

.calendar-actions .btn-apply:hover {
  background: var(--accent-blue-hover);
}

.calendar-actions .btn-apply:active {
  background: var(--accent-blue-active);
}

.calendar-actions .btn-cancel {
  background: var(--btn-cancel-bg);
  color: var(--btn-cancel-text);
}

.calendar-actions .btn-cancel:hover {
  background: var(--btn-cancel-hover);
}

.calendar-actions .btn-cancel:active {
  background: var(--btn-cancel-bg);
}

.calendar-actions .btn-clear {
  background: var(--btn-danger);
  color: white;
  margin-right: auto;
}

.calendar-actions .btn-clear:hover {
  background: var(--btn-danger-hover);
}

.calendar-actions .btn-clear:active {
  background: var(--btn-danger-active);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-popup {
    right: 10px;
    min-width: 280px;
  }
}

/* Animation for popup appearance */
.calendar-popup:not(.hidden) {
  animation: popupSlideIn 0.2s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   CONTROL PANEL - Positioned over chart
   ======================================== */

/* Make chart section the positioning context */
.chart-section {
  position: relative;
}

/* Control panel floats over chart */
.control-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  transform: translateY(-4.4rem); 
  background: var(--bg-control-panel);
  border-radius: 10px;
  padding: 0.4rem;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 2px 8px var(--shadow-sm);
  margin-right: -0.7rem;
}

/* Divider */
.control-divider {
  width: 1px;
  height: 28px;
  background: var(--border-divider);
  flex-shrink: 0;
}

/* Hide the sidebar mode-toggle */
.subprojects-sidebar .mode-toggle {
  display: none !important;
}

.mode-toggle-header {
  display: inline-flex !important;
}

/* Mode toggle styling */
.mode-toggle {
  background: var(--bg-control-group);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--mode-tab-text);
  padding: 6px 16px;
  border-radius: 5px;
  cursor: pointer;

  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}



/* Time buttons */
.time-buttons {
  display: inline-flex;
  background: var(--bg-control-group);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.time-btn {
  background: transparent;
  border: none;
  color: var(--mode-tab-text);
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: 80px;
  min-height: 35px;
}


.time-btn.active {
  background: color: var(--accent-teal);
  color: var(--text-on-accent);
}

/* Hide mode toggle for teamless users */
.mode-toggle.hidden-no-team {
  display: none !important;
}

.around-you-scrollable {
  max-height: 81vh;
  overflow-y: auto;
  display: block;
  /* Add your Dracula-themed scrollbar styles here */
}

/* Example Dracula scrollbar styling: */
.around-you-scrollable::-webkit-scrollbar {
  width: 8px;
}

.around-you-scrollable::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.around-you-scrollable::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

.around-you-scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--pill-mode);
}


.subproject-name-cell {
  padding: 14px 16px;
  font-weight: 700;
}


.around-you-sidebar h3 {
  font-size: 2rem;               
  color: var(--text-primary);                    
  letter-spacing: 0.8px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}


.group-separator td.project-name-cell-flat {
  color: var(--project-name-color);
  text-align: left;
}
.around-you-row.owner-highlight {
    background: var(--owner-row) !important;
}

/* Selected comparison user in around you table - blue highlight */
.around-you-row.selected-comparison {
    background: var(--comparison-row) !important;
  /*  border-left: 3px solid rgba(100, 149, 237, 0.8) !important; */
}

/* Wrapper for input + clear button */
.search-wrapper {
  position: relative;
  display: inline-block;
  width: 12rem;               /* ← adjust this to your preferred width */
  min-width: 12rem;
}

/* The input itself */
.leaderboard-controls input[type="text"]#search-users {
  width: 100%;
  padding: 10px 36px 10px 12px;    /* right padding MUST be > button width */
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-input);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.leaderboard-controls input[type="text"]#search-users::placeholder {
  color: var(--text-placeholder-alt);
}

.leaderboard-controls input[type="text"]#search-users:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-glow);
  background: var(--bg-input-focus);
}

#search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  
  width: 20px;
  height: 20px;
  min-width: 20px; /* Force it */
  max-width: 20px; /* Lock it down */
  padding: 0;
  margin: 0;
  
  display: none;
  flex-shrink: 0; /* Don't let it grow */
  
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  
  transition: color 0.15s;
  z-index: 5;
  overflow: hidden; /* Clip anything outside the 20x20 box */
}

@keyframes landingFlash {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(0.1); }
  40%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.2); }
}

@keyframes smokePuff {
  0%   { opacity: 0; transform: scale(0.3); }
  20%  { opacity: 0.7; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(2.8) translateY(-30px); }
}




/* Theme Toggle - ACTUAL around.css from toggles.dev */
.theme-toggle.theme-toggle--reversed .theme-toggle__around {
  transform: scale(-1, 1);
}

.theme-toggle {
  --theme-toggle__around--duration: 500ms;
  border: none;
  background: none;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  border-radius: 50%;
  min-width: 0rem;
  padding: 0;
}

.theme-toggle:hover {
  transform: scale(1.15);
  background: #cbd5e126;
}

.theme-toggle input[type="checkbox"] {
  display: none;
}

.theme-toggle .theme-toggle-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.theme-toggle__around * {
  transform-origin: center;
  transition: transform calc(var(--theme-toggle__around--duration) * 0.6) ease;
}

.theme-toggle__around > g g circle {
  transition-duration: calc(var(--theme-toggle__around--duration) * 0.2);
}

.theme-toggle__around > g g :nth-child(1) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.253);
}

.theme-toggle__around > g g :nth-child(2) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.348);
}

.theme-toggle__around > g g :nth-child(3) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.443);
}

.theme-toggle__around > g g :nth-child(4) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.538);
}

.theme-toggle__around > g g :nth-child(5) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.633);
}

.theme-toggle__around > g g :nth-child(6) {
  transition-delay: calc(var(--theme-toggle__around--duration) * 0.728);
}

.theme-toggle__around > :first-child path {
  transition-property: transform, d;
}

.theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around *,
.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around * {
  transition-delay: 0s;
  transition-duration: var(--theme-toggle__around--duration);
}

.theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around > g > circle,
.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around > g > circle {
  transform: scale(1.4);
}

.theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around > g g circle,
.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around > g g circle {
  transform: scale(0);
  transition-duration: calc(var(--theme-toggle__around--duration) * 0.4);
}

.theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around > :first-child,
.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around > :first-child {
  transform: rotate(-90deg);
}

.theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around > :first-child path,
.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around > :first-child path {
  d: path("M-12-14h42v30a1 1 0 00-16 13H0Z");
}

@supports not (d: path("")) {
  .theme-toggle input[type="checkbox"]:checked ~ .theme-toggle__around:first-child path,
  .theme-toggle--toggled:not(label).theme-toggle .theme-toggle__around:first-child path {
    transform: translate3d(-12px, -14px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle:not(.theme-toggle--force-motion) * {
    transition: none !important;
  }
}

.landing-big-arrow .big-arrow-svg {
  filter: 
    drop-shadow(0 0 1px var(--shadow-color-main, #1a0f0b));
}