/* 🎨 Uncle Grimmy's Theme Engine - Because One Size Fits Nobody */

/* Base CSS Variables for Theme System */
:root {
    --primary-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono-font: 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
    
    /* Animation Timing */
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Layout Constants */
    --max-width: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
}

/* 🌅 LIGHT THEME - Clean and Professional */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-accent: #3b82f6;
    --bg-danger: #ef4444;
    --bg-success: #10b981;
    --bg-warning: #f59e0b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* 🌙 DARK THEME - Uncle Grimmy's Secret Underground Cyber Bunker */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-accent: #00d4ff;
    --bg-danger: #ff4757;
    --bg-success: #2ed573;
    --bg-warning: #ffa502;
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f0f1a;
    
    --border-color: #334155;
    --border-focus: #00d4ff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    
    /* Extra dark mode glow effects */
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-red: 0 0 20px rgba(255, 71, 87, 0.3);
}

/* 💼 CORPORATE THEME - LinkedIn's Anemic Little Brother */
[data-theme="corporate"] {
    --bg-primary: #fafbfc;
    --bg-secondary: #f1f3f4;
    --bg-tertiary: #e8eaed;
    --bg-accent: #0073b1;
    --bg-danger: #cc1016;
    --bg-success: #057642;
    --bg-warning: #915907;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-focus: #0073b1;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* 🍎 APPLE THEME - So Clean It Squeaks */
[data-theme="apple"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fbfbfd;
    --bg-tertiary: #f2f2f7;
    --bg-accent: #007aff;
    --bg-danger: #ff3b30;
    --bg-success: #34c759;
    --bg-warning: #ff9500;
    
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-muted: #a1a1a6;
    --text-inverse: #ffffff;
    
    --border-color: #d2d2d7;
    --border-focus: #007aff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-md: 0 2px 4px 0 rgb(0 0 0 / 0.06);
    --shadow-lg: 0 4px 8px 0 rgb(0 0 0 / 0.08);
}

/* 🎨 CUSTOM THEME - User Defined (defaults to dark with customizable accent) */
[data-theme="custom"] {
    --bg-primary: var(--custom-bg-primary, #1a1a2e);
    --bg-secondary: var(--custom-bg-secondary, #16213e);
    --bg-tertiary: var(--custom-bg-tertiary, #0f3460);
    --bg-accent: var(--custom-accent, #ff6b6b);
    --bg-danger: var(--custom-danger, #ff4757);
    --bg-success: var(--custom-success, #2ed573);
    --bg-warning: var(--custom-warning, #ffa502);
    
    --text-primary: var(--custom-text-primary, #f1f2f6);
    --text-secondary: var(--custom-text-secondary, #a4b0be);
    --text-muted: var(--custom-text-muted, #747d8c);
    --text-inverse: var(--custom-text-inverse, #1a1a2e);
    
    --border-color: var(--custom-border, #57606f);
    --border-focus: var(--custom-accent, #ff6b6b);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* 🎛️ Theme Selector Styles */
.theme-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-secondary);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-focus);
}

.theme-btn.active {
    background: var(--bg-accent);
    color: var(--text-inverse);
    border-color: var(--bg-accent);
    box-shadow: var(--shadow-md);
}

/* Dark theme specific button effects */
[data-theme="dark"] .theme-btn:hover {
    box-shadow: var(--glow-cyan);
}

[data-theme="dark"] .theme-btn.active {
    box-shadow: var(--glow-cyan);
}

/* Custom Theme Color Picker (appears when custom theme is selected) */
.custom-theme-controls {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 280px;
}

.custom-theme-controls.visible {
    display: block;
}

.color-input-group {
    margin-bottom: var(--spacing-sm);
}

.color-input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.color-input-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Responsive Theme Selector */
@media (max-width: 768px) {
    .theme-selector {
        top: 10px;
        right: 10px;
        gap: var(--spacing-xs);
    }
    
    .theme-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .custom-theme-controls {
        top: 65px;
        right: 10px;
        min-width: 240px;
    }
}

/* Theme transition animations */
* {
    transition: 
        background-color var(--transition-smooth),
        color var(--transition-smooth),
        border-color var(--transition-smooth),
        box-shadow var(--transition-smooth);
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* 🪟 Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn var(--transition-smooth);
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 2% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--transition-smooth);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
}

.close {
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-body .consultation-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.modal-body .consultation-benefits {
    margin-bottom: var(--spacing-lg);
}

.modal-body .benefit-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.modal-body .benefit-icon {
    font-size: 1.5rem;
    min-width: 2rem;
}

.modal-body .benefit-item h4 {
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.modal-body .benefit-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: var(--spacing-md);
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: var(--spacing-md);
    }
    
    .close {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 98vh;
    }
    
    .modal-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}
