/* ═══════════════════════════════════════════════════════════
   THE SENTINEL INTERFACE — Global Design System
   Dark Glassmorphism + Neon Accent Theme
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────── */
:root {
    --surface: #0e1322;
    --surface-dim: #090e1c;
    --surface-container-low: #161b2b;
    --surface-container: #1a1f2f;
    --surface-container-high: #25293a;
    --surface-container-highest: #2f3445;
    --surface-bright: #343949;
    --on-surface: #dee1f7;
    --on-surface-variant: #b9cacb;
    --outline: #849495;
    --outline-variant: #3b494b;
    --primary: #dbfcff;
    --primary-container: #00f0ff;
    --on-primary: #00363a;
    --secondary: #d1bcff;
    --secondary-container: #7000ff;
    --on-secondary: #3c0090;
    --tertiary: #fff5de;
    --tertiary-fixed-dim: #eac324;
    --tertiary-container: #fed639;
    --error: #ffb4ab;
    --error-container: #93000a;
    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

:root[data-theme="light"] {
    --surface: #f8fafc;
    --surface-dim: #f1f5f9;
    --surface-container-low: #ffffff;
    --surface-container: #ffffff;
    --surface-container-high: #f8fafc;
    --surface-container-highest: #f1f5f9;
    --surface-bright: #ffffff;
    --on-surface: #020617; /* Very dark text for high contrast */
    --on-surface-variant: #334155;
    --outline: #94a3b8;
    --outline-variant: #cbd5e1;
    --primary: #0284c7; /* Rich Ocean Blue */
    --primary-container: #0369a1;
    --on-primary: #ffffff;
    --secondary: #7c3aed; /* Deep purple */
    --secondary-container: #6d28d9;
    --on-secondary: #ffffff;
    --tertiary: #d97706; /* Strong amber */
    --tertiary-fixed-dim: #b45309;
    --tertiary-container: #f59e0b;
    --error: #dc2626;
    --error-container: #991b1b;
}

/* ── Base Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Light Theme Prismatic Background Overlay */
body::before {
    content: '';
    position: fixed;
    inset: -20%;
    z-index: -1;
    background: radial-gradient(circle at 20% 30%, rgba(2, 132, 199, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 50% 10%, rgba(217, 119, 6, 0.08) 0%, transparent 40%);
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    animation: slow-drift 30s linear infinite alternate;
}

@keyframes slow-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

[data-theme="light"] body {
    background: var(--surface);
}

[data-theme="light"] body::before {
    opacity: 1;
}

::selection {
    background: var(--primary-container);
    color: var(--on-primary);
}

a { color: var(--primary-container); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Glass Card ─────────────────────────────────────────── */
.glass-card {
    background: rgba(26, 31, 47, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(59, 73, 75, 0.15);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.06);
}

.glass-card-elevated {
    background: rgba(37, 41, 58, 0.8);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(59, 73, 75, 0.2);
    border-radius: 16px;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .glass-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 48px rgba(2, 132, 199, 0.12);
}
[data-theme="light"] .glass-card-elevated {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.06);
}

/* Light Theme Component Overrides */
[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.7) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.02);
}
[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.6) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.3) !important;
}
[data-theme="light"] .sidebar-link:hover {
    background: rgba(2, 132, 199, 0.08) !important;
}
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.2);
    color: #ffffff !important;
}
[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35);
}
[data-theme="light"] .btn-primary::before {
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.3));
}
[data-theme="light"] .btn-secondary {
    border-color: var(--primary);
    color: var(--primary);
}
[data-theme="light"] .btn-secondary:hover {
    background: rgba(2, 132, 199, 0.08);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.15);
}
[data-theme="light"] .hero-badge {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.2);
    color: var(--primary);
}
[data-theme="light"] .system-status {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
}
[data-theme="light"] .orbit-ring {
    border: 1px solid rgba(2, 132, 199, 0.1);
}

