/**
 * ============================================================================
 * SHELF — CENTRALIZED THEME & DESIGN TOKENS (theme.css)
 * All colors, typography, shadows, radii, and dark-mode overrides are defined
 * here as CSS Custom Properties and referenced across CSS & Tailwind config.
 * ============================================================================
 */

:root {
    /* Typography */
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-fa: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    --font-sans: 'Inter', 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Page & App Shell Backgrounds */
    --bg-body-gradient: linear-gradient(135deg, #D8CCF8 0%, #E8DFF8 50%, #F5E6E8 100%);
    --color-app-bg: #FCF9F7;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #FFFFFF;
    --color-surface-muted: #F4F4F6;
    --color-surface-segment: rgba(229, 231, 235, 0.65);

    /* Text Colors */
    --color-text-primary: #2D3142;
    --color-text-secondary: #5C6070;
    --color-text-muted: #8E92A4;
    --color-text-inverse: #FFFFFF;

    /* Borders & Dividers */
    --color-border-subtle: #F2EFE9;
    --color-border-default: #E5E7EB;

    /* Brand Accent: Pink / Rose (Vibrant & pure, avoiding brown tones in dark mode) */
    --color-brand-pink-light: #FCE7F3;
    --color-brand-pink-btn: #FBCFE8;
    --color-brand-pink: #F472B6;
    --color-brand-pink-dark: #DB2777;

    /* Brand Accent: Soft Periwinkle Blue (Matches "Create own cards" card) */
    --color-brand-softblue-light: #DCE4FA;
    --color-brand-softblue-btn: #D8E2FA;
    --color-brand-softblue: #96B1F7;
    --color-brand-softblue-dark: #7B9CF0;

    /* Brand Accent: Purple */
    --color-brand-purple-light: #EEF0FF;
    --color-brand-purple: #9D8DF1;
    --color-brand-purple-dark: #7B68EE;

    /* Brand Accent: Blue */
    --color-brand-blue-light: #EBF0FF;
    --color-brand-blue: #4A62FF;

    /* Brand Accent: Green */
    --color-brand-green-light: #E6F9F3;
    --color-brand-green: #3CD09A;

    /* Brand Accent: Yellow / Amber */
    --color-brand-yellow-light: #FFF8E6;
    --color-brand-yellow: #FFD166;
    --color-brand-yellow-dark: #D97706;

    /* Navigation & Floating Controls (Matches warm pastel nav bar in design) */
    --color-nav-bg: #F5E1DA;
    --color-nav-border: rgba(255, 255, 255, 0.6);
    --color-fab-bg: #F69B95;
    --color-toast-bg: #2D3142;
    --color-toast-text: #FFFFFF;

    /* Shadows */
    --shadow-app: 0 0 60px rgba(45, 49, 66, 0.08);
    --shadow-card: 0 12px 32px -8px rgba(45, 49, 66, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-nav: 0 10px 28px rgba(246, 155, 149, 0.22);
    --shadow-fab: 0 6px 18px rgba(246, 155, 149, 0.45);
    --shadow-toast: 0 10px 25px rgba(0, 0, 0, 0.14);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 1.75rem;
    --radius-nav: 2.25rem;
    --radius-full: 9999px;

    /* Layout & Transitions */
    --app-max-width: 440px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;

    /* Focus ring (shared by inputs, buttons, segment items) */
    --focus-ring: 0 0 0 4px rgba(235, 133, 133, 0.18);
    --focus-ring-blue: 0 0 0 4px rgba(123, 156, 240, 0.2);
}

/* ============================================================================
 * LOCALE TYPOGRAPHY: English (Inter) vs Persian (Vazirmatn + RTL-aware spacing)
 * ============================================================================ */
html.lang-en {
    --font-sans: var(--font-en);
}

html.lang-en body {
    font-family: var(--font-en);
}

html.lang-fa {
    --font-sans: var(--font-fa);
}

html.lang-fa body {
    font-family: var(--font-fa);
    letter-spacing: 0;
}

/* ============================================================================
 * DARK THEME OVERRIDES (.dark)
 * ============================================================================ */
html.dark {
    --bg-body-gradient: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #18181B 100%);
    --color-app-bg: #09090B;
    --color-surface: #18181B;
    --color-surface-elevated: #27272A;
    --color-surface-muted: #27272A;
    --color-surface-segment: #27272A;

    --color-text-primary: #F8FAFC;
    --color-text-secondary: #A1A1AA;
    --color-text-muted: #71717A;
    --color-text-inverse: #09090B;

    --color-border-subtle: #27272A;
    --color-border-default: #3F3F46;

    /* Adjusted Brand Tints for Dark Mode Readability (Crisp rose/pink, zero muddy brown) */
    --color-brand-pink-light: rgba(244, 114, 182, 0.16);
    --color-brand-pink-btn: rgba(244, 114, 182, 0.25);
    --color-brand-pink: #F472B6;
    --color-brand-pink-dark: #FDA4AF;
    --color-fab-bg: #EC4899;
    --focus-ring: 0 0 0 4px rgba(244, 114, 182, 0.25);
    --color-brand-softblue-light: rgba(150, 177, 247, 0.18);
    --color-brand-softblue-btn: rgba(150, 177, 247, 0.25);
    --color-brand-purple-light: rgba(157, 141, 241, 0.18);
    --color-brand-blue-light: rgba(74, 98, 255, 0.2);
    --color-brand-green-light: rgba(60, 208, 154, 0.18);
    --color-brand-yellow-light: rgba(255, 209, 102, 0.18);
    --color-brand-yellow-dark: #FCD34D;

    --color-nav-bg: #18181B;
    --color-nav-border: #27272A;
    --color-toast-bg: #F8FAFC;
    --color-toast-text: #09090B;

    --shadow-nav: 0 12px 30px rgba(0, 0, 0, 0.6);
}
