/* ============================================
   INFINITY OS - CORE THEME
   Dark Neon Glassmorphic Design System
   ============================================ */

:root {
    /* ============================================
       CANONICAL THEME VARIABLES
       These are overridden by html[data-theme="..."]
       ============================================ */
    
    /* Default Theme (Cyber Mint) */
    --theme-accent: #00f5d4;
    --theme-accent-2: #00bbf0;
    --theme-surface-1: #0a0a0f;
    --theme-surface-2: #12121a;
    --theme-surface-3: #1a1a26;
    --theme-border: rgba(0, 245, 212, 0.2);
    --theme-border-strong: rgba(0, 245, 212, 0.5);
    --theme-glow: 0 0 12px rgba(0, 245, 212, 0.3);
    --theme-glow-strong: 0 0 20px rgba(0, 245, 212, 0.5);
    
    /* ============================================
       SEMANTIC ALIASES (Use these in UI)
       ============================================ */
    
    /* Backgrounds */
    --bg: var(--theme-surface-1);
    --panel: var(--theme-surface-2);
    --surface: var(--theme-surface-3);
    
    /* Text Colors */
    --text: rgba(255, 255, 255, 0.95);
    --muted: rgba(255, 255, 255, 0.65);
    --subtle: rgba(255, 255, 255, 0.45);
    
    /* Accent Colors */
    --accent: var(--theme-accent);
    --accent2: var(--theme-accent-2);
    
    /* Borders */
    --border: var(--theme-border);
    --border-strong: var(--theme-border-strong);
    
    /* Effects */
    --glow: var(--theme-glow);
    --glow-strong: var(--theme-glow-strong);
    
    /* ============================================
       LEGACY VARIABLES (Deprecated, use above)
       ============================================ */
    
    /* Deep Black Background */
    --bg-primary: var(--bg);
    --bg-secondary: var(--panel);
    --bg-tertiary: var(--surface);
    
    /* Glassmorphic Surfaces */
    --glass-bg: rgba(20, 20, 30, 0.5);
    --glass-bg-hover: rgba(20, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Neon Accent Colors */
    --neon-cyan: var(--accent);
    --neon-magenta: #ff00aa;
    --neon-green: #00ff88;
    --neon-purple: var(--accent2);
    --neon-orange: #ff6600;
    
    /* Soft Internal Glow */
    --glow-cyan: var(--glow);
    --glow-magenta: 0 0 12px rgba(255, 0, 170, 0.3),
                    0 0 24px rgba(255, 0, 170, 0.15),
                    inset 0 0 12px rgba(255, 0, 170, 0.08);
    --glow-green: 0 0 12px rgba(0, 255, 136, 0.3),
                  0 0 24px rgba(0, 255, 136, 0.15),
                  inset 0 0 12px rgba(0, 255, 136, 0.08);
    
    /* Text Colors */
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --text-tertiary: var(--subtle);
    --text-accent: var(--accent);
    
    /* Blur Effects */
    --blur-sm: 8px;
    --blur-md: 16px;
    --blur-lg: 24px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Gradient Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 0, 170, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--neon-magenta);
}

/* Numeric Emphasis */
.metric-value,
.numeric,
[data-numeric] {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ============================================
   GLASSMORPHIC SURFACES
   ============================================ */

.glass-surface {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.glass-surface-hover {
    transition: background var(--transition-base);
}

.glass-surface-hover:hover {
    background: var(--glass-bg-hover);
}

/* ============================================
   NEON GLOW UTILITIES
   ============================================ */

.glow-cyan {
    box-shadow: var(--glow-cyan);
}

.glow-magenta {
    box-shadow: var(--glow-magenta);
}

.glow-green {
    box-shadow: var(--glow-green);
}

.text-glow-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5),
                 0 0 16px rgba(0, 240, 255, 0.25);
}

.text-glow-magenta {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px rgba(255, 0, 170, 0.5),
                 0 0 16px rgba(255, 0, 170, 0.25);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-bg-hover);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash-messages-container {
    position: relative;
    margin-bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    animation: flashSlideIn 0.3s ease-out;
}

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

.flash-message {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-md));
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: all var(--transition-base);
}