/* Light Theme Overrides for live.html / inline styles */
[data-theme="light"] .emotion-badge {
    background: rgba(255, 255, 255, 0.8) !important;
}
[data-theme="light"] .emotion-badge-label {
    color: var(--primary) !important;
}
[data-theme="light"] .controls-bar {
    background: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .control-btn.active {
    background: rgba(2, 132, 199, 0.15) !important;
}
[data-theme="light"] #text-sentiment-history,
[data-theme="light"] #big-audio-viz {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ── Gradient Text ──────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-container));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-tertiary {
    background: linear-gradient(135deg, var(--tertiary), var(--tertiary-fixed-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: var(--on-primary);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2));
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.3);
    filter: brightness(1.15);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: var(--primary);
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-secondary:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--primary-container);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.1);
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    border-right: 1px solid rgba(59, 73, 75, 0.15);
    background: var(--surface);
    z-index: 40;
    box-shadow: 16px 0 32px -12px rgba(0, 219, 233, 0.03);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-headline);
    color: var(--primary);
    margin-bottom: 48px;
    letter-spacing: -0.05em;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    color: #64748b;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
}

.sidebar-link:hover {
    color: var(--primary);
    background: rgba(37, 41, 58, 0.5);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--primary-container);
}

.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary-container);
    border-radius: 4px;
}

.sidebar-link span.label {
    font-family: var(--font-body);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

/* ── Top Header ─────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; right: 0;
    width: calc(100% - 80px);
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid rgba(59, 73, 75, 0.15);
    background: rgba(14, 19, 34, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 50;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: var(--font-headline);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    background: var(--surface-container-low);
    border-radius: 999px;
    margin-left: 16px;
}

.status-dot {
    width: 8px; height: 8px;
    background: var(--primary-container);
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
}

.status-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--primary);
}

/* ── Main Content Area ──────────────────────────────────── */
.main-content {
    margin-left: 80px;
    padding-top: 64px;
    min-height: 100vh;
}

/* ── Feature Card (3D Hover) ────────────────────────────── */
.feature-card {
    perspective: 1000px;
    cursor: pointer;
}

.feature-card-inner {
    position: relative;
    padding: 32px;
    border-radius: 20px;
    background: rgba(26, 31, 47, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(59, 73, 75, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    overflow: hidden;
}

.feature-card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 240, 255, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.feature-card:hover .feature-card-inner::before { opacity: 1; }

.feature-card:hover .feature-card-inner {
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 240, 255, 0.08),
                0 0 0 1px rgba(0, 240, 255, 0.1);
    transform: translateY(-4px);
}

.feature-card.secondary:hover .feature-card-inner {
    border-color: rgba(209, 188, 255, 0.25);
    box-shadow: 0 20px 60px rgba(112, 0, 255, 0.08);
}

.feature-card.tertiary:hover .feature-card-inner {
    border-color: rgba(234, 195, 36, 0.25);
    box-shadow: 0 20px 60px rgba(234, 195, 36, 0.08);
}

.feature-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 28px;
}

.feature-icon.primary { background: rgba(0, 240, 255, 0.1); color: var(--primary-container); }
.feature-icon.secondary { background: rgba(112, 0, 255, 0.1); color: var(--secondary); }
.feature-icon.tertiary { background: rgba(234, 195, 36, 0.1); color: var(--tertiary-fixed-dim); }
.feature-icon.error { background: rgba(255, 180, 171, 0.1); color: var(--error); }

.feature-title {
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.813rem;
    color: var(--on-surface-variant);
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feature-tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary-container);
}

.feature-tag.secondary { background: rgba(112, 0, 255, 0.08); color: var(--secondary); }
.feature-tag.tertiary { background: rgba(234, 195, 36, 0.08); color: var(--tertiary-fixed-dim); }

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    padding: 20px;
    border-radius: 16px;
    background: var(--surface-container-low);
    border: 1px solid rgba(59, 73, 75, 0.1);
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--outline);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-headline);
    font-size: 1.75rem;
    font-weight: 700;
}

