@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

/* ==========================================================================
   AUTEVO DESIGN SYSTEM FOUNDATION
   Aesthetic: Hybrid Clean / Spatial (Glassmorphism + Premium UX)
   ========================================================================== */

:root {
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Colors - Light Theme (Default Hybrid) */
    --bg-body: #f4f5f7;
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.75);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --color-primary: #007aff;
    --color-primary-hover: #005bb5;
    --color-accent: #00ffcc;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    /* Borders & Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --border-light: 1px solid rgba(0, 0, 0, 0.05);

    /* Shadows & Depth */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    
    /* Animation & Blur */
    --blur-intensity: blur(16px);
    --transition-fast: 0.15s ease-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */

body {
    background-color: var(--bg-body);
    font-family: var(--font-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   CORE COMPONENTS (Spatial Glassmorphism)
   ========================================================================== */

/* The Premium Card Surface */
.card {
    background: var(--bg-surface-glass);
    backdrop-filter: var(--blur-intensity);
    -webkit-backdrop-filter: var(--blur-intensity);
    border: var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: var(--border-light);
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
}

/* Typography Enhancements */
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), #00d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Interactive Elements (Micro-animations) */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    padding: 0.6rem 1.2rem;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #00c6ff);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    color: white;
}

/* Data Tables */
.table {
    color: var(--text-secondary);
}

.table th {
    font-family: var(--font-heading);
    font-weight: 600;
    border-top: none;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(0, 122, 255, 0.03);
}

/* Specialized App Components */
.quote-section {
    background: var(--bg-surface-glass);
    backdrop-filter: var(--blur-intensity);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.price-highlight {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
    text-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.form-label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Line Items & Spatial Layouts */
.line-item,
.countertop-item {
    background: var(--bg-surface);
    border: var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: all var(--transition-smooth);
}

.line-item:hover,
.countertop-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(0, 122, 255, 0.3);
}

/* Calendar & Scheduling UI */
.calendar-day {
    position: relative;
    min-height: 120px;
    background: rgba(255,255,255,0.4);
    border: var(--border-light);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.calendar-day:hover {
    background: rgba(255,255,255,0.8);
}

.calendar-day .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 4px;
}

.calendar-day .btn-group {
    display: none;
}

.calendar-day .badge:hover .btn-group {
    display: flex;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.05);
}

.status-badge {
    border-radius: 12px;
    padding: 0.35em 0.8em;
    font-weight: 600;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .table-responsive {
        font-size: 0.875rem;
    }
    .calendar-day {
        min-height: 80px;
    }
}

/* ==========================================================================
   THEME OVERRIDES
   ========================================================================== */

/* Futuristic Dark Theme */
html[data-theme="futuristic_dark"] {
    /* Legacy Modern CRM Token Mappings */
    --background-color: #050505;
    --surface-color: rgba(15, 15, 15, 0.85);
    --border-color: rgba(0, 255, 204, 0.15);
    --border-light: rgba(0, 255, 204, 0.05);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #00ffcc;
    --primary-hover: #00cca3;
    --primary-50: rgba(0, 255, 204, 0.08);
    
    --sidebar-bg: #111111;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f8fafc;
    --sidebar-active-bg: rgba(0, 255, 204, 0.15);
    --sidebar-hover-bg: rgba(0, 255, 204, 0.05);
    --sidebar-heading: #64748b;
    --sidebar-border: rgba(0, 255, 204, 0.15);
    
    --table-header-bg: rgba(0, 255, 204, 0.05);
    --table-header-color: #f8fafc;
    --table-stripe-bg: rgba(255,255,255,0.02);
    --table-hover-bg: rgba(0, 255, 204, 0.08);
    --table-border-color: rgba(0, 255, 204, 0.15);

    --neutral-50: rgba(255,255,255,0.02);
    --neutral-100: rgba(255,255,255,0.05);
    --neutral-600: #94a3b8;
    
    /* Spatial Custom Tokens */
    --bg-body: #050505;
    --bg-surface: #111111;
    --bg-surface-glass: rgba(15, 15, 15, 0.85);
    --border-glass: rgba(0, 255, 204, 0.2);
    --shadow-sm: 0 4px 6px -1px rgba(0, 255, 204, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 255, 204, 0.1);
    --shadow-glass: 0 0 15px 0 rgba(0, 255, 204, 0.05);
}

/* AI First Theme */
html[data-theme="ai_first"] {
    /* Legacy Modern CRM Token Mappings */
    --background-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-50: rgba(59, 130, 246, 0.1);
    
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #f1f5f9;
    --sidebar-active-bg: rgba(59, 130, 246, 0.2);
    --sidebar-hover-bg: rgba(59, 130, 246, 0.1);
    --sidebar-heading: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    
    --table-header-bg: rgba(59, 130, 246, 0.05);
    --table-header-color: #f1f5f9;
    --table-stripe-bg: rgba(255,255,255,0.02);
    --table-hover-bg: rgba(59, 130, 246, 0.1);
    --table-border-color: rgba(255, 255, 255, 0.1);

    --neutral-50: rgba(255,255,255,0.02);
    --neutral-100: rgba(255,255,255,0.05);
    --neutral-600: #cbd5e1;

    /* Spatial Custom Tokens */
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-glass: rgba(30, 41, 59, 0.9);
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   THEME STRUCTURAL OVERRIDES (Glassmorphism & Shadows)
   ========================================================================== */

/* Futuristic Dark overrides */
html[data-theme="futuristic_dark"] body,
html[data-theme="futuristic_dark"] .main-content {
    background-color: var(--background-color) !important;
}

html[data-theme="futuristic_dark"] .card,
html[data-theme="futuristic_dark"] .dashboard-v2 .card,
html[data-theme="futuristic_dark"] .grid-stack-item-content {
    background: var(--bg-surface-glass) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-glass) !important;
    border-radius: 4px !important; /* Sharp corners for cyberpunk */
}

html[data-theme="futuristic_dark"] .sidebar {
    background: var(--bg-surface-glass) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass) !important;
}

html[data-theme="futuristic_dark"] .navbar {
    background: rgba(5, 5, 5, 0.7) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass) !important;
}

html[data-theme="futuristic_dark"] .btn-primary,
html[data-theme="futuristic_dark"] .btn-dash-primary {
    background: rgba(0, 255, 204, 0.05) !important;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2), inset 0 0 10px rgba(0, 255, 204, 0.1) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px !important;
}
html[data-theme="futuristic_dark"] .btn-primary:hover,
html[data-theme="futuristic_dark"] .btn-dash-primary:hover {
    background: rgba(0, 255, 204, 0.15) !important;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.4), inset 0 0 15px rgba(0, 255, 204, 0.2) !important;
    color: var(--primary-color) !important;
}


/* AI First overrides */
html[data-theme="ai_first"] body,
html[data-theme="ai_first"] .main-content {
    background-color: var(--background-color) !important;
}

html[data-theme="ai_first"] .card,
html[data-theme="ai_first"] .dashboard-v2 .card,
html[data-theme="ai_first"] .grid-stack-item-content {
    background: var(--bg-surface-glass) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-glass) !important;
    border-radius: 24px !important; /* Extra rounded friendly corners */
}

html[data-theme="ai_first"] .sidebar {
    background: var(--bg-surface-glass) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-glass) !important;
}

html[data-theme="ai_first"] .navbar {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass) !important;
}

html[data-theme="ai_first"] .btn,
html[data-theme="ai_first"] .btn-dash {
    border-radius: 20px !important;
}

html[data-theme="ai_first"] .btn-primary,
html[data-theme="ai_first"] .btn-dash-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}