/* =====================================================
   VRC POP Design System
   Core design tokens for the Live Activity page
   Based on the Live Activity Implementation Specification
   ===================================================== */

:root {
    /* ===== Base Colors ===== */
    --bg-primary:     #08080A;   /* Page background */
    --bg-surface:     #111114;   /* Card/panel backgrounds */
    --bg-elevated:    #1A1A1F;   /* Hover states, raised elements */
    --border-subtle:  #252528;   /* Dividers, card borders */
    --border-focus:   #404045;   /* Focus rings, active borders */
    
    /* ===== Text Colors ===== */
    --text-primary:   #FAFAFA;   /* Headings, important text */
    --text-secondary: #A0A0A8;   /* Body text, descriptions */
    --text-muted:     #787880;   /* Timestamps, tertiary info */
    
    /* ===== Brand Colors ===== */
    --brand-primary:  #8B5CF6;   /* Purple — primary accent */
    --brand-glow:     rgba(139, 92, 246, 0.3);  /* Glow effects */
    
    /* ===== Status Colors ===== */
    --status-hot:     #FF2D55;   /* 🔥 Hot/trending */
    --status-active:  #30D158;   /* 📈 Rising/active */
    --status-warning: #FF9F0A;   /* ❄️ Cooling off */
    --status-quiet:   #48484A;   /* 😎 Chill */
    
    /* ===== Heatmap Color Ramp ===== */
    --heat-0:   #1A1A1F;   /* Empty/no data */
    --heat-1:   #2D2B55;   /* Low activity */
    --heat-2:   #5B4B8A;   /* Medium-low */
    --heat-3:   #8B5CF6;   /* Medium (brand purple) */
    --heat-4:   #C77DFF;   /* Medium-high */
    --heat-5:   #F472B6;   /* High (pink) */
    --heat-6:   #FF2D92;   /* Peak (hot pink) */
    
    /* ===== Semantic Colors ===== */
    --success:        #30D158;
    --error:          #FF3B30;
    --warning:        #FF9F0A;
    --info:           #5E5CE6;
    
    /* ===== Font Families ===== */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* ===== Font Sizes ===== */
    --text-xs:    0.75rem;   /* 12px */
    --text-sm:    0.875rem;  /* 14px */
    --text-base:  1rem;      /* 16px */
    --text-lg:    1.125rem;  /* 18px */
    --text-xl:    1.25rem;   /* 20px */
    --text-2xl:   1.5rem;    /* 24px */
    --text-3xl:   1.875rem;  /* 30px */
    
    /* ===== Line Heights ===== */
    --leading-tight:  1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    /* ===== Spacing Scale ===== */
    --space-1:  0.25rem;  /* 4px */
    --space-2:  0.5rem;   /* 8px */
    --space-3:  0.75rem;  /* 12px */
    --space-4:  1rem;     /* 16px */
    --space-5:  1.25rem;  /* 20px */
    --space-6:  1.5rem;   /* 24px */
    --space-8:  2rem;     /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    
    /* ===== Border Radius ===== */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;
    
    /* ===== Shadows ===== */
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:   0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg:   0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-glow-hot: 0 0 20px rgba(255, 45, 85, 0.4);
    --shadow-glow-brand: 0 0 20px var(--brand-glow);
    
    /* ===== Transitions ===== */
    --transition-fast:   150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow:   350ms ease;
    
    /* ===== Z-Index Scale ===== */
    --z-base:     0;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-modal:    300;
    --z-tooltip:  400;
}

/* ===== Number Formatting for Stats ===== */
.stat-number {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ===== Utility Classes ===== */

/* Text utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-hot { color: var(--status-hot); }
.text-active { color: var(--status-active); }
.text-warning { color: var(--status-warning); }
.text-brand { color: var(--brand-primary); }

/* Background utilities */
.bg-primary { background-color: var(--bg-primary); }
.bg-surface { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }

/* Status indicator dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--space-2);
}

.status-dot--hot { background-color: var(--status-hot); }
.status-dot--active { background-color: var(--status-active); }
.status-dot--warning { background-color: var(--status-warning); }
.status-dot--quiet { background-color: var(--status-quiet); }

.status-dot--pulse {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ===== Card Component ===== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.card:hover {
    border-color: var(--border-focus);
    background: var(--bg-elevated);
}

.card--elevated {
    background: var(--bg-elevated);
}

/* ===== Group Logo Treatment ===== */
.group-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-subtle);
    background: var(--bg-surface);
    object-fit: cover;
    flex-shrink: 0;
}