/* ── Mesh Overlay ───────────────────────────────────────── */
.mesh-overlay {
    background-image: radial-gradient(circle, rgba(0, 240, 255, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* ── Frequency Bars ─────────────────────────────────────── */
.freq-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: height 0.15s ease-out;
    min-width: 4px;
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-track {
    height: 8px;
    width: 100%;
    background: var(--surface-container-highest);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Data Stream / Log ──────────────────────────────────── */
.data-stream {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 10px;
    line-height: 1.8;
    color: #64748b;
}

.data-stream .tag-face { color: var(--primary-container); }
.data-stream .tag-speech { color: var(--secondary); }
.data-stream .tag-text { color: var(--tertiary-fixed-dim); }

/* ── Upload Zone ────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed rgba(59, 73, 75, 0.3);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-container);
    background: rgba(0, 240, 255, 0.04);
}

.upload-zone .material-symbols-outlined {
    font-size: 48px;
    color: var(--outline);
    margin-bottom: 16px;
}

/* ── Charts ─────────────────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 4px var(--primary-container);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 12px var(--primary-container);
    }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes border-glow {
    0%, 100% { border-color: rgba(0, 240, 255, 0.1); }
    50% { border-color: rgba(0, 240, 255, 0.35); }
}

@keyframes scan-line {
    0% { top: -2px; }
    100% { top: 100%; }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes waveform {
    0%, 100% { height: 20%; }
    25% { height: 60%; }
    50% { height: 90%; }
    75% { height: 40%; }
}

.animate-fade-in { animation: fade-in 0.6s ease-out forwards; }
.animate-slide-right { animation: slide-in-right 0.6s ease-out forwards; }
.animate-slide-left { animation: slide-in-left 0.6s ease-out forwards; }
.animate-scale-in { animation: scale-in 0.5s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Staggered animations for children */
.stagger-children > * { opacity: 0; animation: fade-in 0.5s ease-out forwards; }
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ── Particle Background ───────────────────────────────── */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(59, 73, 75, 0.4);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(59, 73, 75, 0.6); }

/* ── Input ──────────────────────────────────────────────── */
.sentinel-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-container-low);
    border: 1px solid rgba(59, 73, 75, 0.2);
    border-radius: 12px;
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all 0.3s;
    outline: none;
}

.sentinel-input:focus {
    border-color: var(--primary-container);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.sentinel-input::placeholder { color: var(--outline); }

textarea.sentinel-input {
    min-height: 100px;
    resize: vertical;
}

/* ── Material Icons ─────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Tooltip ────────────────────────────────────────────── */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--surface-container-highest);
    color: var(--on-surface);
    font-size: 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after { opacity: 1; }

/* ── Grid Helpers ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .main-content { margin-left: 60px; }
    .topbar { width: calc(100% - 60px); }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Loading Skeleton ───────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--surface-container-low) 25%, var(--surface-container) 50%, var(--surface-container-low) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Emotion Chip ───────────────────────────────────────── */
.emotion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-headline);
}

.emotion-chip.happy { background: rgba(0, 240, 255, 0.1); color: var(--primary-container); }
.emotion-chip.sad { background: rgba(112, 0, 255, 0.1); color: var(--secondary); }
.emotion-chip.angry { background: rgba(255, 180, 171, 0.1); color: var(--error); }
.emotion-chip.neutral { background: rgba(132, 148, 149, 0.1); color: var(--outline); }
.emotion-chip.fear { background: rgba(234, 195, 36, 0.1); color: var(--tertiary-fixed-dim); }
.emotion-chip.surprise { background: rgba(209, 188, 255, 0.1); color: var(--secondary); }
.emotion-chip.disgust { background: rgba(147, 0, 10, 0.1); color: var(--error); }

