/* Dark Mode Styles */
:root {
    --bg-light: #ffffff;
    --bg-dark: #1a1a1a;
    --text-light: #333333;
    --text-dark: #e5e5e5;
    --card-light: #ffffff;
    --card-dark: #2d2d2d;
    --border-light: #e5e7eb;
    --border-dark: #404040;
}

/* Dark Mode Active */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

body.dark-mode .container,
body.dark-mode .row {
    background-color: transparent;
}

body.dark-mode .navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 1px solid var(--border-dark);
}

body.dark-mode .navbar-brand,
body.dark-mode .nav-link {
    color: var(--text-dark) !important;
}

body.dark-mode .nav-link:hover {
    color: #f0b632 !important;
}

body.dark-mode .page-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

body.dark-mode .page-header h1,
body.dark-mode .page-header p {
    color: var(--text-dark);
}

body.dark-mode .section {
    background-color: var(--bg-dark);
}

body.dark-mode .section.bg-light {
    background-color: #242424 !important;
}

body.dark-mode .search-form {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .search-form h4 {
    color: var(--text-dark) !important;
}

body.dark-mode .search-form .form-label {
    color: var(--text-dark) !important;
}

body.dark-mode .features-section {
    background-color: var(--bg-dark) !important;
}

body.dark-mode .feature-box {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
}

body.dark-mode .feature-title {
    color: var(--text-dark);
}

body.dark-mode .car-card-new {
    background-color: var(--card-dark);
    border: 1px solid var(--border-dark);
}

body.dark-mode .car-card-new .car-title,
body.dark-mode .car-card-new .car-year,
body.dark-mode .car-card-new .price-label,
body.dark-mode .car-card-new .price-value {
    color: var(--text-dark);
}

body.dark-mode .car-card-new .price-item {
    background-color: transparent;
    border-color: var(--border-dark);
}

body.dark-mode .car-pricing {
    background-color: transparent;
}

body.dark-mode .section-title,
body.dark-mode .section-subtitle {
    color: var(--text-dark);
}

body.dark-mode .hero-section {
    background-color: var(--bg-dark);
}

body.dark-mode .hero-content-wrapper {
    background-color: transparent;
}

body.dark-mode .hero-slide {
    opacity: 0.8;
}

body.dark-mode .hero-title {
    color: var(--text-dark);
}

body.dark-mode .hero-subtitle {
    color: #b5b5b5;
}

body.dark-mode .card,
body.dark-mode .car-card,
body.dark-mode .car-card-new,
body.dark-mode .content-card {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .card-body {
    background-color: var(--card-dark);
}

body.dark-mode .car-brand,
body.dark-mode .spec-card h5,
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
    color: var(--text-dark);
}

body.dark-mode .spec-card {
    background-color: #242424;
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .spec-card p {
    color: #b5b5b5;
}

body.dark-mode .price-option {
    background-color: #242424;
    border-color: var(--border-dark);
}

body.dark-mode .price-option h6 {
    color: var(--text-dark);
}

body.dark-mode .price-option small {
    color: #b5b5b5;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #242424;
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #2d2d2d;
    border-color: #f0b632;
    color: var(--text-dark);
}

body.dark-mode .form-label {
    color: var(--text-dark);
}

body.dark-mode .table {
    color: var(--text-dark);
}

body.dark-mode .table thead {
    background-color: #242424;
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: #242424;
}

body.dark-mode .footer {
    background-color: #1a1a1a;
    border-top: 1px solid var(--border-dark);
}

body.dark-mode .footer h5,
body.dark-mode .footer p,
body.dark-mode .footer a {
    color: var(--text-dark);
}

body.dark-mode .footer a:hover {
    color: #f0b632;
}

body.dark-mode .alert {
    background-color: #242424;
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark-mode .text-muted {
    color: #b5b5b5 !important;
}

body.dark-mode .bg-primary {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

body.dark-mode .section.bg-primary {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

body.dark-mode .modal-content {
    background-color: var(--card-dark);
    color: var(--text-dark);
}

body.dark-mode .modal-header {
    border-bottom-color: var(--border-dark);
}

body.dark-mode .btn-close {
    filter: invert(1);
}

body.dark-mode .image-preview {
    background-color: #242424;
    border-color: var(--border-dark);
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0b632, #ffc850);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(240, 182, 50, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
}

.dark-mode-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(240, 182, 50, 0.6);
}

body.dark-mode .dark-mode-toggle {
    background: linear-gradient(135deg, #4a4a4a, #2d2d2d);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .dark-mode-toggle:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.dark-mode-toggle i {
    transition: all 0.3s ease;
}

/* Admin Dark Mode Adjustments */
body.dark-mode .sidebar {
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border-right: 1px solid var(--border-dark);
}

body.dark-mode .sidebar-brand {
    border-bottom: 1px solid var(--border-dark);
}

body.dark-mode .sidebar-menu a {
    color: var(--text-dark);
}

body.dark-mode .sidebar-menu a:hover,
body.dark-mode .sidebar-menu a.active {
    background-color: #242424;
}

body.dark-mode .top-navbar {
    background-color: var(--card-dark);
    border-bottom: 1px solid var(--border-dark);
}

body.dark-mode .main-content {
    background-color: #0f0f0f;
}

body.dark-mode .admin-avatar {
    background: linear-gradient(135deg, #4a4a4a, #2d2d2d);
}

body.dark-mode .car-image {
    border: 1px solid var(--border-dark);
}

/* Ensure buttons and badges remain visible */
body.dark-mode .btn-primary,
body.dark-mode .btn-submit,
body.dark-mode .btn-add {
    background: linear-gradient(135deg, #f0b632, #ffc850);
    color: white;
}

body.dark-mode .badge-available {
    background-color: rgba(76, 175, 80, 0.2);
}

body.dark-mode .badge-rented {
    background-color: rgba(255, 165, 0, 0.2);
}

body.dark-mode .badge-maintenance {
    background-color: rgba(220, 38, 38, 0.2);
}

/* Smooth transition for dark mode */
body,
.navbar,
.card,
.section,
.footer,
.sidebar,
.top-navbar,
.main-content,
.form-control,
.form-select,
.table,
.spec-card,
.price-option {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Additional overrides to ensure no white backgrounds */
body.dark-mode .car-card-new {
    border: 1px solid var(--border-dark) !important;
}

body.dark-mode .price-item {
    border: 1px solid var(--border-dark) !important;
}

body.dark-mode .btn-primary-custom,
body.dark-mode .btn-book,
body.dark-mode .btn-submit,
body.dark-mode .btn-add,
body.dark-mode .btn-success,
body.dark-mode .btn-outline-light {
    border-color: transparent !important;
}

body.dark-mode .promo-badge,
body.dark-mode .promo-label {
    border-color: transparent !important;
}

body.dark-mode .badge {
    border-color: transparent !important;
}

/* Force all sections and containers to be dark */
body.dark-mode section,
body.dark-mode .container-fluid,
body.dark-mode main {
    background-color: transparent !important;
}

/* Fix car image wrapper white background */
body.dark-mode .car-image-wrapper {
    background-color: var(--card-dark) !important;
    border-bottom: 1px solid var(--border-dark);
}

body.dark-mode .car-card-body,
body.dark-mode .card-body {
    background-color: transparent !important;
}

/* Fix car card content white background */
body.dark-mode .car-card-content {
    background-color: transparent !important;
}

/* Ensure all price items have dark background */
body.dark-mode .car-pricing {
    background-color: transparent !important;
}

/* Fix any remaining white backgrounds in cards */
body.dark-mode .car-card-new * {
    background-color: inherit;
}

body.dark-mode .car-card-new .car-image-wrapper {
    background-color: var(--card-dark) !important;
}

body.dark-mode .car-card-new .car-card-content {
    background-color: transparent !important;
}

/* ===============================================
   CARS.PHP PAGE DARK MODE STYLES
   =============================================== */

/* Car Card on cars.php */
body.dark-mode .car-card {
    background: var(--card-dark) !important;
    border-color: var(--border-dark) !important;
}

body.dark-mode .car-card:hover {
    border-color: #f0b632 !important;
}

body.dark-mode .car-card-body {
    background-color: transparent !important;
}

body.dark-mode .car-brand,
body.dark-mode .car-model {
    color: var(--text-dark) !important;
}

body.dark-mode .car-specs {
    background-color: transparent;
}

body.dark-mode .car-spec {
    color: var(--text-dark);
}

/* Page Header */
body.dark-mode .page-header {
    background-color: #1a1a1a;
}

/* Section bg-light */
body.dark-mode .bg-light {
    background-color: var(--bg-dark) !important;
}

body.dark-mode .section.bg-light {
    background-color: var(--bg-dark) !important;
}

/* Filter Card */
body.dark-mode .card.shadow-sm {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .card-title {
    color: var(--text-dark) !important;
}

/* ===============================================
   ADMIN DASHBOARD DARK MODE STYLES
   =============================================== */

/* Admin Stats Cards */
body.dark-mode .stats-card {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .stats-card.primary,
body.dark-mode .stats-card.success,
body.dark-mode .stats-card.warning,
body.dark-mode .stats-card.info {
    background-color: var(--card-dark) !important;
}

body.dark-mode .stats-number,
body.dark-mode .stats-label {
    color: var(--text-dark) !important;
}

body.dark-mode .stats-icon {
    opacity: 0.9;
}

/* Admin Page Title */
body.dark-mode .page-title h5,
body.dark-mode .page-title p {
    color: var(--text-dark) !important;
}

/* Quick Actions */
body.dark-mode .quick-actions {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .quick-actions h5 {
    color: var(--text-dark) !important;
}

/* Settings Card */
body.dark-mode .settings-card {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .settings-card h5 {
    color: var(--text-dark) !important;
    border-bottom-color: var(--border-dark);
}

/* Admin Tables */
body.dark-mode .table,
body.dark-mode .table-custom {
    color: var(--text-dark);
    background-color: var(--card-dark) !important;
}

body.dark-mode .table thead,
body.dark-mode .table-custom thead {
    background-color: #1a1a1a !important;
}

body.dark-mode .table thead th,
body.dark-mode .table-custom thead th {
    background-color: #1a1a1a !important;
    color: var(--text-dark) !important;
    border-color: var(--border-dark) !important;
}

body.dark-mode .table tbody,
body.dark-mode .table-custom tbody {
    background-color: var(--card-dark) !important;
}

body.dark-mode .table tbody tr,
body.dark-mode .table-custom tbody tr {
    background-color: var(--card-dark) !important;
    border-color: var(--border-dark) !important;
}

body.dark-mode .table tbody tr:hover,
body.dark-mode .table-custom tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .table td,
body.dark-mode .table th {
    border-color: var(--border-dark) !important;
    color: var(--text-dark) !important;
    background-color: transparent !important;
}

body.dark-mode .table tbody td,
body.dark-mode .table-custom tbody td {
    background-color: transparent !important;
    color: var(--text-dark) !important;
}

/* Admin Sidebar */
body.dark-mode .sidebar {
    background-color: #1a1a1a !important;
    border-right: 1px solid var(--border-dark);
}

body.dark-mode .sidebar-header h4 {
    color: var(--text-dark);
}

body.dark-mode .sidebar-menu a {
    color: #b5b5b5;
}

body.dark-mode .sidebar-menu a:hover,
body.dark-mode .sidebar-menu a.active {
    background-color: rgba(240, 182, 50, 0.1);
    color: #f0b632;
}

/* Admin Top Navbar */
body.dark-mode .top-navbar {
    background-color: var(--card-dark) !important;
    border-bottom: 1px solid var(--border-dark);
}

/* Admin Main Content */
body.dark-mode .main-content {
    background-color: var(--bg-dark) !important;
}

/* Admin Content Card */
body.dark-mode .content-card {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .content-card h5,
body.dark-mode .content-card h6,
body.dark-mode .content-card p,
body.dark-mode .content-card label {
    color: var(--text-dark) !important;
}

/* Admin Alerts */
body.dark-mode .alert {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .alert-info {
    background-color: rgba(23, 162, 184, 0.1) !important;
    border-color: rgba(23, 162, 184, 0.3);
    color: #5dcceb;
}

body.dark-mode .alert-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    border-color: rgba(40, 167, 69, 0.3);
    color: #6dd88d;
}

body.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

body.dark-mode .alert-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: rgba(220, 53, 69, 0.3);
    color: #f56c7a;
}

/* Admin Avatar */
body.dark-mode .admin-avatar {
    background-color: #f0b632;
    color: #1a1a1a;
}

/* Admin Labels and Text */
body.dark-mode .form-label,
body.dark-mode label {
    color: var(--text-dark) !important;
}

body.dark-mode .text-muted {
    color: #999 !important;
}

/* Admin Car Image Preview */
body.dark-mode .car-image-preview {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

body.dark-mode .gallery-preview-item {
    background-color: var(--card-dark) !important;
    border: 1px solid var(--border-dark);
}

/* Admin Breadcrumb */
body.dark-mode .breadcrumb {
    background-color: transparent;
}

body.dark-mode .breadcrumb-item,
body.dark-mode .breadcrumb-item a {
    color: var(--text-dark);
}

body.dark-mode .breadcrumb-item.active {
    color: #f0b632;
}

/* Admin Badge */
body.dark-mode .badge {
    color: #fff;
}

/* Fix white text on light backgrounds */
body.dark-mode .text-dark {
    color: var(--text-dark) !important;
}

/* Admin Car Details Table */
body.dark-mode .car-specs,
body.dark-mode .pricing-table {
    background-color: var(--card-dark) !important;
}

body.dark-mode .car-specs td,
body.dark-mode .pricing-table td {
    color: var(--text-dark);
    border-color: var(--border-dark);
}

/* Fix all white backgrounds globally in admin */
body.dark-mode .row > div,
body.dark-mode .col-lg-3,
body.dark-mode .col-lg-4,
body.dark-mode .col-lg-6,
body.dark-mode .col-lg-8,
body.dark-mode .col-lg-12,
body.dark-mode .col-md-6,
body.dark-mode .col-md-12 {
    background-color: transparent !important;
}

/* Fix Bootstrap default white backgrounds */
body.dark-mode .container,
body.dark-mode .container-fluid {
    background-color: transparent !important;
}

/* Force all table wrappers and containers to be dark */
body.dark-mode .table-responsive {
    background-color: transparent !important;
}

body.dark-mode .table-wrapper {
    background-color: transparent !important;
}

/* Override inline styles for content-card */
body.dark-mode .content-card[style*="background"] {
    background: var(--card-dark) !important;
}

/* Table striped rows */
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(even) {
    background-color: var(--card-dark) !important;
}

/* Table bordered */
body.dark-mode .table-bordered,
body.dark-mode .table-bordered th,
body.dark-mode .table-bordered td {
    border-color: var(--border-dark) !important;
}

/* Fix card elements in lists */
body.dark-mode .list-group-item {
    background-color: var(--card-dark) !important;
    border-color: var(--border-dark) !important;
    color: var(--text-dark);
}

/* Fix modal backgrounds */
body.dark-mode .modal-content {
    background-color: var(--card-dark) !important;
    color: var(--text-dark);
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: var(--border-dark) !important;
}

body.dark-mode .modal-title {
    color: var(--text-dark) !important;
}

/* Fix pagination */
body.dark-mode .pagination .page-link {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

body.dark-mode .pagination .page-item.active .page-link {
    background-color: #f0b632;
    border-color: #f0b632;
}

/* Fix dropdown menus */
body.dark-mode .dropdown-menu {
    background-color: var(--card-dark) !important;
    border-color: var(--border-dark);
}

body.dark-mode .dropdown-item {
    color: var(--text-dark);
}

body.dark-mode .dropdown-item:hover {
    background-color: rgba(240, 182, 50, 0.1);
}

/* ===============================================
   GALLERY CAROUSEL DARK MODE
   =============================================== */

body.dark-mode #galleryCarousel .carousel-inner {
    background: #000 !important;
}

body.dark-mode #galleryCarousel .carousel-caption {
    background: rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode #galleryCarousel .carousel-caption h5 {
    color: #ffffff !important;
}

body.dark-mode #galleryCarousel .carousel-item > div {
    background: #000 !important;
}

body.dark-mode .gallery-thumbnail {
    background: #000 !important;
    border: none;
}

body.dark-mode .gallery-thumbnail:hover {
    border: none;
}

body.dark-mode #galleryCarousel .carousel-indicators button {
    background-color: #f0b632 !important;
}

body.dark-mode #galleryCarousel .carousel-control-prev,
body.dark-mode #galleryCarousel .carousel-control-next {
    background: rgba(240, 182, 50, 0.8) !important;
}

body.dark-mode #galleryCarousel .carousel-control-prev:hover,
body.dark-mode #galleryCarousel .carousel-control-next:hover {
    background: rgba(240, 182, 50, 1) !important;
}

