/* ============================================
   EasyRental Theme System V2 - Premium Evolution
   Supports Light & Dark Modes
   ============================================ */

/* CSS Custom Properties (Variables) */
:root {
    /* Brand Colors - Refined Palette */
    --color-primary: #3B82F6;           /* Richer Blue - trust & technology */
    --color-primary-dark: #2563EB;      /* Deep Blue - hover states */
    --color-primary-light: #60A5FA;     /* Light Blue - accents */
    --color-secondary: #14B8A6;         /* Teal - growth & freshness */
    --color-secondary-dark: #0D9488;    /* Deep Teal */
    --color-accent: #F59E0B;            /* Warm Amber - hospitality & energy */
    --color-accent-light: #FBBF24;      /* Light Amber */
    
    /* Extended Palette */
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;
    
    /* Light Theme (Default) */
    --bg-primary: #FAFAF9;              /* Warm white */
    --bg-secondary: #FFFFFF;            /* Pure white */
    --bg-tertiary: #F5F5F4;             /* Stone 100 */
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;
    
    --text-primary: #0F172A;            /* Slate 900 */
    --text-secondary: #475569;          /* Slate 600 */
    --text-muted: #64748B;              /* Slate 500 */
    --text-inverse: #FFFFFF;
    
    --border-color: #E2E8F0;            /* Slate 200 */
    --border-light: #F1F5F9;            /* Slate 100 */
    --border-strong: #CBD5E1;           /* Slate 300 */
    
    /* Shadows - Softer, more premium */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* Gradient Definitions */
    --gradient-brand: linear-gradient(135deg, #3B82F6 0%, #0EA5E9 50%, #14B8A6 100%);
    --gradient-brand-hover: linear-gradient(135deg, #2563EB 0%, #0284C7 50%, #0D9488 100%);
    --gradient-subtle: linear-gradient(180deg, #FAFAF9 0%, #F5F5F4 100%);
    --gradient-shine: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    
    /* Typography Scale */
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    
    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Logo paths */
    --logo-url: url('../images/theme/light/logo-v2.svg');
    --logo-icon-url: url('../images/theme/light/logo-icon-v2.svg');
}

/* Dark Theme */
html.dark,
[data-theme="dark"] {
    --bg-primary: #0B0F19;              /* Deep space */
    --bg-secondary: #111827;            /* Slate 900 */
    --bg-tertiary: #1F2937;             /* Slate 800 */
    --bg-surface: #1F2937;
    --bg-elevated: #374151;             /* Slate 700 */
    
    --text-primary: #F9FAFB;            /* Gray 50 */
    --text-secondary: #E5E7EB;          /* Gray 200 */
    --text-muted: #9CA3AF;              /* Gray 400 */
    --text-inverse: #0F172A;
    
    --border-color: #374151;            /* Slate 700 */
    --border-light: #4B5563;            /* Slate 600 */
    --border-strong: #6B7280;           /* Gray 500 */
    
    /* Shadows for dark mode */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.4);
    
    /* Dark mode logos */
    --logo-url: url('../images/theme/dark/logo-v2.svg');
    --logo-icon-url: url('../images/theme/dark/logo-icon-v2.svg');
}

/* Theme Transition - Smooth but not jarring */
html,
html *,
html *::before,
html *::after {
    transition: background-color 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease,
                box-shadow 0.25s ease,
                opacity 0.25s ease;
}

/* Disable transition on page load */
html.loading *,
html.loading *::before,
html.loading *::after {
    transition: none !important;
}

/* ============================================
   Logo Utilities
   ============================================ */

.logo-theme {
    content: var(--logo-url);
}

.logo-icon-theme {
    content: var(--logo-icon-url);
}

img.logo-full {
    content: var(--logo-url);
}

img.logo-icon {
    content: var(--logo-icon-url);
}

/* ============================================
   Theme Toggle Button - Refined
   ============================================ */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Hide sun in light mode, moon in dark mode */
html.light .theme-toggle .sun,
html:not(.dark) .theme-toggle .sun {
    display: none;
}

html.dark .theme-toggle .moon {
    display: none;
}

/* ============================================
   Brand Gradient Utilities
   ============================================ */

.bg-brand-gradient {
    background: var(--gradient-brand);
}

.text-brand-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-brand-gradient {
    border-image: var(--gradient-brand) 1;
}

/* ============================================
   Premium Button Styles
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    background: var(--gradient-brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Button sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ============================================
   Card Styles - Premium Elevation
   ============================================ */

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    border-color: var(--color-primary-light);
}

.card-elevated {
    box-shadow: var(--shadow-md);
}

/* ============================================
   Input Styles
   ============================================ */

.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.input:hover {
    border-color: var(--border-strong);
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Loading & Skeleton States
   ============================================ */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 0.8s linear infinite;
}

/* ============================================
   System Theme Detection
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root:not(.light):not([data-theme="light"]) {
        --bg-primary: #0B0F19;
        --bg-secondary: #111827;
        --bg-tertiary: #1F2937;
        --bg-surface: #1F2937;
        --bg-elevated: #374151;
        
        --text-primary: #F9FAFB;
        --text-secondary: #E5E7EB;
        --text-muted: #9CA3AF;
        --text-inverse: #0F172A;
        
        --border-color: #374151;
        --border-light: #4B5563;
        --border-strong: #6B7280;
        
        --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
        
        --logo-url: url('../images/theme/dark/logo-v2.svg');
        --logo-icon-url: url('../images/theme/dark/logo-icon-v2.svg');
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --border-strong: #000000;
        --text-primary: #000000;
    }
    
    html.dark,
    [data-theme="dark"] {
        --border-color: #FFFFFF;
        --border-strong: #FFFFFF;
        --text-primary: #FFFFFF;
    }
}

/* ============================================
   Reduced Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    html,
    html *,
    html *::before,
    html *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    :root {
        --bg-primary: #FFFFFF;
        --text-primary: #000000;
        --logo-url: url('../images/theme/logo-mono.svg');
    }
    
    .theme-toggle,
    .no-print {
        display: none !important;
    }
}
