/* Helaplus Signal — theme */

.bg-gradient-radial {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(159,232,112,0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(159,232,112,0.06), transparent 60%),
    radial-gradient(ellipse 90% 60% at 100% 100%, rgba(125,217,79,0.08), transparent 60%),
    linear-gradient(180deg, #050607 0%, #0a0c0e 60%, #050607 100%);
}

/* panels */
.panel {
  background:
    linear-gradient(180deg, rgba(13,29,34,0.8), rgba(7,16,20,0.85));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 20px 40px -20px rgba(0,0,0,0.6);
}

.panel-title { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.panel-sub { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

/* chips (pill buttons) */
.chips { display: inline-flex; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 999px; padding: 4px; gap: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #cbd5e1; background: transparent; border: 1px solid transparent;
  transition: all .15s ease;
}
.chips .chip { padding: 6px 14px; }
.chips .chip:hover { color: #fff; }
.chip-active, .chips .chip-active {
  background: linear-gradient(180deg, #9FE870, #5B8D38);
  color: #021812 !important;
  box-shadow: 0 4px 14px -4px rgba(159,232,112,.6);
}
/* standalone chips (outside .chips) get a visible border */
.chip:not(.chips .chip):not(.chip-active) {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

/* ghost buttons (top bar) */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px; font-size: 12px; font-weight: 600;
  color: #cbd5e1; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all .15s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* section headers */
.section-header {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.2em; font-weight: 700;
  padding: 6px 14px; border-radius: 8px;
  color: #C6F3A3; background: rgba(159,232,112,0.08);
  border: 1px solid rgba(159,232,112,0.18);
}
.section-header--brand { color: #C6F3A3; }
.section-header--accent { color: #9FE870; background: rgba(159,232,112,0.08); border-color: rgba(159,232,112,0.2); }
.section-header--violet { color: #c4b5fd; background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.2); }

/* top nav tabs */
.tab {
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: #cbd5e1; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.tab:hover { background: rgba(255,255,255,0.05); color: #fff; }
.tab-active {
  color: #021812;
  background: linear-gradient(180deg, #9FE870, #9FE870);
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(159,232,112,.6);
}

/* big tabs (leaderboard header) */
.tab-big {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; font-size: 14px; font-weight: 600; color: #cbd5e1;
  background: rgba(255,255,255,0.02);
}
.tab-big-active {
  background: linear-gradient(180deg, #9FE870, #5B8D38);
  color: #021812;
}
.tab-big:hover { color: #fff; }
.tab-big-active:hover { color: #021812; }

/* KPI cards */
.kpi-card {
  position: relative;
  background: linear-gradient(180deg, rgba(13,29,34,0.85), rgba(7,16,20,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
  cursor: pointer;
}
.kpi-card:hover { border-color: rgba(159,232,112,0.35); transform: translateY(-1px); }
.kpi-label { font-size: 10px; letter-spacing: 0.15em; font-weight: 700; color: #94a3b8; line-height: 1.3; }
.kpi-value { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; margin-top: 6px; }
.kpi-sub { font-size: 10.5px; color: #94a3b8; margin-top: 4px; line-height: 1.4; }
.kpi-hint { font-size: 10px; color: #64748b; margin-top: 6px; }
.kpi-badge {
  position: absolute; top: 10px; right: 10px;
  height: 20px; min-width: 20px; padding: 0 6px; border-radius: 6px;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* pipeline cards */
.pipe-card {
  background: linear-gradient(180deg, rgba(13,29,34,0.85), rgba(7,16,20,0.9));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px; padding: 16px; position: relative; overflow: hidden;
  transition: all .2s ease; cursor: pointer;
}
.pipe-card:hover { border-color: rgba(159,232,112,0.35); }
.pipe-label { font-size: 11px; letter-spacing: 0.15em; font-weight: 700; color: #cbd5e1; line-height: 1.3; }
.pipe-value { font-size: 2.25rem; font-weight: 800; color: #fff; margin-top: 10px; line-height: 1; }
.pipe-sub { font-size: 11px; color: #94a3b8; margin-top: 8px; line-height: 1.5; }
.pipe-hint { font-size: 10.5px; color: #64748b; margin-top: 6px; }

/* stage cards (TAT) */
.stage-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 14px;
}

/* pill badge */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

/* mini tiles */
.mini-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
}
.tile-label { font-size: 9px; letter-spacing: 0.15em; font-weight: 700; color: #94a3b8; margin-top: 2px; }

/* legend */
.legend-dot {
  display: inline-block; height: 10px; width: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle;
}

/* leaderboard */
#leaderboardTable tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
#leaderboardTable tbody tr:hover { background: rgba(159,232,112,0.04); }
#leaderboardTable td { padding: 14px 16px 14px 0; vertical-align: top; }

.rank-badge {
  width: 36px; height: 36px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  background: rgba(255,255,255,0.04); color: #cbd5e1;
}
.rank-1 { background: linear-gradient(180deg, #f59e0b, #d97706); color: #1a0f00; }
.rank-2 { background: linear-gradient(180deg, #94a3b8, #64748b); color: #0a0f14; }
.rank-3 { background: linear-gradient(180deg, #f97316, #ea580c); color: #1a0800; }

.progress-bar {
  height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px;
}
.progress-bar > span { display: block; height: 100%; }

/* ---------- global loading state ---------- */

/* Indeterminate progress bar: a bright sliver sweeps across the top. */
@keyframes hp-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.animate-hp-slide { animation: hp-slide 1.2s ease-in-out infinite; }

/* Spinner rotation (referenced by inline SVGs). */
@keyframes hp-spin { to { transform: rotate(360deg); } }
.animate-hp-spin { animation: hp-spin 0.8s linear infinite; }

/* Any element the progress script tagged as "busy". */
.is-loading {
  opacity: 0.7;
  pointer-events: none;
  cursor: progress;
}

/* Links get a subtle dim while we wait for navigation. */
a.is-loading { opacity: 0.55; }

/* ---------- iOS-style activity indicator ---------- */
/* 12 evenly-rotated spokes with staggered opacity fade. Pure CSS. */
.ios-spinner {
  position: relative;
  width: 48px;
  height: 48px;
  display: inline-block;
}
.ios-spinner > div {
  position: absolute;
  top: 45%;
  left: 48%;
  width: 4%;
  height: 22%;
  background: #e2e8f0; /* slate-200 */
  border-radius: 2px;
  animation: ios-spin 1.1s linear infinite;
  transform-origin: center calc(50% + 22%); /* pivot from indicator center */
}
.ios-spinner > div:nth-child(1)  { transform: rotate(  0deg) translateY(-130%); animation-delay: -1.000s; }
.ios-spinner > div:nth-child(2)  { transform: rotate( 30deg) translateY(-130%); animation-delay: -0.916s; }
.ios-spinner > div:nth-child(3)  { transform: rotate( 60deg) translateY(-130%); animation-delay: -0.833s; }
.ios-spinner > div:nth-child(4)  { transform: rotate( 90deg) translateY(-130%); animation-delay: -0.750s; }
.ios-spinner > div:nth-child(5)  { transform: rotate(120deg) translateY(-130%); animation-delay: -0.666s; }
.ios-spinner > div:nth-child(6)  { transform: rotate(150deg) translateY(-130%); animation-delay: -0.583s; }
.ios-spinner > div:nth-child(7)  { transform: rotate(180deg) translateY(-130%); animation-delay: -0.500s; }
.ios-spinner > div:nth-child(8)  { transform: rotate(210deg) translateY(-130%); animation-delay: -0.416s; }
.ios-spinner > div:nth-child(9)  { transform: rotate(240deg) translateY(-130%); animation-delay: -0.333s; }
.ios-spinner > div:nth-child(10) { transform: rotate(270deg) translateY(-130%); animation-delay: -0.250s; }
.ios-spinner > div:nth-child(11) { transform: rotate(300deg) translateY(-130%); animation-delay: -0.166s; }
.ios-spinner > div:nth-child(12) { transform: rotate(330deg) translateY(-130%); animation-delay: -0.083s; }
@keyframes ios-spin {
  0%   { opacity: 1.00; }
  100% { opacity: 0.15; }
}

/* Overlay card (frosted) */
.hp-card {
  background: rgba(10, 22, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 25px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(159,232,112, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 180px;
}

/* ---------- Signal brand: ripple around H logo ---------- */
.signal-logo .signal-ring {
  position: absolute;
  inset: 0;
  border-radius: 0.5rem; /* matches rounded-lg on the inner tile */
  border: 2px solid rgba(159,232,112,0.55);
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
  animation: signal-ring 2.2s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}
.signal-logo .signal-ring--delay { animation-delay: 1.1s; }

@keyframes signal-ring {
  0%   { transform: scale(0.85); opacity: 0.85; }
  70%  { transform: scale(1.6);  opacity: 0.0; }
  100% { transform: scale(1.6);  opacity: 0.0; }
}

/* ---------- Signal cards ---------- */
.signal-card {
  background:
    linear-gradient(180deg, rgba(13,29,34,0.75), rgba(7,16,20,0.85));
}
.signal-card:hover { transform: translateY(-1px); }
.signal-card .signal-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 120%;
  height: 180%;
  background: radial-gradient(ellipse at top right, currentColor, transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  color: currentColor;
}
.signal-card:hover .signal-glow { opacity: 0.08; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(159,232,112,0.3); }

/* ==================================================================== */
/* LIGHT THEME                                                          */
/* ==================================================================== */

html[data-theme="light"] body {
    background: #f6f8f2;
    color: #0f172a;
}

html[data-theme="light"] .bg-gradient-radial {
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(159,232,112,0.22), transparent 60%),
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(125,217,79,0.14), transparent 60%),
        radial-gradient(ellipse 90% 60% at 100% 100%, rgba(198,243,163,0.25), transparent 60%),
        linear-gradient(180deg, #fafcf5 0%, #f0f4ea 100%);
}

/* Panels & cards ----------------------------------------------------- */
html[data-theme="light"] .panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 10px 30px -15px rgba(15,23,42,0.08);
}
html[data-theme="light"] .signal-card {
    background: #ffffff;
    border-color: #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
html[data-theme="light"] .hp-card {
    background: rgba(255,255,255,0.94);
    border-color: rgba(15,23,42,0.08);
    color: #0f172a;
}
html[data-theme="light"] #hpOverlay { background: rgba(246,248,242,0.65) !important; }
html[data-theme="light"] #hpOverlayMsg { color: #0f172a; }
html[data-theme="light"] .ios-spinner > div { background: #163300; }

/* Text overrides of Tailwind utility classes ------------------------- */
html[data-theme="light"] .text-white       { color: #0f172a !important; }
html[data-theme="light"] .text-slate-200   { color: #1e293b !important; }
html[data-theme="light"] .text-slate-300   { color: #334155 !important; }
html[data-theme="light"] .text-slate-400   { color: #475569 !important; }
html[data-theme="light"] .text-slate-500   { color: #64748b !important; }
html[data-theme="light"] .text-slate-600   { color: #64748b !important; }
html[data-theme="light"] .text-brand-300   { color: #274A0E !important; }
html[data-theme="light"] .text-brand-400   { color: #274A0E !important; }

/* Backgrounds that used white/N opacity on dark need dark/N on light */
html[data-theme="light"] .bg-white\/\[0\.02\] { background: rgba(15,23,42,0.025) !important; }
html[data-theme="light"] .bg-white\/\[0\.03\] { background: rgba(15,23,42,0.035) !important; }
html[data-theme="light"] .bg-white\/5         { background: rgba(15,23,42,0.04)  !important; }
html[data-theme="light"] .bg-white\/10        { background: rgba(15,23,42,0.06)  !important; }

/* Borders */
html[data-theme="light"] .border-white\/5  { border-color: rgba(15,23,42,0.06) !important; }
html[data-theme="light"] .border-white\/10 { border-color: rgba(15,23,42,0.08) !important; }
html[data-theme="light"] .border-white\/15 { border-color: rgba(15,23,42,0.10) !important; }

/* Chips / tabs / buttons --------------------------------------------- */
html[data-theme="light"] .btn-ghost {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #334155;
}
html[data-theme="light"] .btn-ghost:hover { background: #f1f5ec; }
html[data-theme="light"] .chip {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #475569;
}
html[data-theme="light"] .chip:hover { background: #f1f5ec; }
html[data-theme="light"] .chip-active {
    background: #9FE870 !important;
    color: #163300 !important;
    border-color: #7DD94F !important;
}

/* Section headers (they used brand variants) ------------------------- */
html[data-theme="light"] .section-header { color: #475569; }
html[data-theme="light"] .section-header--brand { color: #274A0E; }

/* Aging tiles — soften the dark tints ------------------------------ */
html[data-theme="light"] .aging-tile {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #0f172a;
}

/* KPI + pipe cards -------------------------------------------------- */
html[data-theme="light"] .kpi, html[data-theme="light"] .pipe-card {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
}
html[data-theme="light"] .kpi .tag, html[data-theme="light"] .pipe-card .tag {
    color: #274A0E;
    background: rgba(159,232,112,0.22);
}

/* Inputs on login page (light) -------------------------------------- */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="password"] {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    color: #0f172a !important;
}
html[data-theme="light"] input[type="text"]::placeholder,
html[data-theme="light"] input[type="password"]::placeholder { color: #94a3b8 !important; }

/* Scrollbar ---------------------------------------------------------- */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.15); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(91,141,56,0.5); }

/* Progress bar sliver looks better darker on light ------------------ */
html[data-theme="light"] #hpProgress > div {
    background: linear-gradient(to right, transparent, #5B8D38, transparent);
}