.group-logo--sm {
    width: 24px;
    height: 24px;
}

.group-logo--lg {
    width: 48px;
    height: 48px;
}

/* Fallback for missing logos */
.group-logo--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--brand-primary), #6366F1);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge--hot {
    background: rgba(255, 45, 85, 0.15);
    color: var(--status-hot);
}

.status-badge--rising {
    background: rgba(48, 209, 88, 0.15);
    color: var(--status-active);
}

.status-badge--stable {
    background: rgba(72, 72, 74, 0.3);
    color: var(--text-secondary);
}

.status-badge--declining {
    background: rgba(255, 159, 10, 0.15);
    color: var(--status-warning);
}

.status-badge--quiet {
    background: rgba(72, 72, 74, 0.2);
    color: var(--text-muted);
}

.status-badge--crashed {
    background: rgba(255, 59, 48, 0.15);
    color: var(--error);
}

/* ===== Tooltip Base ===== */
.tooltip {
    position: absolute;
    z-index: var(--z-tooltip);
    background: var(--bg-elevated);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    max-width: 280px;
}

.tooltip--visible {
    opacity: 1;
}

/* ===== Animations ===== */

/* Pulse glow for hot bubbles (GPU-accelerated) */
@keyframes pulse-glow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px var(--status-hot));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 20px var(--status-hot));
        transform: scale(1.02);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide up animation */
@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.animate-fadeIn {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slideUp {
    animation: slideUp var(--transition-normal) ease-out;
}

.animate-scaleIn {
    animation: scaleIn var(--transition-normal) ease-out;
}

/* ===== Mode Toggle Component ===== */
.mode-toggle {
    display: inline-flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    gap: var(--space-1);
}

.mode-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-toggle__btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.mode-toggle__btn--active {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.mode-toggle__btn--active:hover {
    background: linear-gradient(135deg, #9D6FFF, #7577F3);
    color: white;
}

/* Live mode button has green glow when active */
.mode-toggle__btn--live.mode-toggle__btn--active {
    background: linear-gradient(135deg, #30D158, #22C55E);
    box-shadow: 0 0 20px rgba(48, 209, 88, 0.5);
    animation: glow-pulse-green 2s ease-in-out infinite;
}

@keyframes glow-pulse-green {
    0%, 100% { box-shadow: 0 0 15px rgba(48, 209, 88, 0.3); }
    50% { box-shadow: 0 0 25px rgba(48, 209, 88, 0.6); }
}

/* Live indicator for live mode button */
.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #FF3B30;
    border-radius: 50%;
    animation: live-flash 1s ease-in-out infinite;
}

@keyframes live-flash {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 4px rgba(255, 59, 48, 0.6);
    }
    50% { 
        opacity: 0.4; 
        transform: scale(0.85);
        box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
    }
}

/* Keep indicator red but brighter on active green button */
.mode-toggle__btn--active .live-indicator {
    background: #FF3B30;
    box-shadow: 0 0 6px rgba(255, 59, 48, 0.8);
}

/* ===== Scrollbar Styling ===== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--border-focus);
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state__description {
    font-size: var(--text-sm);
    max-width: 300px;
    margin-bottom: var(--space-4);
}

/* ===== Error State ===== */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: rgba(255, 59, 48, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: var(--radius-lg);
}

.error-state__icon {
    font-size: 2rem;
    color: var(--error);
    margin-bottom: var(--space-3);
}

.error-state__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.error-state__description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ===== Warning Banner ===== */
.warning-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 159, 10, 0.1);
    border: 1px solid rgba(255, 159, 10, 0.3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--status-warning);
    flex-shrink: 0;  /* Don't shrink when space is tight */
    margin-bottom: var(--space-3);
}

.warning-banner__icon {
    flex-shrink: 0;
}

/* ===== Button Base ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn--primary {
    background: var(--brand-primary);
    color: white;
}

.btn--primary:hover {
    background: #7C4AE8;
}

.btn--secondary {
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn--sm {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}
