/**
 * Global Dark Mode CSS
 * Apply to all pages by adding: <link rel="stylesheet" href="css/dark-mode.css">
 * And include: <script src="js/dark-mode.js"></script>
 * Dark mode colors match the inatevents system colors
 */

/* Root Dark Mode Variables */
[data-theme="dark"] {
    --bs-body-bg: #1a1a2e;
    --bs-body-color: #ffffff;
    --bs-primary: #667eea;
    --bs-secondary: #764ba2;
    --bs-success: #48bb78;
    --bs-warning: #ed8936;
    --bs-danger: #f56565;
    --bs-info: #4299e1;
    --bs-light: #2d3748;
    --bs-dark: #0f1419;
    
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Dark Mode Body */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    color: #ffffff !important;
}

/* Dark Mode Cards and Containers */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .navbar,
[data-theme="dark"] .sidebar {
    background: #0f3460 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Dark Mode Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] textarea {
    background: #16213e !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: #a0a0a0 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25) !important;
    background: #16213e !important;
}

/* Dark Mode Links */
[data-theme="dark"] a {
    color: #667eea;
}

[data-theme="dark"] a:hover {
    color: #764ba2;
}

/* Dark Mode Lists and Tables */
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .table {
    background: #16213e !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td,
[data-theme="dark"] .list-group-item {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Dark Mode Buttons */
[data-theme="dark"] .btn-outline-secondary {
    color: #a0a0a0;
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

[data-theme="dark"] .btn-light {
    background: #16213e !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode Dropdowns and Menus */
[data-theme="dark"] .dropdown-menu {
    background: #0f3460 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dropdown-item {
    color: #ffffff !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode Alerts */
[data-theme="dark"] .alert {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="dark"] .alert-info {
    background: rgba(66, 153, 225, 0.15);
    border-color: rgba(66, 153, 225, 0.3);
}

[data-theme="dark"] .alert-success {
    background: rgba(72, 187, 120, 0.15);
    border-color: rgba(72, 187, 120, 0.3);
}

[data-theme="dark"] .alert-warning {
    background: rgba(237, 137, 54, 0.15);
    border-color: rgba(237, 137, 54, 0.3);
}

[data-theme="dark"] .alert-danger {
    background: rgba(245, 101, 101, 0.15);
    border-color: rgba(245, 101, 101, 0.3);
}

/* Dark Mode Badges and Pills */
[data-theme="dark"] .badge {
    background: #667eea !important;
}

/* Dark Mode Pagination */
[data-theme="dark"] .pagination .page-link {
    background: #16213e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="dark"] .pagination .page-link:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

/* Dark Mode Modals */
[data-theme="dark"] .modal-content {
    background: #0f3460 !important;
}

[data-theme="dark"] .modal-header {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* Dark Mode Toasts */
[data-theme="dark"] .toast {
    background: #0f3460 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode Text Utilities */
[data-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

[data-theme="dark"] .text-body-secondary {
    color: #a0a0a0 !important;
}

[data-theme="dark"] .bg-light {
    background: #16213e !important;
}

[data-theme="dark"] .bg-body {
    background: #1a1a2e !important;
}

/* Dark Mode Headers and Sections */
[data-theme="dark"] .page-header,
[data-theme="dark"] .section-header,
[data-theme="dark"] .filter-section,
[data-theme="dark"] .calendar-view-container {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
}

/* Dark Mode Navbar */
[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .navbar-brand {
    color: #667eea !important;
}

[data-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .nav-link:hover {
    color: #667eea !important;
}

/* Dark Mode Footer */
[data-theme="dark"] footer {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="dark"] footer a {
    color: #667eea;
}

[data-theme="dark"] footer a:hover {
    color: #764ba2;
}

/* Dark Mode Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #16213e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Dark Mode Utility Classes */
[data-theme="dark"] .border {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .border-top {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .border-start {
    border-left-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .border-end {
    border-right-color: rgba(255, 255, 255, 0.1) !important;
}

/* Smooth transitions for theme switching */
[data-theme="dark"] * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Dark Mode Dark Background Class */
[data-theme="dark"] .bg-dark {
    background: #0f1419 !important;
}

[data-theme="dark"] .text-white {
    color: #ffffff !important;
}
