:root {
    --primary: #6d28d9;
    --primary-light: #8b5cf6;
    --primary-glow: rgba(109, 40, 217, 0.2);
    --secondary: #4c1d95;
    --bg-light: #f5f3ff;
    --bg-white: #ffffff;
    --text-dark: #1e1b4b;
    --text-muted: #6b7280;
    --border-color: #ddd6fe;
    --ai-purple: #a855f7;
    --ai-glow: 0 0 15px rgba(168, 85, 247, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

[data-theme="dark"] {
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --text-dark: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-light: #7c3aed;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s, color-0.3s;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Classes */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.7);
}

/* AI Elements */
.ai-suggestion-box {
    border: 2px solid var(--ai-purple);
    box-shadow: var(--ai-glow);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(109, 40, 217, 0.05) 100%);
}

.ai-suggestion-box::before {
    content: "✨ Suggestion IA";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--ai-purple);
    text-transform: uppercase;
}

.purple-glow {
    text-shadow: 0 0 10px var(--primary-glow);
}

/* ══════════════════════════════════════
   🌐 NETWORK STATUS SYSTEM (GLOBAL)
   ══════════════════════════════════════ */
.network-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 9999; /* Always on top */
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.network-status-bar.offline {
    background: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

#network-status-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 9998;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.5s ease-out;
}

#network-status-indicator.offline {
    display: flex;
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ══════════════════════════════════════
   🚀 PERFORMANCE OPTIMIZATIONS (GLOBAL)
   ══════════════════════════════════════ */

/* Hardware Acceleration for continuous animations */
.gpu-accelerated,
.prof-glow-orb, .dash-orb, .ambient-orb, .ai-suggestion-box::before,
[class*="orb-"], [class*="orb_"], [class*="Float"] {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Limit heavy blur filters on mobile to save battery and GPU */
@media (max-width: 768px) {
    .glass-card, [class*="glass"], [style*="backdrop-filter"] {
        /* Cap blur at 12px on mobile */
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }
}

/* Respect user's system preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Runtime Battery/Performance Saver Mode */
body.perf-optimized * {
    /* Disable all heavy blurs if device is struggling */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.perf-optimized .glass-card, 
body.perf-optimized [class*="glass"] {
    /* Fallback solid background */
    background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] body.perf-optimized .glass-card, 
[data-theme="dark"] body.perf-optimized [class*="glass"] {
    background: rgba(30, 41, 59, 0.95) !important;
}
