/**
 * ZED360 Theme System
 * Dark/Light Mode with CSS Variables
 */

:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7b8fec;
    --accent-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Header Colors */
    --header-bg: #ffffff;
    --header-text: #212529;
    --header-border: #dee2e6;
    
    /* Navigation Colors */
    --nav-bg: #ffffff;
    --nav-text: #212529;
    --nav-active: #667eea;
    --nav-active-text: #ffffff;
    
    /* Card Colors */
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    /* Button Colors */
    --btn-primary-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #6c757d;
    --btn-secondary-text: #ffffff;
    --btn-outline-border: #667eea;
    --btn-outline-text: #667eea;
    
    /* Input Colors */
    --input-bg: #ffffff;
    --input-border: #dee2e6;
    --input-text: #212529;
    --input-placeholder: #6c757d;
    --input-focus-border: #667eea;
    
    /* Link Colors */
    --link-color: #667eea;
    --link-hover: #5568d3;
    
    /* Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --border-color: #374151;
    --primary-color: #7b8fec;
    --primary-dark: #667eea;
    --primary-light: #8fa0f0;
    --accent-color: #9b6cb8;
    --success-color: #3cd97a;
    --danger-color: #ff6b6b;
    --warning-color: #ffd93d;
    --info-color: #4ecdc4;
    
    /* Header Colors */
    --header-bg: #16213e;
    --header-text: #eaeaea;
    --header-border: #374151;
    
    /* Navigation Colors */
    --nav-bg: #16213e;
    --nav-text: #eaeaea;
    --nav-active: #667eea;
    --nav-active-text: #ffffff;
    
    /* Card Colors */
    --card-bg: #16213e;
    --card-border: #374151;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    
    /* Button Colors */
    --btn-primary-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #4b5563;
    --btn-secondary-text: #ffffff;
    --btn-outline-border: #7b8fec;
    --btn-outline-text: #7b8fec;
    
    /* Input Colors */
    --input-bg: #1a1a2e;
    --input-border: #374151;
    --input-text: #eaeaea;
    --input-placeholder: #6b7280;
    --input-focus-border: #7b8fec;
    
    /* Link Colors */
    --link-color: #7b8fec;
    --link-hover: #8fa0f0;
    
    /* Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

/* Smooth transitions for theme switching */
body, header, footer, .card, .btn, input, select, textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme Toggle Button Icons */
.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection Styling */
::selection {
    background-color: var(--primary-color);
    color: var(--btn-primary-text);
}

/* Focus States */
button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Theme Adjustments */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        @extend [data-theme="dark"];
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-primary: #000000;
    }
    
    [data-theme="dark"] {
        --border-color: #ffffff;
        --text-primary: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}