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

:root { 
  --bg: #111; 
  --fg: rgb(241, 245, 249) !important; 
  --card: #1a1a1a; 
  --glow: #fff; 
}

[data-theme="light"] { 
  --bg: #f8f8f8; 
  --fg: #006400; 
  --accent: #006400; 
  --card: #fff; 
  --glow: #000; 
}

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

body { 
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(21, 28, 43, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  color: rgb(226, 232, 240);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; 
  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, #f1f5f9, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

[data-theme="light"] .header h1 {
  background: linear-gradient(135deg, #1e293b, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  margin: 8px 0 0 0;
  opacity: 0.7;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Chart Title - Main Chart Title for Stats */
.chart-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
  -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: #94a3b8;
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.4;
}




.time-btn.active {
      background: rgba(51, 65, 85, 0.8) !important;
    border-color: rgb(80, 250, 123) !important;
  color: #f4f8fd;
  box-shadow: 0 2px 8px rgba(15, 255, 153, 0.2);
}

.time-btn:hover:not(.active) {
  border-color: rgba(148, 163, 184, 0.6);
  transform: translateY(-1px);
}

/* 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%;
}


.subprojects-sidebar {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-x: hidden !important;
  margin-top: -3.758rem;
}


.subprojects-grid {
  overflow-x: hidden !important;
}

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


.subprojects-sidebar h3 {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 15px;
  font-weight: 600;
}



/* 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: rgba(15, 23, 42, 0.6); border: 1px solid rgba(148, 163, 184, 0.1);  
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 1.3rem;
  margin-left: 0.2rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

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

.leaderboard-header .title h2 {
  font-size: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #e2e8f0;
}

.leaderboard-header .title p {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
  color: #94a3b8;
  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: rgba(68, 71, 90, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #f0f5ff;
  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: rgba(255, 255, 255, 0.4);
}

.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: rgba(68, 71, 90, 0.7); /* slightly darker on focus */
  color: #f0f5ff;
}

.view-tabs {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(78, 246, 59, 0.3);
    color: rgb(59, 130, 246);
    border-radius: 6px;
    cursor: pointer;
  font-size: 0.85rem;
    transition: 0.3s;
}

.view-tabs .tab {
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.view-tabs .tab.active {
    background: linear-gradient(135deg, rgb(159, 246, 60) 0%, rgb(92, 210, 246) 100%);
    animation: 2s ease-in-out infinite pulse;
    color: #494343;
}

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

.leaderboard-table thead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  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 rgba(148, 163, 184, 0.15);
  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: rgba(59, 130, 246, 0.15);
  transform: translateX(4px);
}

.leaderboard-table tbody tr.selected {
  background: rgba(74, 158, 255, 0.25) !important;
 /* border-left: 4px solid #3b82f6 !important; */ 
}

.leaderboard-table tbody tr.compared {
  background: rgba(16, 185, 129, 0.25) !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: #fb923c;
  font-family: 'Courier New', Courier, monospace;
  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: 'Courier New', Courier, monospace;
  font-weight: 900;
}
    

.trend-hot {
  color: #ef4444;
  font-weight: 600;
}

.trend-strong {
  color: #f59e0b;
  font-weight: 600;
}

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

.trend-steady {
  color: #6b7280;
  font-weight: 500;
}

.trend-cooling {
  color:#3b82f6;
  font-weight: 600;
}

.trend-slow {
  color:#f8f8f2;
  font-weight: 600;
}

button { 
  background: #3a3d52;
  border: 1px solid #4a4d62;
  border-radius: 6px;
  color: #ffffff;
  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 { 
  background: #4a4d62;
  border: 1px solid #64b5f6;


}

/* Chart container */
.chart-container { 
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0rem 0rem 2rem 0rem;
  border-radius: 0.75rem; 
  margin: 10px 0; /* Reduced from 20px */
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
  position: relative;
  overflow: hidden; /* Clip children to border-radius */
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.racing-chart { 
  position: relative; 
  width: 100%; 
  height: 500px; 
}

/* 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, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  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;
  background: rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer !important; 
  transition: all 0.2s;
}

.racing-name-item:hover,
.user-name:hover {
  background: rgba(59, 130, 246, 0.2);
}

.racing-name-item.active,
.user-name.active {
  background: rgba(59, 130, 246, 0.3);
}

.racing-name-item.you,
.user-name.you {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%);
  border: 1px solid rgba(59, 130, 246, 0.5);
}

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


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

.racing-name-item.hidden-user:hover,
.user-name.hidden-user:hover {
  opacity: 0.6;
  background: rgba(59, 130, 246, 0.15);
}

.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: #e2e8f0;
  text-align: right;
  font-family: "Courier New", monospace;
  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, rgba(148, 163, 184, 0.2) 0.5px, transparent 0.5px),
  linear-gradient(to bottom, rgba(148, 163, 184, 0.2) 0.5px, transparent 0.5px);
  background-size: 14.28% 12.5%;
}

.grid-line { 
  position: absolute; 
  width: 100%; 
  height: 1px; 
  background: rgba(148, 163, 184, 0.15);
}

.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%,
    #3b82f6 30%,
    #3b82f6 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 rgba(59, 130, 246, 0.4),
    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: #ffffff;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 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; /* Just slightly thicker, not dramatic */
  opacity: 0.9; /* Subtle opacity increase */
  filter: drop-shadow(0 0 2px currentColor); /* Gentle glow */
}


.user-line-you:hover {
  stroke-width: 2.5; /* Minimal increase */
  opacity: 1;
  filter: drop-shadow(0 0 2px #E4F34A);
}

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

/* 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: #f8f8f2;
  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: #94a3b8;
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
}

/* Subprojects - 2 column cards */
.card { 
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  padding: 10px 12px; 
  border-radius: 10px; 
  border: 1px solid rgba(148, 163, 184, 0.1); 
  cursor: pointer; 
  transition: all 0.2s; 

  box-shadow: 
    0 4px 12px -4px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.09)
}

.card:hover { 
  border-color: #0ba2c466; 
  transform: translateY(-2px);
    box-shadow: 0 2px 9px #0ba2c466;
}

.card.selected { 
  border-color: #0ba2c449;
  border-width: 2px;
  background: #3baef631;
    box-shadow: 0 2px 9px hsla(191, 89%, 41%, 0.25);
}

.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: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  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 rgba(0, 0, 0, 0.4);
}

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

/* === HEADER === */
.tooltip-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #3b82f6;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(59, 130, 246, 0.1);
  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: rgba(59, 130, 246, 0.1); }

.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;
  box-shadow: 0 0 8px currentColor;
}

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

