@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Apply border-box globally so inputs and panels scale perfectly on all devices */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. GLOBAL CSS VARIABLES (THE DESIGN SYSTEM)
   ========================================================================== */

/* LIGHT MODE (DEFAULT) - Clean, bright, Apple-like */
:root, [data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-accent: #0066cc; /* Premium Apple Blue */
    --bg-accent-hover: #005bb5;
    
    /* Premium Light Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0,0,0,0.02);
    
    /* Typography */
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    
    /* Form Elements */
    --input-bg: rgba(0, 0, 0, 0.03);
    --input-border: rgba(0, 0, 0, 0.08);
    
    /* Status Colors (Accessible & Bright) */
    --color-vacant: #34c759;     
    --color-occupied: #ff3b30;   
    --color-reserved: #ff9500;   
    --color-maintenance: #007aff;
    --color-girls: #af52de;      
    --color-blocked: #1c1c1e;    
}

/* DARK MODE - Deep OLED blacks, professional Google-like dark theme */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-accent: #0a84ff;
    --bg-accent-hover: #409cff;
    
    /* Premium Dark Glassmorphism */
    --glass-bg: rgba(28, 28, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --text-main: #f5f5f7;
    --text-muted: #a1a1a6;
    
    /* Form Elements */
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    
    /* Status Colors (Slightly altered for dark mode contrast) */
    --color-vacant: #30d158;     
    --color-occupied: #ff453a;   
    --color-reserved: #ff9f0a;   
    --color-maintenance: #0a84ff;
    --color-girls: #bf5af2;      
    --color-blocked: #3a3a3c;
}

/* ==========================================================================
   2. CORE LAYOUT
   ========================================================================== */

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Soft gradient background that transitions smoothly between themes */
    background: radial-gradient(circle at top right, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* This makes the dark/light mode toggle visually stunning */
    transition: background 0.5s ease, color 0.5s ease;
}

/* ==========================================================================
   3. PREMIUM COMPONENTS
   ========================================================================== */

/* The Core Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    /* Saturate increases color vibrancy behind the blur - standard in iOS */
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 20px; /* Modern rounded corners */
    box-shadow: var(--glass-shadow);
    padding: 32px;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    width: 100%;
}

/* Form Inputs */
.input-group {
    margin-bottom: 22px;
    width: 100%;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}

.input-group input, 
.input-group select, 
.input-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Beautiful Focus States */
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    background: transparent;
    border-color: var(--bg-accent);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15); /* Apple-style focus ring */
}

[data-theme="dark"] .input-group input:focus,
[data-theme="dark"] .input-group select:focus {
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--bg-accent);
    color: white;
    border: none;
    border-radius: 12px; /* Pill-like radius */
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--bg-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 102, 204, 0.3);
}

/* Text Links */
.text-link {
    color: var(--bg-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.text-link:hover {
    color: var(--bg-accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   4. RESPONSIVE DESIGN (Mobile & Tablet)
   ========================================================================== */

/* Tablet & Mobile Layouts */
@media (max-width: 992px) {
    .glass-panel {
        padding: 24px;
        border-radius: 16px;
    }
}

/* Strict Mobile Layout */
@media (max-width: 768px) {
    .glass-panel {
        padding: 20px;
        border-radius: 12px;
    }
    
    .btn-primary {
        padding: 12px 20px;
        border-radius: 10px;
    }
    
    .input-group input, 
    .input-group select {
        padding: 12px 16px;
    }
}