/* ============================================
   THEME VARIABLES - Foundation for White-Label
   ============================================
   This file contains all CSS custom properties (variables)
   that control the application's visual appearance.

   To create a new theme:
   1. Copy this file or create a new CSS file
   2. Override the :root variables as needed
   3. The ThemeService will generate CSS from database values
   ============================================ */

:root {
    /* ========================================
       BRAND COLORS
       ======================================== */
    --brand-primary: #0366d6;
    --brand-primary-light: #3b82f6;
    --brand-primary-dark: #0550ae;
    --brand-primary-rgb: 3, 102, 214;

    --brand-secondary: #384048;
    --brand-secondary-light: #4a5568;
    --brand-secondary-dark: #2c343a;
    --brand-secondary-rgb: 56, 64, 72;

    --brand-accent: #c0ff00;
    --brand-accent-dark: #9ecc00;
    --brand-accent-rgb: 192, 255, 0;

    /* ========================================
       SEMANTIC COLORS
       ======================================== */
    /* Success - Forest Green */
    --color-success: #2e8b57;
    --color-success-dark: #267349;
    --color-success-light: #ebf5f0;
    --color-success-rgb: 46, 139, 87;

    /* Warning - Amber */
    --color-warning: #d4a76a;
    --color-warning-dark: #c39355;
    --color-warning-light: #f8f3eb;
    --color-warning-rgb: 212, 167, 106;

    /* Danger - Burgundy */
    --color-danger: #a94442;
    --color-danger-dark: #913a38;
    --color-danger-light: #f5ebeb;
    --color-danger-rgb: 169, 68, 66;

    /* Info - Slate Blue */
    --color-info: #5b7f95;
    --color-info-dark: #4a697b;
    --color-info-light: #edf2f5;
    --color-info-rgb: 91, 127, 149;

    /* ========================================
       STATUS BADGE COLORS
       Used by .status-chip components
       ======================================== */
    /* Pending - Amber/Orange */
    --status-pending-bg: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.2) 100%);
    --status-pending-text: #b36b00;
    --status-pending-border: rgba(255, 152, 0, 0.4);
    --status-pending-shadow: rgba(255, 152, 0, 0.15);

    /* Confirmed - Green */
    --status-confirmed-bg: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(32, 201, 151, 0.2) 100%);
    --status-confirmed-text: #1a7f37;
    --status-confirmed-border: rgba(40, 167, 69, 0.4);
    --status-confirmed-shadow: rgba(40, 167, 69, 0.15);

    /* In Progress - Purple */
    --status-inprogress-bg: linear-gradient(135deg, rgba(111, 66, 193, 0.15) 0%, rgba(136, 84, 208, 0.2) 100%);
    --status-inprogress-text: #5a32a3;
    --status-inprogress-border: rgba(111, 66, 193, 0.4);
    --status-inprogress-shadow: rgba(111, 66, 193, 0.15);

    /* Completed - Blue */
    --status-completed-bg: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(32, 139, 254, 0.2) 100%);
    --status-completed-text: #0a58ca;
    --status-completed-border: rgba(13, 110, 253, 0.4);
    --status-completed-shadow: rgba(13, 110, 253, 0.15);

    /* Expired - Gray */
    --status-expired-bg: linear-gradient(135deg, rgba(108, 117, 125, 0.15) 0%, rgba(134, 142, 150, 0.2) 100%);
    --status-expired-text: #495057;
    --status-expired-border: rgba(108, 117, 125, 0.4);
    --status-expired-shadow: rgba(108, 117, 125, 0.15);

    /* Cancelled - Red */
    --status-cancelled-bg: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(235, 87, 100, 0.2) 100%);
    --status-cancelled-text: #b02a37;
    --status-cancelled-border: rgba(220, 53, 69, 0.4);
    --status-cancelled-shadow: rgba(220, 53, 69, 0.15);

    /* Client Cancelled - Dark Gray */
    --status-client-cancelled-bg: linear-gradient(135deg, rgba(33, 37, 41, 0.15) 0%, rgba(52, 58, 64, 0.2) 100%);
    --status-client-cancelled-text: #212529;
    --status-client-cancelled-border: rgba(33, 37, 41, 0.4);
    --status-client-cancelled-shadow: rgba(33, 37, 41, 0.15);

    /* Declined - Solid Red (inverted for emphasis) */
    --status-declined-bg: linear-gradient(135deg, rgba(220, 53, 69, 0.85) 0%, rgba(185, 43, 57, 0.95) 100%);
    --status-declined-text: #ffffff;
    --status-declined-border: rgba(220, 53, 69, 0.6);
    --status-declined-shadow: rgba(220, 53, 69, 0.25);

    /* ========================================
       SURFACE COLORS
       Backgrounds for cards, sections, etc.
       ======================================== */
    --surface-background: #ffffff;
    --surface-card: #ffffff;
    --surface-elevated: #f8f9fa;
    --surface-muted: #f5f5f5;
    --surface-border: #dee2e6;
    --surface-border-light: #e9ecef;
    --surface-hover: #f8f9fa;
    --surface-active: #e9ecef;

    /* ========================================
       TEXT COLORS
       ======================================== */
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-inverse: #ffffff;
    --text-heading: #384048;
    --text-link: var(--brand-primary);
    --text-link-hover: var(--brand-primary-dark);

    /* ========================================
       SHADOWS
       ======================================== */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.2);

    /* Card-specific shadow */
    --card-shadow: var(--shadow-sm);
    --card-shadow-hover: var(--shadow-md);

    /* ========================================
       LAYOUT - Sidebar & Navigation
       ======================================== */
    --sidebar-bg: linear-gradient(180deg, #000000 0%, #222222 70%);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.7);
    --sidebar-border: var(--brand-accent);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: rgba(192, 255, 0, 0.15);
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 70px;

    /* Header */
    --header-bg: var(--surface-background);
    --header-border: var(--surface-border);
    --header-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));

    /* ========================================
       BORDER RADIUS
       ======================================== */
    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-pill: 50px;
    --radius-circle: 50%;

    /* ========================================
       TRANSITIONS
       ======================================== */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* ========================================
       SPACING (extending Bootstrap)
       ======================================== */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 1rem;
    --spacing-4: 1.5rem;
    --spacing-5: 3rem;
    --spacing-6: 4rem;

    /* ========================================
       Z-INDEX LAYERS
       ======================================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ========================================
       FORM INPUTS
       ======================================== */
    --input-bg: var(--surface-background);
    --input-border: #d1d1d1;
    --input-border-focus: var(--brand-primary);
    --input-placeholder: var(--text-muted);
    --input-shadow-focus: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.15);

    /* ========================================
       TABLE STYLES
       ======================================== */
    --table-header-bg: #f8f8f8;
    --table-header-border: #ddd;
    --table-stripe-bg: rgba(var(--brand-primary-rgb), 0.03);
    --table-hover-bg: rgba(var(--brand-primary-rgb), 0.05);
    --table-border: var(--surface-border);
}