.tooltip-user-value {
  color: #fb923c;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  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: #e2e8f099;
  border-top: 1px solid #ffffff14;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 12px 12px;
  text-align: center;
   font-family: Arial, Helvetica, sans-serif;
}

/* === NO DATA === */
.no-data-message {
  padding: 20px 16px;
  text-align: center;
  color: rgba(226, 232, 240, 0.5);
  font-size: 0.85rem;
}

/* === SCROLLBAR === */
.tooltip-users::-webkit-scrollbar { width: 6px; }
.tooltip-users::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
.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:hover {
 background: #ffffff01;
  backdrop-filter: blur(10px);
}

.mode-tab.active {
  background: #8be9fd;
  border-color: #ffffff26;
  color: #1e222a;
  padding: 6px 14px;
  font-size: 1rem;
  letter-spacing: 0.2px;
  border: 1px solid #ffffff0f;
  border-radius: 0.75rem;
  backdrop-filter: blur(10px);
  transition: all 0.15s ease-in-out;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; 
}



.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: #94a3b8;
  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: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(77, 182, 186, 0.52);
    color: rgba(123, 208, 160, 0.75);
    padding: 0.5rem;
}

.leaderboard-table thead {
  background: #0d1421 !important;  /* solid deep navy, no transparency */
  border-bottom: 1px solid #3bd4f6 !important;  
  box-shadow: 0 4px 12px rgba(0,0,0,0.6) !important;
  border-spacing: 0 !important;
}

