/**
 * UAECalc Design Tokens & System Variables
 * Supports seamless Dark/Light theme switching & 0 CLS pre-reserved slots
 */

:root {
    /* Color Palette - Eye-Soothing Imperial Emerald & Warm Desert Amber Gold (UAE Royal Fintech) */
    --color-primary-rgb: 13, 148, 136;
    --color-primary-50: #f0fdfa;
    --color-primary-100: #ccfbf1;
    --color-primary-200: #99f6e4;
    --color-primary-300: #5eead4;
    --color-primary-400: #2dd4bf;
    --color-primary-500: #14b8a6;
    --color-primary-600: #0d9488; /* Luminous Eye-Soothing Teal-Emerald */
    --color-primary-700: #0f766e;
    --color-primary-800: #115e59;
    --color-primary-900: #134e4a;
    --color-primary-950: #042f2e;
    
    --color-gold-400: #fbbf24;
    --color-gold-500: #f59e0b; /* Warm Desert Amber Gold */
    --color-gold-600: #d97706;

    --color-accent: #f59e0b;
    --color-accent-hover: #d97706;

    /* Premium Gradients */
    --gradient-primary: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    --gradient-primary-hover: linear-gradient(135deg, #0f766e 0%, #047857 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-brand-text: linear-gradient(135deg, #0d9488 0%, #10b981 50%, #f59e0b 100%);
    --gradient-subtle-glow: radial-gradient(circle at 50% 0%, rgba(13, 148, 136, 0.08) 0%, transparent 70%);

    /* Light Theme (Eye-Soothing, Non-Glare, Pure Elegance) */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-subtle: #f0fdfa;
    --bg-surface-inset: #e6fcf5;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --border-color: #e2e8f0;
    --border-color-focus: #0d9488;
    --border-color-subtle: #f1f5f9;

    --card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
    --card-shadow-hover: 0 12px 24px -4px rgba(13, 148, 136, 0.16), 0 4px 8px -2px rgba(13, 148, 136, 0.08);
    --result-card-bg: linear-gradient(145deg, #042f2e 0%, #064e3b 50%, #0f766e 100%);
    --result-card-text: #ffffff;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.875rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;

    /* Max Widths */
    --container-max: 1200px;
    --article-max: 840px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides - Deep Midnight Slate & Luminous Emerald */
[data-theme="dark"] {
    --bg-page: #061118;
    --bg-surface: #0b1a24;
    --bg-surface-elevated: #112534;
    --bg-surface-subtle: #0f2331;
    --bg-surface-inset: #071520;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --border-color: #1e384b;
    --border-color-focus: #2dd4bf;
    --border-color-subtle: #132a3a;

    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 16px 32px -6px rgba(13, 148, 136, 0.3), 0 6px 14px -3px rgba(13, 148, 136, 0.18);
    --result-card-bg: linear-gradient(145deg, #021e1d 0%, #042f2e 50%, #064e3b 100%);
}

/* Pre-Reserved Fixed Ad Slots & Image Dimensions (Section 3 & Section 12 CLS = 0) */
.ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface-subtle);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin: var(--space-6) auto;
    position: relative;
    overflow: hidden;
    contain: layout paint;
}

.ad-slot::before {
    content: 'Advertisement';
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

/* Leaderboard Desktop (728x90) / Mobile banner (320x50) */
.ad-slot-leaderboard {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    aspect-ratio: 728 / 90;
}

@media (max-width: 768px) {
    .ad-slot-leaderboard {
        max-width: 320px;
        min-height: 50px;
        aspect-ratio: 320 / 50;
    }
}

/* Medium Rectangle (300x250) */
.ad-slot-rectangle {
    width: 300px;
    height: 250px;
    min-height: 250px;
    aspect-ratio: 300 / 250;
}

/* Large Rectangle (336x280) */
.ad-slot-large-rectangle {
    width: 336px;
    height: 280px;
    min-height: 280px;
    aspect-ratio: 336 / 280;
}

@media (max-width: 360px) {
    .ad-slot-large-rectangle {
        width: 300px;
        height: 250px;
        aspect-ratio: 300 / 250;
    }
}
