/* Dark Mode Theme Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary-gradient: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

[data-theme="dark"] {
    --bg-primary: #1a1d29;
    --bg-secondary: #0f1117;
    --bg-card: #242837;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --primary-gradient: linear-gradient(135deg, #4a6fa5 0%, #2e5090 100%);
}

/* Apply theme variables */
body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.admin-sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
}

.card,
.stat-card,
.admin-card {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.nav-link {
    color: var(--text-secondary);
}

.nav-link:hover {
    background: var(--bg-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(42, 82, 152, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(42, 82, 152, 0.4);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle i.bi-moon-fill {
    display: none;
}

[data-theme="dark"] .theme-toggle i.bi-sun-fill {
    display: inline-block;
}

[data-theme="light"] .theme-toggle i.bi-sun-fill {
    display: none;
}

[data-theme="light"] .theme-toggle i.bi-moon-fill {
    display: inline-block;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .table {
    color: var(--text-primary);
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}