.leaderboard-table th {
  background: transparent !important;
  color: #e2e8f0 !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: #8be9fd; font-weight: 700; } /* RANK */
.leaderboard-table td:nth-child(2) { color: #e2e8f0; font-weight: 600; } /* USER */
.leaderboard-table td:nth-child(3) { color: #f59e0b; } /* TODAY */
.leaderboard-table td:nth-child(4) { color: #a689fa; text-align: right; } /* YESTERDAY */
.leaderboard-table td:nth-child(5) { color: #00bafd } /* PAST 7D */
.leaderboard-table td:nth-child(6) { color: #10b981;} /* TOTAL CREDIT */
.leaderboard-table td:nth-child(7) { color: #4899ec; } /* % 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: system-ui, sans-serif;
  font-weight: 600;
}

/* trigger (the closed dropdown button) */
.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
                                                               /*   background: linear-gradient(235deg, #1e293b, #334155); */
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  color: #e5ecf5;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 2px 9px #0ba2c466;
  backdrop-filter: blur(6px);
  transition: all 0.15s ease-in-out;
  font-weight: 600;
}

.dropdown-trigger:hover {
  transform: translateY(-1px);
}

.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:#10b981;
  height: auto;
  transition: transform 0.18s ease;
}

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

/* menu */
.dropdown-menu {
  position: absolute;
  right: 0;                    /* aligns to right edge */
  top: calc(100% + 0.4rem);
  width: 100%;
  background: rgba(16,18,25,0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  overflow: hidden;
  z-index: 200;
}

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

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

.dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}

.dropdown-item.active {
  background: linear-gradient(90deg, rgba(79,70,229,0.15), rgba(96,165,250,0.05));
  color: #cfe8ff;
  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);
}


/* Hover effect */
.project-selector .dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

/* --- 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;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(24,26,32,0.9), rgba(17,19,24,0.86));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 36px rgba(2,6,23,0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 150;
  overflow: hidden;
}

.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: #dfe9f7;
  font-size: 1rem;
  transition: background .12s ease;
}

.project-selector .dropdown-item:hover {
  background: rgba(255,255,255,0.04);
}

.project-selector .dropdown-item.active {
  background: linear-gradient(90deg, rgba(79,70,229,0.06), rgba(96,165,250,0.03));
  color: #8b7dff;
  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: #8b7dff;
  font-weight: 700;
  font-size: 1.1rem;
}

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




/* === 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 rgba(255, 215, 0, 0.6));
}

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

@keyframes flicker {
  0%, 100% { filter: drop-shadow(0 0 4px #ffd700); }
  50% { filter: drop-shadow(0 0 8px #ff4500); }
}

/* ---- CUSTOM DROPDOWN (open state) ---- */
.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.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: #10b981;  /* 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: rgba(15, 23, 42, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* User activity table - use same structure as main leaderboard but with 7 columns in different order */
.user-project-row td:nth-child(1) { color: #8be9fd;  } /* RANK */
.user-project-row td:nth-child(2) { color: #e2e8f0;  } /* PROJECT */
.user-project-row td:nth-child(3) { color: #f59e0b;  } /* TODAY */
.user-project-row td:nth-child(4) { color: #a78bfa;  } /* YESTERDAY */
.user-project-row td:nth-child(5) { color: #4899ec;  } /* PAST 7D */
.user-project-row td:nth-child(6) { color: #10b981;  } /* TOTAL CREDIT */
.user-project-row td:nth-child(7) { color: #00bafd;  } /* % */

/* ================================================================
   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: #0d1421;
  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: rgb(80, 250, 123);
  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: #50FA7B;
  color: #000;                    /* ← this forces the text + arrow */
  border: 1px solid rgba(148, 163, 184, 0.4);
  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: #1e2229;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  min-width: 320px;
  overflow: hidden;
}

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

.calendar-header {
  background: #2d333b;
  padding: 12px 16px;
  border-bottom: 1px solid #444;
  font-weight: 600;
  color: #e2e8f0;
  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: #94a3b8;
  font-weight: 500;
}

.calendar-popup input[type="date"] {
  width: 100%;
  background: #2d333b;
  color: #e2e8f0;
  border: 1px solid #555;
  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: #666;
}

.calendar-popup input[type="date"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 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: #3b82f6;
  color: white;
}

.calendar-actions .btn-apply:hover {
  background: #2563eb;
}

.calendar-actions .btn-apply:active {
  background: #1d4ed8;
}

.calendar-actions .btn-cancel {
  background: #374151;
  color: #d1d5db;
}

.calendar-actions .btn-cancel:hover {
  background: #4b5563;
}

.calendar-actions .btn-cancel:active {
  background: #374151;
}

.calendar-actions .btn-clear {
  background: #dc2626;
  color: white;
  margin-right: auto;
}

.calendar-actions .btn-clear:hover {
  background: #b91c1c;
}

.calendar-actions .btn-clear:active {
  background: #991b1b;
}

/* 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: #343a46;
  border-radius: 10px;
  padding: 0.4rem;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-right: -0.7rem;
}

/* Divider */
.control-divider {
  width: 1px;
  height: 28px;
  background: #44475a;
  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: #1e222a;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: #a6adc8;
  padding: 6px 16px;
  border-radius: 5px;
  cursor: pointer;

  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mode-tab:hover {
  color: #1e6e90;
}



/* Time buttons */
.time-buttons {
  display: inline-flex;
  background: #1e222a;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.time-btn {
  background: transparent;
  border: none;
  color: #a6adc8;
  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:hover {
  color: #cdd6f4;
}

.time-btn.active {
  background: #50fa7b !important;
  color: #1e222a;
}

/* 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: #282a36;
}

.around-you-scrollable::-webkit-scrollbar-thumb {
  background: #6272a4;
  border-radius: 4px;
}

.around-you-scrollable::-webkit-scrollbar-thumb:hover {
  background: #8be9fd;
}


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


.around-you-sidebar h3 {
  font-size: 1.65rem;               
  font-weight: 800;
  color: #e2e8f0;                    
  letter-spacing: 0.8px;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}


.group-separator td.project-name-cell-flat {
  color: rgb(80, 250, 123);
  text-align: left;
}
.around-you-row.owner-highlight {
    background: rgba(251, 191, 36, 0.15) !important;
}

/* Selected comparison user in around you table - blue highlight */
.around-you-row.selected-comparison {
    background: rgba(100, 149, 237, 0.2) !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: rgba(68, 71, 90, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  color: #f0f5ff;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.leaderboard-controls input[type="text"]#search-users::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.leaderboard-controls input[type="text"]#search-users:focus {
  border-color: #6b9eff;
  box-shadow: 0 0 0 3px rgba(107, 158, 255, 0.25);
  background: rgba(68, 71, 90, 0.75);
}

#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: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  cursor: pointer;
  
  transition: color 0.15s;
  z-index: 5;
  overflow: hidden; /* Clip anything outside the 20x20 box */
}