/* ── Engagement Ring ────────────────────────────────────── */
.engagement-ring {
    width: 120px; height: 120px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.engagement-ring svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.engagement-ring .ring-track {
    fill: none;
    stroke: var(--surface-container-highest);
    stroke-width: 6;
}

.engagement-ring .ring-fill {
    fill: none;
    stroke: var(--primary-container);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.engagement-ring .ring-value {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    z-index: 1;
}

/* ── 3D Card Tilt Effect ────────────────────────────────── */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

/* ── Neon Glow Effects ──────────────────────────────────── */
.neon-cyan {
    text-shadow: 0 0 7px var(--primary-container),
                 0 0 10px var(--primary-container),
                 0 0 21px var(--primary-container);
}

.neon-border-cyan {
    box-shadow: 0 0 7px rgba(0, 240, 255, 0.3),
                inset 0 0 7px rgba(0, 240, 255, 0.1);
}

/* ── Live indicator ─────────────────────────────────────── */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 59, 48, 0.15);
    border-radius: 999px;
    color: #ff3b30;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.live-indicator .dot {
    width: 6px; height: 6px;
    background: #ff3b30;
    border-radius: 50%;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ── Celestial Theme Toggle ────────────────────────────── */
.theme-toggle {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 16px auto;
}

/* Background gradient that shifts */
.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1f2f, #0e1322);
    box-shadow: inset 0 2px 4px rgba(0, 240, 255, 0.1), 0 0 16px rgba(0, 240, 255, 0.2);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 0;
}

[data-theme="light"] .theme-toggle::before {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 0 24px rgba(245, 158, 11, 0.4);
}

/* The celestial body (Moon/Sun) */
.celestial-body {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dee1f7;
    z-index: 1;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: inset -4px -2px 8px rgba(0,0,0,0.4);
}

/* Moon Crater */
.celestial-body::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    top: 6px;
    right: 4px;
    box-shadow: -4px 6px 0 -1px rgba(0,0,0,0.1), -2px 10px 0 -2px rgba(0,0,0,0.15);
    transition: opacity 0.3s;
}

/* Moon crescent shadow */
.moon-shadow {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0e1322;
    top: -4px;
    right: -8px;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Light Mode Transformations */
[data-theme="light"] .celestial-body {
    background: #ffffff;
    box-shadow: 0 0 12px #ffffff;
    transform: scale(1.1);
}
[data-theme="light"] .celestial-body::after {
    opacity: 0; /* hide craters */
}
[data-theme="light"] .moon-shadow {
    transform: translate(30px, -30px); /* Move shadow completely off */
    opacity: 0;
}

/* Sun Rays */
.sun-rays {
    position: absolute;
    inset: -6px;
    z-index: 0;
    opacity: 0;
    transition: all 0.6s;
    transform: scale(0.5) rotate(0deg);
}

.sun-ray {
    position: absolute;
    background: #fbbf24;
    border-radius: 4px;
}
.sun-ray:nth-child(1) { width: 4px; height: 10px; top: 0; left: 50%; transform: translateX(-50%); }
.sun-ray:nth-child(2) { width: 4px; height: 10px; bottom: 0; left: 50%; transform: translateX(-50%); }
.sun-ray:nth-child(3) { width: 10px; height: 4px; top: 50%; left: 0; transform: translateY(-50%); }
.sun-ray:nth-child(4) { width: 10px; height: 4px; top: 50%; right: 0; transform: translateY(-50%); }

[data-theme="light"] .sun-rays {
    opacity: 1;
    transform: scale(1) rotate(45deg);
    animation: rotateRays 10s linear infinite;
}

@keyframes rotateRays {
    0% { transform: scale(1) rotate(45deg); }
    100% { transform: scale(1) rotate(405deg); }
}

.theme-toggle:hover {
    transform: scale(1.1);
}
