/* css/theme-night.css */

/* Custom specificity selector to override all page-specific :root rules */
html.theme-night,
body.theme-night {
    --color-white: #1e293b;
    /* slate-800 background for cards, headers */
    --color-gray-bg: #0f172a;
    /* slate-900 page background */
    --color-black: #f8fafc;
    /* slate-50 text color for primary headings */
    --color-black-light: #cbd5e1;
    /* slate-300 text color for body text */
    --color-gray-border: #334155;
    /* slate-700 borders */
    --color-blue-light: rgba(37, 99, 235, 0.15);
    /* Translucent blue background for highlights */

    /* Dashboard specific variables override */
    --cream: #0f172a;
    --ink: #f8fafc;
    --plum: #cbd5e1;
    --jungle: #cbd5e1;
    --forest: #3b82f6;
    --aqua: #3b82f6;
    --muted: #94a3b8;

    /* Passenger Dashboard variables override */
    --bg-main: #0f172a;
    --border-color: #334155;
    --neutral: #94a3b8;

    /* GPS Page variables override */
    --neutral-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.95);
    --border: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

/* Custom Overrides for general UI components */
body.theme-night {
    background-color: #0f172a !important;
}

/* Overriding Bootstrap elements */
body.theme-night .navbar {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
}

body.theme-night .navbar-brand {
    color: #f8fafc !important;
}

body.theme-night .navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-night .navbar-toggler-icon {
    filter: invert(1);
}

body.theme-night .nav-link {
    color: #cbd5e1 !important;
}

body.theme-night .nav-link:hover,
body.theme-night .nav-link.active {
    color: #3b82f6 !important;
    background-color: rgba(37, 99, 235, 0.15) !important;
}

