/* Global Theme System for TalkNow */

/* Base CSS Variables - Will be overridden by theme */
:root {
    --bg: #000000;
    --text: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #888888;
    --accent: #00AEEF;
    --accent-hover: #0099D6;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --surface-lighter: #3a3a3a;
    --border: #333333;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Global theme base styles */
body {
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme specific styles */
.theme-dark {
    color-scheme: dark;
}

.theme-light {
    color-scheme: light;
}

/* Global component styles using theme variables */
.modal {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--surface-lighter);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--text);
}

/* Form elements */
input, select, textarea {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    background: var(--surface-lighter);
}

/* Cards and surfaces */
.card, .panel, .section {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Navigation */
.nav, .menu {
    background: var(--surface);
    border: 1px solid var(--border);
}

.nav-item, .menu-item {
    color: var(--text-secondary);
}

.nav-item:hover, .menu-item:hover {
    color: var(--text);
    background: var(--surface-light);
}

.nav-item.active, .menu-item.active {
    color: var(--accent);
}

/* Alerts */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error, .alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Text styles */
.text-primary {
    color: var(--accent);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--error);
}

.text-warning {
    color: var(--warning);
}

/* Borders */
.border {
    border: 1px solid var(--border);
}

.border-top {
    border-top: 1px solid var(--border);
}

.border-bottom {
    border-bottom: 1px solid var(--border);
}

/* Shadows */
.shadow {
    box-shadow: 0 2px 10px var(--shadow);
}

.shadow-sm {
    box-shadow: 0 1px 5px var(--shadow);
}

.shadow-lg {
    box-shadow: 0 4px 20px var(--shadow);
}

/* Loading and overlays */
.loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.theme-light .loading-overlay {
    background: rgba(255, 255, 255, 0.8);
}

/* Auto theme media queries for fallback */
@media (prefers-color-scheme: light) {
    .theme-auto {
        --bg: #ffffff;
        --text: #000000;
        --text-secondary: #333333;
        --text-muted: #666666;
        --accent: #007bff;
        --accent-hover: #0056b3;
        --surface: #f8f9fa;
        --surface-light: #e9ecef;
        --surface-lighter: #dee2e6;
        --border: #dee2e6;
        --shadow: rgba(0, 0, 0, 0.1);
    }
}

@media (prefers-color-scheme: dark) {
    .theme-auto {
        --bg: #000000;
        --text: #FFFFFF;
        --text-secondary: #CCCCCC;
        --text-muted: #888888;
        --accent: #00AEEF;
        --accent-hover: #0099D6;
        --surface: #1a1a1a;
        --surface-light: #2a2a2a;
        --surface-lighter: #3a3a3a;
        --border: #333333;
        --shadow: rgba(0, 0, 0, 0.5);
    }
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme toggle animation */
.theme-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
