/*
 * Croplod Design Tokens — رسمی و جدی
 * Monochrome gray system + ONE formal blue accent (#2563eb)
 * Restrained surfaces, sharp corners, subtle shadows
 */
:root {
    /* Brand Colors — تک‌رنگ: خاکستری خنثی + آبی رسمی به‌عنوان تنها رنگ تأکیدی */
    --color-primary-50: #eff5ff;
    --color-primary-100: #dbe8fe;
    --color-primary-200: #bfd7fe;
    --color-primary-300: #93bbfd;
    --color-primary-400: #6096fa;
    --color-primary-500: #3b71f7;
    --color-primary-600: #2563eb;
    --color-primary-700: #1d4ed8;
    --color-primary-800: #1e40af;
    --color-primary-900: #1e3a8a;

    /* Secondary = خاکستری خنثی (جایگزین فیروزه‌ای) */
    --color-secondary-50: #f9fafb;
    --color-secondary-100: #f3f4f6;
    --color-secondary-200: #e5e7eb;
    --color-secondary-300: #d1d5db;
    --color-secondary-400: #9ca3af;
    --color-secondary-500: #6b7280;
    --color-secondary-600: #4b5563;
    --color-secondary-700: #374151;
    --color-secondary-800: #1f2937;
    --color-secondary-900: #111827;

    /* Semantic — کاربردی، با اشباع کم‌تر و جدی‌تر */
    --color-success-50: #f0fdf4;
    --color-success-500: #16a34a;
    --color-success-600: #15803d;

    --color-error-50: #fef2f2;
    --color-error-500: #dc2626;
    --color-danger-500: var(--color-error-500);
    --color-error-600: #b91c1c;

    --color-warning-50: #fffbeb;
    --color-warning-500: #d97706;
    --color-warning-600: #b45309;

    /* Sidebar — مونوکروم؛ فقط آیتم فعال رنگ تأکیدی می‌گیرد */
    --sidebar-color-home: var(--text-secondary);
    --sidebar-color-account: var(--text-secondary);
    --sidebar-color-security: var(--text-secondary);
    --sidebar-color-sessions: var(--text-secondary);
    --sidebar-color-notifications: var(--text-secondary);
    --sidebar-color-wallet: var(--text-secondary);
    --sidebar-color-premium: var(--text-secondary);
    --sidebar-color-settings: var(--text-secondary);
    --sidebar-color-support: var(--text-secondary);
    --sidebar-color-about: var(--text-secondary);

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border radius — رسمی: گوشه‌های کم‌گرد */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.625rem;
    --radius-2xl: 0.75rem;
    --radius-full: 9999px;

    /* Shadows — ظریف و خنثی */
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --shadow-md: 0 1px 2px 0 rgb(15 23 42 / 0.05), 0 2px 6px -1px rgb(15 23 42 / 0.06);
    --shadow-lg: 0 4px 8px -2px rgb(15 23 42 / 0.06), 0 8px 20px -4px rgb(15 23 42 / 0.08);
    --shadow-xl: 0 8px 16px -4px rgb(15 23 42 / 0.08), 0 16px 40px -8px rgb(15 23 42 / 0.12);

    /* Typography - Smart Font System */
    --font-family: 'Dana', 'Tahoma', sans-serif;
    --font-family-brand: 'Product Sans', 'Dana', sans-serif;
    --font-family-mono: 'Product Sans', monospace;

    /* Font sizes - Fluid scale */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Font weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Letter spacing — رسمی‌تر */
    --letter-spacing-tight: -0.015em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.03em;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-index scale */
    --z-below: -1;
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar-overlay: 400;
    --z-sidebar: 500;
    --z-modal-backdrop: 450;
    --z-modal: 500;
    --z-toast: 600;
    --z-notification: 700;
    --z-confirm-overlay: 800;

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 280px;

    /* Touch target minimum */
    --touch-target: 44px;
}

/*
 * Light Theme (default)
 * سطوح سفید/خاکستری سرد، متن سرمه‌ای
 */