/* ============================================
   DARK MODE THEME
   ============================================ */
[data-theme="dark"] {
    /* Brand colors (slightly adjusted for dark mode) */
    --brand-primary: #4a9eff;
    --brand-primary-light: #6bb3ff;
    --brand-primary-dark: #3b82f6;

    /* Semantic colors adjusted for dark backgrounds */
    --color-success: #4ade80;
    --color-success-dark: #22c55e;
    --color-success-light: rgba(74, 222, 128, 0.15);

    --color-warning: #fbbf24;
    --color-warning-dark: #f59e0b;
    --color-warning-light: rgba(251, 191, 36, 0.15);

    --color-danger: #f87171;
    --color-danger-dark: #ef4444;
    --color-danger-light: rgba(248, 113, 113, 0.15);

    --color-info: #60a5fa;
    --color-info-dark: #3b82f6;
    --color-info-light: rgba(96, 165, 250, 0.15);

    /* Status badges - adjusted for dark mode */
    --status-pending-bg: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.25) 100%);
    --status-pending-text: #fcd34d;
    --status-pending-border: rgba(251, 191, 36, 0.5);

    --status-confirmed-bg: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.25) 100%);
    --status-confirmed-text: #86efac;
    --status-confirmed-border: rgba(74, 222, 128, 0.5);

    --status-inprogress-bg: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(139, 92, 246, 0.25) 100%);
    --status-inprogress-text: #c4b5fd;
    --status-inprogress-border: rgba(167, 139, 250, 0.5);

    --status-completed-bg: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(59, 130, 246, 0.25) 100%);
    --status-completed-text: #93c5fd;
    --status-completed-border: rgba(96, 165, 250, 0.5);

    --status-expired-bg: linear-gradient(135deg, rgba(156, 163, 175, 0.2) 0%, rgba(107, 114, 128, 0.25) 100%);
    --status-expired-text: #d1d5db;
    --status-expired-border: rgba(156, 163, 175, 0.5);

    --status-cancelled-bg: linear-gradient(135deg, rgba(248, 113, 113, 0.2) 0%, rgba(239, 68, 68, 0.25) 100%);
    --status-cancelled-text: #fca5a5;
    --status-cancelled-border: rgba(248, 113, 113, 0.5);

    --status-client-cancelled-bg: linear-gradient(135deg, rgba(107, 114, 128, 0.25) 0%, rgba(75, 85, 99, 0.3) 100%);
    --status-client-cancelled-text: #9ca3af;
    --status-client-cancelled-border: rgba(107, 114, 128, 0.5);

    --status-declined-bg: linear-gradient(135deg, rgba(220, 38, 38, 0.8) 0%, rgba(185, 28, 28, 0.9) 100%);
    --status-declined-text: #ffffff;
    --status-declined-border: rgba(220, 38, 38, 0.6);

    /* Surface colors - true black backgrounds (matching sidebar) */
    --surface-background: #000000;
    --surface-card: #1a1a1a;
    --surface-elevated: #222222;
    --surface-muted: #1a1a1a;
    --surface-border: #333333;
    --surface-border-light: #2a2a2a;
    --surface-hover: #2a2a2a;
    --surface-active: #333333;

    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #f8fafc;

    /* Shadows - darker and more pronounced for dark mode */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.7);

    /* Sidebar - true black variant */
    --sidebar-bg: linear-gradient(180deg, #000000 0%, #1a1a1a 70%);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-active-bg: rgba(192, 255, 0, 0.1);

    /* Header - true black */
    --header-bg: #1a1a1a;
    --header-border: #333333;
    --header-gradient: linear-gradient(135deg, #1e40af, #1d4ed8);

    /* Form inputs - true black */
    --input-bg: #1a1a1a;
    --input-border: #333333;
    --input-border-focus: var(--brand-primary);
    --input-placeholder: #666666;
    --input-shadow-focus: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);

    /* Tables - true black */
    --table-header-bg: #1a1a1a;
    --table-header-border: #333333;
    --table-stripe-bg: rgba(42, 42, 42, 0.5);
    --table-hover-bg: rgba(50, 50, 50, 0.5);
    --table-border: #2a2a2a;
}

/* Dark mode gradient background - matches sidebar gradient */
[data-theme="dark"] html,
[data-theme="dark"] body,
html[data-theme="dark"],
html[data-theme="dark"] body {
    background: linear-gradient(180deg, #000000 0%, #222222 70%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* ============================================
   PRINT STYLES
   Reset colors for printing
   ============================================ */
@media print {
    :root {
        --surface-background: #ffffff;
        --surface-card: #ffffff;
        --text-primary: #000000;
        --text-secondary: #333333;
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
    }
}