/* Card and Container Backgrounds */
body.theme-night .bg-white,
body.theme-night .card,
body.theme-night .card-body,
body.theme-night .dashboard-card,
body.theme-night .table-responsive,
body.theme-night .ticket-receipt-card,
body.theme-night .admin-menu,
body.theme-night .header-panel,
body.theme-night .control-panel,
body.theme-night .map-sidebar,
body.theme-night .passenger-list-card,
body.theme-night .access-denied,
body.theme-night .admin-main-container,
body.theme-night .profile-card-wrapper {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* Dropdown list active hover state */
body.theme-night .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.theme-night .dropdown-item {
    color: #cbd5e1 !important;
}

body.theme-night .dropdown-item:hover {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

/* Forms */
body.theme-night .form-control,
body.theme-night .form-select,
body.theme-night .input-group-text {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body.theme-night .form-control::placeholder {
    color: #64748b !important;
}

/* Tables */
body.theme-night .table {
    color: #cbd5e1 !important;
}

body.theme-night .table th,
body.theme-night .table td {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.theme-night .table-striped tbody tr:nth-of-type(odd) td,
body.theme-night .table-striped tbody tr:nth-of-type(odd) th {
    background-color: #1e293b !important;
}

body.theme-night .table-striped tbody tr:nth-of-type(even) td,
body.theme-night .table-striped tbody tr:nth-of-type(even) th {
    background-color: #151e2c !important; /* Premium subtle dark gray for striping */
}

/* Override Bootstrap table striped variables/pseudo-elements if active */
body.theme-night .table-striped>tbody>tr:nth-of-type(odd)>*,
body.theme-night .table-striped>tbody>tr:nth-of-type(even)>* {
    color: #cbd5e1 !important;
    box-shadow: none !important;
}

body.theme-night .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: #1e293b !important;
}

body.theme-night .table-striped>tbody>tr:nth-of-type(even)>* {
    background-color: #151e2c !important;
}

body.theme-night .table-hover tbody tr:hover,
body.theme-night .table-hover tbody tr:hover td,
body.theme-night .table-hover tbody tr:hover th,
body.theme-night .table-hover tbody tr:hover>* {
    background-color: #233146 !important;
    color: #f8fafc !important;
}

/* Modal styling */
body.theme-night .modal-content {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

body.theme-night .modal-header,
body.theme-night .modal-footer {
    border-color: #334155 !important;
}

body.theme-night .btn-close {
    filter: invert(1);
}

/* Breadcrumbs & Lists */
body.theme-night .breadcrumb-item a {
    color: #3b82f6 !important;
}

body.theme-night .breadcrumb-item.active {
    color: #94a3b8 !important;
}

body.theme-night .list-group-item {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* Badges and alerts default styles check */
body.theme-night .alert {
    border-color: #334155 !important;
}

/* Text styles overrides */
body.theme-night .text-dark,
body.theme-night .text-black-50 {
    color: #cbd5e1 !important;
}

body.theme-night .text-muted {
    color: #94a3b8 !important;
}

/* Fix any hardcoded text colors in tables, passenger lists, and lists */
body.theme-night td label,
body.theme-night td span,
body.theme-night .table td a {
    color: #cbd5e1 !important;
}

/* Primary buttons should look nice */
body.theme-night .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

body.theme-night .btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Admin panel specific elements */
body.theme-night .selected-admin-menu {
    background: linear-gradient(135deg, #2563eb, #1e3a8a) !important;
    color: #ffffff !important;
}

body.theme-night .admin-menu-btn-0:hover,
body.theme-night .admin-menu-btn-1:hover,
body.theme-night .admin-menu-btn-2:hover,
body.theme-night .admin-menu-btn-3:hover,
body.theme-night .admin-menu-btn-4:hover,
body.theme-night .admin-menu-btn-5:hover,
body.theme-night .admin-menu-btn-6:hover,
body.theme-night .admin-menu-btn-7:hover,
body.theme-night .admin-menu-btn-8:hover {
    background: #334155 !important;
    color: #3b82f6 !important;
}

/* Footer override */
body.theme-night footer,
body.theme-night .footer-section {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

/* GPS module maps override styling */
body.theme-night .leaflet-tile-container {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

body.theme-night .leaflet-container {
    background: #0f172a !important;
}

/* Home Page Hero Section / Main Banner Override (Keep White/Bright Original Text) */
body.theme-night .hero-section,
body.theme-night .hero-section * {
    color: #ffffff !important;
}
body.theme-night .hero-section .hero-subtitle {
    color: #cbd5e1 !important;
}
body.theme-night .hero-section .hero-badge-text {
    color: #e2e8f0 !important;
}
body.theme-night .hero-section .hero-feature-pill {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #e2e8f0 !important;
}
body.theme-night .hero-section .hero-title span {
    background: linear-gradient(to right, #60a5fa, #a5b4fc, #818cf8) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
body.theme-night .hero-section .hero-glass-box {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

/* Page Header & Breadcrumbs Banners Override (Keep White/Bright on Dark Banner Backgrounds) */
body.theme-night .bc_new h2,
body.theme-night .bc_new h3,
body.theme-night .about-hero h2,
body.theme-night .about-hero h3,
body.theme-night .contact-hero h2,
body.theme-night .contact-hero h3,
body.theme-night .bc_new .pageheader-content {
    color: #ffffff !important;
}
body.theme-night .bc_new .breadcrumb-item a,
body.theme-night .about-hero .breadcrumb-item a,
body.theme-night .contact-hero .breadcrumb-item a,
body.theme-night .breadcrumb-item a {
    color: #94a3b8 !important;
}
body.theme-night .bc_new .breadcrumb-item.active,
body.theme-night .about-hero .breadcrumb-item.active,
body.theme-night .contact-hero .breadcrumb-item.active,
body.theme-night .breadcrumb-item.active {
    color: #ffffff !important;
}
body.theme-night .bc_new .breadcrumb-item + .breadcrumb-item::before,
body.theme-night .about-hero .breadcrumb-item + .breadcrumb-item::before,
body.theme-night .contact-hero .breadcrumb-item + .breadcrumb-item::before,
body.theme-night .breadcrumb-item + .breadcrumb-item::before {
    color: #64748b !important;
}

/* Button text contrast fixes in Night Mode */
body.theme-night .btn-primary,
body.theme-night .cancel-link,
body.theme-night .cancel-exe {
    color: #ffffff !important;
}
body.theme-night .btn-primary:hover,
body.theme-night .cancel-link:hover,
body.theme-night .cancel-exe:hover {
    color: #ffffff !important;
}

/* Ticket Card Dark Mode Override */
body.theme-night .ticket-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
}
body.theme-night .ticket-header-route {
    color: #f8fafc !important;
}
body.theme-night .ticket-header-meta {
    color: #94a3b8 !important;
}
body.theme-night .ticket-card .text-muted,
body.theme-night .ticket-card strong {
    color: #cbd5e1 !important;
}
body.theme-night .price-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
body.theme-night .price-num {
    color: #3b82f6 !important;
}
body.theme-night .price-unit {
    color: #94a3b8 !important;
}
body.theme-night .btn-book-pill {
    background-color: #2563eb !important;
    color: #ffffff !important;
}
body.theme-night .btn-book-pill:hover {
    background-color: #1d4ed8 !important;
}

/* Hardcoded Muted/Dark Text Overrides for Better Dark Mode Readability */
body.theme-night .guide-desc,
body.theme-night .pillar-desc,
body.theme-night .timeline-desc,
body.theme-night .role-list li,
body.theme-night .terminal-info-line,
body.theme-night .testimonial-quote,
body.theme-night .testimonial-card p,
body.theme-night #why-new-section .feature-card p {
    color: #cbd5e1 !important;
}
body.theme-night .guide-num {
    color: rgba(255, 255, 255, 0.05) !important;
}
body.theme-night .guide-step:hover .guide-num {
    color: rgba(255, 255, 255, 0.1) !important;
}
body.theme-night .author-name,
body.theme-night .role-name,
body.theme-night #why-new-section .feature-card h3 {
    color: #f8fafc !important;
}
body.theme-night .author-role {
    color: #94a3b8 !important;
}

/* Feature Cards and Testimonial Cards Background Override */
body.theme-night .feature-card,
body.theme-night .testimonial-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Booking & Checkout Page Overrides */
body.theme-night .plan_title {
    color: #f8fafc !important;
}

body.theme-night .seat {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

body.theme-night .seat:hover {
    background-color: #334155 !important;
}

body.theme-night #booking_summary_card .card-body {
    background-color: #1e293b !important;
}

body.theme-night .journey-info-section,
body.theme-night .payment-methods,
body.theme-night #no_seats_selected_placeholder {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

body.theme-night #booking_summary_card .text-dark,
body.theme-night #booking_summary_card h6,
body.theme-night #booking_summary_card strong {
    color: #f8fafc !important;
}

body.theme-night #booking_success_overlay .card,
body.theme-night #payment_success_overlay .card {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.theme-night #booking_success_overlay h3,
body.theme-night #booking_success_overlay p,
body.theme-night #payment_success_overlay h3,
body.theme-night #payment_success_overlay p {
    color: #f8fafc !important;
}

body.theme-night #booking_success_overlay .bg-light,
body.theme-night #payment_success_overlay .bg-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

body.theme-night #booking_success_overlay .text-dark,
body.theme-night #payment_success_overlay .text-dark {
    color: #cbd5e1 !important;
}

/* rad_seat_booking_checkout.php styles */
body.theme-night .col-lg-7 .card,
body.theme-night .col-lg-5 .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.theme-night .booking-details-list .text-dark,
body.theme-night .booking-details-list .text-secondary {
    color: #cbd5e1 !important;
}

body.theme-night .payment-methods label,
body.theme-night .payment-methods span,
body.theme-night .form-check-label {
    color: #cbd5e1 !important;
}

body.theme-night .table-borderless td {
    background-color: transparent !important;
    color: #cbd5e1 !important;
}

body.theme-night .table-borderless tr.border-bottom {
    border-bottom-color: #334155 !important;
}

body.theme-night #btn_pay_now {
    border: 1px solid #334155 !important;
}