[data-theme="light"], :root {
    /* Surface elevation system */
    --bg-primary: #ffffff;
    --bg-app: var(--bg-primary);
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-input: #f8fafc;
    --bg-hover: rgba(15, 23, 42, 0.04);
    --bg-pressed: rgba(15, 23, 42, 0.08);
    --bg-active: rgba(15, 23, 42, 0.04);
    --bg-sidebar: #ffffff;

    /* Text hierarchy */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-muted: var(--text-tertiary);
    --text-disabled: #cbd5e1;
    --text-inverse: #ffffff;

    /* Border system — خنثی و ظریف */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-focus: var(--color-primary-600);
    --container-lg: 1200px;
    --border-subtle: rgba(15, 23, 42, 0.05);
    --border-strong: #94a3b8;

    /* Overlay */
    --overlay: rgba(15, 23, 42, 0.4);

    /* Sidebar states */
    --sidebar-bg-active: #eff5ff;
    --sidebar-text-active: var(--color-primary-700);
    --sidebar-icon-active: var(--color-primary-700);

    /* Button states */
    --btn-primary-shadow: rgba(37, 99, 235, 0.18);
    --btn-primary-shadow-hover: rgba(37, 99, 235, 0.28);
    --btn-danger-shadow: rgba(220, 38, 38, 0.18);
    --btn-danger-shadow-hover: rgba(220, 38, 38, 0.28);

    /* Focus ring */
    --focus-ring: rgba(37, 99, 235, 0.22);

    /* Card shadows */
    --card-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 1px 3px 0 rgb(15 23 42 / 0.06);
    --card-shadow-hover: 0 2px 4px -1px rgb(15 23 42 / 0.06), 0 4px 10px -2px rgb(15 23 42 / 0.08);
    --card-shadow-elevated: 0 8px 24px rgb(15 23 42 / 0.1);

    /* Surface tokens for component backgrounds */
    --surface-1: #f8fafc;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;

    /* Search */
    --search-shadow-focus: 0 1px 6px rgba(15, 23, 42, 0.12);

    /* Badge/icon backgrounds — مونوکروم با لهجه آبی */
    --icon-bg-blue: rgba(37, 99, 235, 0.08);
    --icon-bg-green: rgba(22, 163, 74, 0.08);
    --icon-bg-orange: rgba(217, 119, 6, 0.08);
    --icon-bg-purple: rgba(100, 116, 139, 0.1);
    --icon-bg-primary: rgba(37, 99, 235, 0.08);
    --icon-bg-success: rgba(22, 163, 74, 0.1);
    --icon-bg-error: rgba(220, 38, 38, 0.1);
    --icon-bg-warning: rgba(217, 119, 6, 0.1);

    /* Profile avatar */
    --avatar-shadow: 0 4px 16px rgba(37, 99, 235, 0.14);

    /* Scrollbar */
    --scrollbar-track: transparent;
    --scrollbar-thumb: var(--border-secondary);
}

/*
 * Dark Theme
 * پایه #000000 خالص (طبق تأیید قبلی) با سطوح خاکستری سرد
 */
[data-theme="dark"] {
    /* Surface elevation system - pure black hierarchy */
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #121212;
    --bg-card: #151515;
    --bg-elevated: #1c1c1c;
    --bg-input: #121212;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-pressed: rgba(255, 255, 255, 0.1);
    --bg-active: rgba(255, 255, 255, 0.06);
    --bg-sidebar: #000000;

    /* Text hierarchy */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-disabled: #3f3f46;
    --text-inverse: #0f172a;

    /* Border system — خیلی ظریف */
    --border-primary: #26262b;
    --border-secondary: #3f3f46;
    --border-focus: var(--color-primary-400);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-strong: #52525b;

    /* Overlay */
    --overlay: rgba(0, 0, 0, 0.65);

    /* Sidebar states */
    --sidebar-bg-active: rgba(59, 113, 247, 0.14);
    --sidebar-text-active: #93bbfd;
    --sidebar-icon-active: #93bbfd;

    /* Button states */
    --btn-primary-shadow: rgba(37, 99, 235, 0.28);
    --btn-primary-shadow-hover: rgba(37, 99, 235, 0.38);
    --btn-danger-shadow: rgba(220, 38, 38, 0.28);
    --btn-danger-shadow-hover: rgba(220, 38, 38, 0.38);

    /* Focus ring */
    --focus-ring: rgba(96, 150, 250, 0.28);

    /* Card shadows - stronger in dark */
    --card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.5), 0 1px 3px 0 rgb(0 0 0 / 0.4);
    --card-shadow-hover: 0 2px 4px -1px rgb(0 0 0 / 0.5), 0 6px 14px -2px rgb(0 0 0 / 0.55);
    --card-shadow-elevated: 0 8px 24px rgb(0 0 0 / 0.6);

    /* Surface tokens */
    --surface-1: #0a0a0a;
    --surface-2: #121212;
    --surface-3: #1c1c1c;

    /* Search */
    --search-shadow-focus: 0 1px 6px rgba(0, 0, 0, 0.6);

    /* Badge/icon backgrounds — مونوکروم با لهجه آبی */
    --icon-bg-blue: rgba(96, 150, 250, 0.14);
    --icon-bg-green: rgba(34, 197, 94, 0.14);
    --icon-bg-orange: rgba(245, 158, 11, 0.14);
    --icon-bg-purple: rgba(148, 163, 184, 0.14);
    --icon-bg-primary: rgba(96, 150, 250, 0.14);
    --icon-bg-success: rgba(34, 197, 94, 0.14);
    --icon-bg-error: rgba(239, 68, 68, 0.14);
    --icon-bg-warning: rgba(245, 158, 11, 0.14);

    /* Profile avatar */
    --avatar-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);

    /* Scrollbar */
    --scrollbar-track: transparent;
    --scrollbar-thumb: #3f3f46;
}