/* Professional Global Dark Mode Overrides */
/* Applying high-end dark mode aesthetics to components with hardcoded colors */
/* Brand identity: deep forest-green + gold, sourced from the company emblem */

/* Base overrides */
html[data-bs-theme="dark"],
html[data-bs-theme="dark"] body {
    background-color: #081712 !important;
    background: #081712 !important;
    color: #e2ece6 !important;
}

html[data-bs-theme="dark"] .login-container {
    background: linear-gradient(135deg, #081712 0%, #123524 100%) !important;
}

/* Wrappers that had hardcoded backgrounds */
html[data-bs-theme="dark"] .users-wrapper,
html[data-bs-theme="dark"] .cities-wrapper,
html[data-bs-theme="dark"] .bookings-wrapper,
html[data-bs-theme="dark"] .profile-wrapper,
html[data-bs-theme="dark"] .container,
html[data-bs-theme="dark"] .container-fluid,
html[data-bs-theme="dark"] .container-fluid.my-5,
html[data-bs-theme="dark"] .container-fluid.py-4 {
    background-color: transparent !important; /* Allow body background to show through */
}

/* Premium Cards & Containers */
html[data-bs-theme="dark"] .premium-card,
html[data-bs-theme="dark"] .stats-card,
html[data-bs-theme="dark"] .stat-card,
html[data-bs-theme="dark"] .metric-card,
html[data-bs-theme="dark"] .glass-card,
html[data-bs-theme="dark"] .dashboard-pane,
html[data-bs-theme="dark"] .chart-box,
html[data-bs-theme="dark"] .office-card,
html[data-bs-theme="dark"] .summary-pane,
html[data-bs-theme="dark"] .premium-search-card,
html[data-bs-theme="dark"] .trip-premium-card,
html[data-bs-theme="dark"] .filter-sticky-card,
html[data-bs-theme="dark"] .empty-state-card,
html[data-bs-theme="dark"] .contact-form-card,
html[data-bs-theme="dark"] .feature-card,
html[data-bs-theme="dark"] .mobile-quick-actions,
html[data-bs-theme="dark"] .login-form-wrapper,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .table-custom tbody tr,
html[data-bs-theme="dark"] .table-modern tbody tr,
html[data-bs-theme="dark"] .profile-card,
html[data-bs-theme="dark"] .admin-card,
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-light {
    background: #0e2019 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Text Colors */
html[data-bs-theme="dark"] .user-name,
html[data-bs-theme="dark"] .text-dark,
html[data-bs-theme="dark"] .fw-bold,
html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6 {
    color: #f2f7f4 !important;
}

html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .table-custom thead th,
html[data-bs-theme="dark"] .table-clean thead th,
html[data-bs-theme="dark"] .table-modern thead th,
html[data-bs-theme="dark"] .form-label,
html[data-bs-theme="dark"] .metric-info h6 {
    color: #9db3a7 !important;
}

html[data-bs-theme="dark"] .text-dark,
html[data-bs-theme="dark"] code.text-dark {
    color: #cfe0d7 !important;
}

/* Tables */
html[data-bs-theme="dark"] .table-custom tbody td,
html[data-bs-theme="dark"] .table-admin tbody td {
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #f1f5f9 !important;
}

html[data-bs-theme="dark"] .table-custom thead th,
html[data-bs-theme="dark"] .table-admin thead th,
html[data-bs-theme="dark"] .table-clean thead th {
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-bs-theme="dark"] .table-clean tbody td,
html[data-bs-theme="dark"] .table-modern tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    color: #cfe0d7 !important;
}

/* Form Inputs & Filters */
html[data-bs-theme="dark"] .input-custom,
html[data-bs-theme="dark"] .search-input,
html[data-bs-theme="dark"] .input-group-custom,
html[data-bs-theme="dark"] .form-control-premium,
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background: #123524 !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-bs-theme="dark"] .input-group-text,
html[data-bs-theme="dark"] .gender-btn label,
html[data-bs-theme="dark"] .gender-label,
html[data-bs-theme="dark"] .stat-box,
html[data-bs-theme="dark"] .office-header,
html[data-bs-theme="dark"] .passenger-item,
html[data-bs-theme="dark"] .bus-layout,
html[data-bs-theme="dark"] .input-premium-group,
html[data-bs-theme="dark"] .action-icon,
html[data-bs-theme="dark"] .input-group,
html[data-bs-theme="dark"] .brand-icon,
html[data-bs-theme="dark"] .filter-section {
    background: #123524 !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #cfe0d7 !important;
}

/* Action Buttons */
html[data-bs-theme="dark"] .action-btn {
    background: #123524 !important;
    color: #cfe0d7 !important;
}
html[data-bs-theme="dark"] .btn-outline-secondary {
    color: #cfe0d7;
    border-color: rgba(255,255,255,0.1);
}
html[data-bs-theme="dark"] .btn-outline-custom {
    color: #7fd4ab;
    border-color: #7fd4ab;
}

/* Dashboard Sidebar & Topbar */
html[data-bs-theme="dark"] #sidebar {
    background: linear-gradient(180deg, #081712 0%, #123524 100%) !important;
    border-left: 1px solid rgba(255,255,255,0.05);
}
html[data-bs-theme="dark"] .topbar {
    background: rgba(8, 23, 18, 0.85) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
html[data-bs-theme="dark"] .profile-dropdown {
    background: #123524 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255,255,255,0.05);
}
html[data-bs-theme="dark"] .brand-logo-container {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Navbar & App Shell (Frontend Bus Layout) */
html[data-bs-theme="dark"] .navbar-saas {
    background: rgba(8, 23, 18, 0.85) !important;
    border-bottom-color: rgba(255,255,255,0.05) !important;
}
html[data-bs-theme="dark"] .navbar-saas.scrolled {
    background: rgba(18, 53, 36, 0.95) !important;
}
html[data-bs-theme="dark"] .navbar-brand { color: #f8fafc !important; }
html[data-bs-theme="dark"] .nav-link { color: #cfe0d7 !important; }
html[data-bs-theme="dark"] .nav-link:hover { color: white !important; background: rgba(255,255,255,0.05) !important; }
html[data-bs-theme="dark"] .nav-link.active { color: #7fd4ab !important; background: rgba(31, 107, 74, 0.15) !important; }

/* App Shell Mobile */
html[data-bs-theme="dark"] .mobile-bottom-actions {
    background: rgba(8, 23, 18, 0.92) !important;
    border-color: rgba(255,255,255,0.05) !important;
}

/* Dropdown */
html[data-bs-theme="dark"] .dropdown-item {
    color: #cfe0d7 !important;
}
html[data-bs-theme="dark"] .dropdown-item:hover {
    background: rgba(255,255,255,0.05) !important;
    color: white !important;
}

/* Specific Booking Elements */
html[data-bs-theme="dark"] .section-title {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255,255,255,0.05) !important;
}

html[data-bs-theme="dark"] .section-title i {
    background: rgba(201, 162, 39, 0.12) !important;
    color: #e0bf5c !important;
}

html[data-bs-theme="dark"] .form-control-custom,
html[data-bs-theme="dark"] .form-select-custom {
    background: #0e2019 !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .seat-available {
    background: #123524 !important;
    color: #9db3a7 !important;
}

html[data-bs-theme="dark"] .seat-booked {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

html[data-bs-theme="dark"] .summary-total {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .summary-item {
    border-bottom-color: rgba(255,255,255,0.05) !important;
}

html[data-bs-theme="dark"] .btn-add-item {
    background: rgba(31, 107, 74, 0.1) !important;
    border-color: rgba(31, 107, 74, 0.35) !important;
    color: #7fd4ab !important;
}

html[data-bs-theme="dark"] .hero-title,
html[data-bs-theme="dark"] .section-title {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .hero-subtitle,
html[data-bs-theme="dark"] .action-item,
html[data-bs-theme="dark"] .subtitle,
html[data-bs-theme="dark"] .form-check-label {
    color: #9db3a7 !important;
}

html[data-bs-theme="dark"] .brand-icon {
    background: rgba(255,255,255,0.05) !important;
    color: #7fd4ab !important;
}

html[data-bs-theme="dark"] .link-primary {
    color: #7fd4ab !important;
}

html[data-bs-theme="dark"] .feature-card p {
    color: #9db3a7 !important;
}

html[data-bs-theme="dark"] .feature-card {
    border-color: rgba(255,255,255,0.05) !important;
}

html[data-bs-theme="dark"] .feature-badge {
    background: #123524 !important;
    color: #9db3a7 !important;
    border-color: rgba(255,255,255,0.05) !important;
}

html[data-bs-theme="dark"] .time-node h3 {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .input-premium-group input {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .route-line {
    background: rgba(255,255,255,0.1) !important;
}

html[data-bs-theme="dark"] .bus-animated-icon {
    background: #0e2019 !important;
}

html[data-bs-theme="dark"] .guest-alert {
    background: linear-gradient(135deg, #1e1b1e, #2a241e) !important;
    border-color: rgba(201, 162, 39, 0.15) !important;
}

html[data-bs-theme="dark"] .guest-alert h5 {
    color: #e8cf7e !important;
}

html[data-bs-theme="dark"] .legend-item {
    color: #9db3a7 !important;
}

/* Specific Report Elements */
html[data-bs-theme="dark"] .metric-info h3 {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .pane-title {
    color: #f1f5f9 !important;
}

html[data-bs-theme="dark"] .pane-title i {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #7fd4ab !important;
}

html[data-bs-theme="dark"] .load-bar,
html[data-bs-theme="dark"] .progress {
    background: #123524 !important;
}

html[data-bs-theme="dark"] .stat-value {
    color: #f8fafc !important;
}

html[data-bs-theme="dark"] .stat-label {
    color: #9db3a7 !important;
}

html[data-bs-theme="dark"] .office-badge {
    background: rgba(31, 107, 74, 0.25) !important;
    color: #a9e6c4 !important;
}

html[data-bs-theme="dark"] .empty-state i {
    color: #33553f !important;
}

/* Chart Grids */
html[data-bs-theme="dark"] canvas {
    filter: invert(0) !important; /* Charts usually need JS config for colors, but container bg is dark now */
}

/* Avatar Preview (UserProfile) */
html[data-bs-theme="dark"] .avatar-preview,
html[data-bs-theme="dark"] .profile-image-preview {
    border-color: #123524 !important;
}

/* Transition rule to avoid jank if possible, applied sparingly */
body, .premium-card, .table-custom tbody tr, .topbar, .navbar-saas {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

/* --- App-like Touch & Interaction Utilities --- */
.btn, .form-control, .form-select, .action-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn:active, .action-card:active {
    transform: scale(0.96) !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0e2019 !important;
    border-color: #1f6b4a !important;
    box-shadow: 0 0 0 4px rgba(31, 107, 74, 0.18) !important;
}

/* Glassmorphism Helper Class */
.glass-panel-premium {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .glass-panel-premium {
    background: rgba(18, 53, 36, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}