.flash-message:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.flash-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.flash-icon svg {
    width: 20px;
    height: 20px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flash-content {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

/* Success Flash (Green) */
.flash-success {
    border-left: 3px solid var(--neon-green);
    background: linear-gradient(
        to right,
        rgba(0, 255, 136, 0.08),
        var(--glass-bg)
    );
}

.flash-success .flash-icon {
    color: var(--neon-green);
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.5));
}

/* Error Flash (Orange/Red) */
.flash-error {
    border-left: 3px solid var(--neon-orange);
    background: linear-gradient(
        to right,
        rgba(255, 102, 0, 0.08),
        var(--glass-bg)
    );
}

.flash-error .flash-icon {
    color: var(--neon-orange);
    filter: drop-shadow(0 0 4px rgba(255, 102, 0, 0.5));
}

/* Warning Flash (Magenta) */
.flash-warning {
    border-left: 3px solid var(--neon-magenta);
    background: linear-gradient(
        to right,
        rgba(255, 0, 170, 0.08),
        var(--glass-bg)
    );
}

.flash-warning .flash-icon {
    color: var(--neon-magenta);
    filter: drop-shadow(0 0 4px rgba(255, 0, 170, 0.5));
}

/* Info Flash (Cyan) */
.flash-info {
    border-left: 3px solid var(--neon-cyan);
    background: linear-gradient(
        to right,
        rgba(0, 240, 255, 0.08),
        var(--glass-bg)
    );
}

.flash-info .flash-icon {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.5));
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .flash-message {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .flash-messages-container {
        margin-bottom: var(--space-lg);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden { display: none; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.text-center { text-align: center; }
.text-right { text-align: right; }
/* ============================================
   PHASE 3: MULTI-THEME SUPPORT
   ============================================ */

/* Cyber Mint Theme (Default) */
html[data-theme="cyber-mint"] {
    --theme-accent: #00f5d4;
    --theme-accent-2: #00bbf0;
    --theme-surface-1: #0a0a0f;
    --theme-surface-2: #12121a;
    --theme-surface-3: #1a1a26;
    --theme-border: rgba(0, 245, 212, 0.2);
    --theme-border-strong: rgba(0, 245, 212, 0.5);
    --theme-glow: 0 0 12px rgba(0, 245, 212, 0.3);
    --theme-glow-strong: 0 0 20px rgba(0, 245, 212, 0.5);
}

/* Synthwave Theme */
html[data-theme="synthwave"] {
    --theme-accent: #ff006e;
    --theme-accent-2: #8338ec;
    --theme-surface-1: #1a0a1f;
    --theme-surface-2: #2a1a3a;
    --theme-surface-3: #3a2a4a;
    --theme-border: rgba(255, 0, 110, 0.2);
    --theme-border-strong: rgba(255, 0, 110, 0.5);
    --theme-glow: 0 0 12px rgba(255, 0, 110, 0.3);
    --theme-glow-strong: 0 0 20px rgba(255, 0, 110, 0.5);
}

/* Inferno Theme */
html[data-theme="inferno"] {
    --theme-accent: #ff6b35;
    --theme-accent-2: #f72585;
    --theme-surface-1: #1a0a00;
    --theme-surface-2: #2a1a10;
    --theme-surface-3: #3a2a20;
    --theme-border: rgba(255, 107, 53, 0.2);
    --theme-border-strong: rgba(255, 107, 53, 0.5);
    --theme-glow: 0 0 12px rgba(255, 107, 53, 0.3);
    --theme-glow-strong: 0 0 20px rgba(255, 107, 53, 0.5);
}

/* Stealth Theme */
html[data-theme="stealth"] {
    --theme-accent: #0ea5e9;
    --theme-accent-2: #06b6d4;
    --theme-surface-1: #1a1a2e;
    --theme-surface-2: #16213e;
    --theme-surface-3: #0f3460;
    --theme-border: rgba(14, 165, 233, 0.2);
    --theme-border-strong: rgba(14, 165, 233, 0.5);
    --theme-glow: 0 0 12px rgba(14, 165, 233, 0.3);
    --theme-glow-strong: 0 0 20px rgba(14, 165, 233, 0.5);
}