/* =========================================
   DGAME - Perfected Dark Gaming Theme
========================================= */

:root {
    --bg-main: #060714;
    --bg-panel: #101223;
    --bg-card: #15162B;
    
    --border-color: #2A2D5C;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --text-white: #FFFFFF;
    --text-muted: #8E92B2;
    
    --accent-blue: #0062FF;
    --accent-blue-rgb: 0, 98, 255;
    --accent-pink: #FF2A85;
    --accent-pink-rgb: 255, 42, 133;
    --accent-purple: #8A2BE2;
    --accent-purple-rgb: 138, 43, 226;
    --accent-cyan: #00F2FE;
    --accent-cyan-rgb: 0, 242, 254;
    --accent-gold: #FFB800;
    --accent-gold-rgb: 255, 184, 0;
    --accent-teal: #00A896;
    --accent-teal-rgb: 0, 168, 150;
    --accent-orange: #FD7E14;
    --accent-orange-rgb: 253, 126, 20;
}

/* Light Theme Variables - Base color #F0F2F8 */
:root.light-theme,
html.light-theme,
body.light-theme {
    --bg-main: #F0F2F8;
    --bg-panel: #FFFFFF;
    --bg-card: #F8FAFC;
    
    --border-color: #D1D9E6;
    --border-light: rgba(0, 0, 0, 0.06);
    
    --text-white: #1E293B;
    --text-muted: #64748B;
    
    --accent-blue: #2563EB;
    --accent-blue-rgb: 37, 99, 235;
    --accent-pink: #DB2777;
    --accent-pink-rgb: 219, 39, 119;
    --accent-purple: #7C3AED;
    --accent-purple-rgb: 124, 58, 237;
    --accent-cyan: #06B6D4;
    --accent-cyan-rgb: 6, 182, 212;
    --accent-gold: #D4A017;
    --accent-gold-rgb: 212, 160, 23;
    --accent-teal: #0D9488;
    --accent-teal-rgb: 13, 148, 136;
    --accent-orange: #EA580C;
    --accent-orange-rgb: 234, 88, 12;
}

/* Dark Theme Variables (explicit) */
:root.dark-theme,
html.dark-theme,
body.dark-theme {
    --bg-main: #060714;
    --bg-panel: #101223;
    --bg-card: #15162B;
    
    --border-color: #2A2D5C;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --text-white: #FFFFFF;
    --text-muted: #8E92B2;
    
    --accent-blue: #0062FF;
    --accent-blue-rgb: 0, 98, 255;
    --accent-pink: #FF2A85;
    --accent-pink-rgb: 255, 42, 133;
    --accent-purple: #8A2BE2;
    --accent-purple-rgb: 138, 43, 226;
    --accent-cyan: #00F2FE;
    --accent-cyan-rgb: 0, 242, 254;
    --accent-gold: #FFB800;
    --accent-gold-rgb: 255, 184, 0;
    --accent-teal: #00A896;
    --accent-teal-rgb: 0, 168, 150;
    --accent-orange: #FD7E14;
    --accent-orange-rgb: 253, 126, 20;
}

html.dark-theme,
body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

html.light-theme,
body.light-theme {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Center navbar collapse on desktop, full width on mobile */
@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        flex-grow: 1 !important;
    }
    .navbar .navbar-nav {
        align-items: center;
    }
}

/* Utilities */
.text-pink-gradient {
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-cyan-gradient {
    background: linear-gradient(90deg, #00C6FF, #0072FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-muted { color: var(--text-muted) !important; }

/* Panels & Cards */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

/* Navbar */
.navbar {
    background-color: var(--bg-main) !important;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
}
.navbar-brand {
    font-size: 2rem;
    font-weight: 800;
    font-style: italic;
    color: var(--text-white) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}
.nav-pill {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-pill:hover {
    color: var(--text-white) !important;
}
.nav-pill.active {
    background: rgba(0, 98, 255, 0.2);
    color: #4DA3FF !important;
}

/* Nav Icons */
.nav-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1.1rem;
}
.nav-icon-btn:hover { color: var(--text-white); }
.nav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #FF3B30;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-btn {
    background: linear-gradient(135deg, var(--accent-blue), #00C6FF);
    color: #fff;
    border: none;
}

/* Filter Bar */
.filter-bar-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}
.calendar-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.2rem;
}
.date-selector {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}
.date-item {
    min-width: 65px;
    text-align: center;
    padding: 8px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid transparent;
}
.date-item.active {
    background: var(--accent-blue);
    color: #fff;
}
.date-item:not(.active) { color: var(--text-muted); }
.date-item:not(.active):hover { border-color: var(--border-color); }
.date-day { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; }
.date-date { font-size: 0.95rem; font-weight: 700; }

.custom-select-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Hero Section */
.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    margin-bottom: 1rem;
    text-transform: uppercase;
}
.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 450px;
    margin-bottom: 2rem;
    line-height: 1.6;
}
.hero-features {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.h-feature {
    display: flex;
    align-items: center;
    gap: 10px;
}
.h-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.h-icon.gold { background: rgba(255, 184, 0, 0.1); color: var(--accent-gold); border: 1px solid rgba(255, 184, 0, 0.2); }
.h-icon.blue { background: rgba(0, 198, 255, 0.1); color: #00C6FF; border: 1px solid rgba(0, 198, 255, 0.2); }
.h-icon.yellow { background: rgba(253, 126, 20, 0.1); color: var(--accent-orange); border: 1px solid rgba(253, 126, 20, 0.2); }
.h-text h6 { margin: 0; font-size: 0.85rem; font-weight: 700; color: #fff; }
.h-text p { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

/* Room Container */
.rooms-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 40px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.section-header h4 {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-view-all {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.3s;
}
.btn-view-all:hover { color: #fff; border-color: #fff; }

/* Room Cards */
.room-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: 0.3s;
}
.room-card:hover {
    border-color: #4DA3FF;
    box-shadow: 0 0 20px rgba(0, 98, 255, 0.15);
}
.room-img-wrapper {
    position: relative;
    height: 180px;
}
.room-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.room-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
}
.rb {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}
.rb-blue { background: var(--accent-blue); color: #fff; }
.rb-gold { background: var(--accent-gold); color: #000; }
.rb-purple { background: var(--accent-purple); color: #fff; }
.rb-teal { background: var(--accent-teal); color: #fff; }
.rb-orange { background: var(--accent-orange); color: #fff; }

.room-details {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.room-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.room-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.room-specs span { display: flex; align-items: center; gap: 6px; }

.room-action {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.room-price-box p { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.room-price-box h5 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.rp-blue { color: #4DA3FF; }
.rp-purple { color: #D863FF; }
.rp-teal { color: #20C997; }
.rp-orange { color: #FD7E14; }

.btn-detail {
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bd-blue { background: var(--accent-blue); }
.bd-purple { background: var(--accent-purple); }
.bd-teal { background: var(--accent-teal); }
.bd-orange { background: var(--accent-orange); }

/* Footer Features */
.bottom-features {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.bf-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bf-icon {
    font-size: 1.5rem;
}
.bf-icon.blue { color: #0062FF; }
.bf-icon.purple { color: #8A2BE2; }
.bf-icon.teal { color: #00A896; }
.bf-icon.cyan { color: #00F2FE; }
.bf-icon.yellow { color: #FFB800; }
.bf-text h6 { margin: 0; font-size: 0.9rem; font-weight: 700; color: #fff; }
.bf-text p { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

/* ===============================
   ADDITIONAL UTILITY STYLES
   =============================== */

/* Pointer cursor utility */
.pointer, [onclick] { cursor: pointer; }

/* Toast animation */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===============================
   SLOT / FIELD STYLES
   =============================== */

.field-slot-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    user-select: none;
}
.field-slot-item:hover:not(.slot-booked):not(.slot-disabled) {
    border-color: #4DA3FF;
    background: #1A1C40;
}
.slot-booked {
    cursor: not-allowed;
    opacity: 0.55;
    background: #1A1030;
}
.slot-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.field-slot-item-selected {
    border-color: #0062FF !important;
    background: rgba(0,98,255,0.15) !important;
    box-shadow: 0 0 12px rgba(0,98,255,0.25);
}
.field-slot-item-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    z-index: 2;
}

/* Room detail layout (old renderRooms) */
.field-container {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}
.room-detail {
    border-left: 1px solid var(--border-color) !important;
}
.field_slot_btn {
    cursor: pointer;
    transition: 0.2s;
}
.field_slot_btn:hover {
    opacity: 0.85;
}

/* ===============================
   TIME FILTER
   =============================== */

.time-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}
.time-filter-item {
    background: #1E2048;
    border: 1px solid #2A2D5C;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: #8E92B2;
    cursor: pointer;
    text-align: center;
    transition: 0.15s;
}
.time-filter-item:hover {
    border-color: #4DA3FF;
    color: #fff;
}
.time-filter-item.selected {
    background: rgba(0,98,255,0.2);
    border-color: #0062FF;
    color: #4DA3FF;
}
.time-filter-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.time-filter-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.time-filter-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #2A2D5C;
    transition: 0.3s;
    border-radius: 24px;
}
.time-filter-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #8E92B2;
    transition: 0.3s;
    border-radius: 50%;
}
.time-filter-switch input:checked + .time-filter-slider {
    background: #0062FF;
}
.time-filter-switch input:checked + .time-filter-slider::before {
    transform: translateX(20px);
    background: #fff;
}

/* ===============================
   OFF CANVAS CART (DARK THEME)
   =============================== */

#offcanvas-cart {
    background: #0F1128;
    border-left: 1px solid #1E2048;
    color: #fff;
}
#offcanvas-cart .offcanvas-title {
    color: #fff;
    font-weight: 700;
}
#offcanvas-cart .btn-close {
    filter: brightness(0) invert(1);
}
#offcanvas-cart .cart-room-group {
    background: #12142A;
    border: 1px solid #1E2048;
    border-radius: 12px;
    padding: 12px;
}
#offcanvas-cart .cart-field-slot {
    font-size: 0.85rem;
}
#offcanvas-cart .cart-field-slot .text-primary {
    color: #4DA3FF !important;
}

/* ===============================
   DROPDOWN DARK THEME
   =============================== */

.dropdown-menu-dark {
    background: #12142A !important;
    border: 1px solid #1E2048 !important;
    border-radius: 12px !important;
    padding: 6px !important;
}
.dropdown-menu-dark .dropdown-item {
    color: #ccc !important;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.88rem;
    transition: 0.15s;
}
.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(0,98,255,0.15) !important;
    color: #fff !important;
}

/* ===============================
   CALENDAR POPUP
   =============================== */

#field-full-calendar {
    background: #12142A;
    border: 1px solid #1E2048;
    border-radius: 14px;
    padding: 16px;
}
.field-full-calendar-item {
    text-align: center;
    padding: 5px 0;
    font-size: 0.82rem;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.15s;
}
.field-full-calendar-item:hover:not(.date-disabled) {
    background: rgba(0,98,255,0.15);
    color: #4DA3FF;
}
.field-full-calendar-item.today {
    color: #4DA3FF;
    font-weight: 700;
}
.field-full-calendar-item.selected,
.field-full-calendar-item-selected {
    background: #0062FF !important;
    color: #fff !important;
    font-weight: 700;
}
.field-full-calendar-item.weekend {
    color: #FD7E14;
}
.field-full-calendar-item.date-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.calendar-day-header {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #8E92B2;
    text-transform: uppercase;
    padding: 4px 0;
}

/* ===============================
   FORMS (DARK THEME OVERRIDES)
   =============================== */

.form-control {
    background: #1E2048 !important;
    border: 1px solid #2A2D5C !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
}
.form-control:focus {
    border-color: #4DA3FF !important;
    box-shadow: 0 0 0 2px rgba(0,98,255,0.2) !important;
}
.form-control::placeholder {
    color: #6B6F92 !important;
    opacity: 1;
}
.form-label {
    color: #ccc !important;
    font-weight: 600;
    font-size: 0.88rem;
}

/* ===============================
   BOOKING PAGE
   =============================== */

.page-header {
    position: relative;
    background: linear-gradient(135deg, #0A0B1A, #0D0E2A);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
#checkout-rooms .card {
    background: #12142A !important;
    color: #fff !important;
}
#checkout-rooms .card .text-dark {
    color: #fff !important;
}
#checkout-rooms .card .text-muted {
    color: #8E92B2 !important;
}
.bg-light {
    background: #12142A !important;
    border-color: #1E2048 !important;
}

/* ===============================
   RESPONSIVE TWEAKS
   =============================== */

@media (max-width: 767px) {
    .container-fluid.py-5 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .hero-h1 {
        font-size: 2.4rem !important;
    }
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #0A0B1A;
}
::-webkit-scrollbar-thumb {
    background: #2A2D5C;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4DA3FF;
}

/* ===============================
   THEME TOGGLE SLIDER
   =============================== */
.theme-toggle-btn {
    width: 56px;
    height: 28px;
    border-radius: 28px;
    background: var(--border-color);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}
.theme-toggle-btn:hover {
    background: var(--border-light);
}
.theme-toggle-btn .toggle-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}
.theme-toggle-btn .toggle-thumb i {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
}
.theme-toggle-btn .toggle-track {
    position: absolute;
    inset: 3px;
    border-radius: 22px;
    background: transparent;
    transition: background 0.3s ease;
    pointer-events: none;
}
.theme-toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border-color: var(--accent-blue);
}
.theme-toggle-btn.active .toggle-thumb {
    transform: translateX(28px);
}
.theme-toggle-btn.active .toggle-thumb i.fa-sun {
    color: var(--accent-gold);
    transform: rotate(180deg);
}
.theme-toggle-btn.active .toggle-thumb i.fa-moon {
    color: var(--text-white);
    transform: rotate(0deg);
}
.theme-toggle-btn .toggle-thumb i.fa-sun {
    display: none;
}
.theme-toggle-btn.active .toggle-thumb i.fa-sun {
    display: block;
}
.theme-toggle-btn .toggle-thumb i.fa-moon {
    display: block;
}
.theme-toggle-btn.active .toggle-thumb i.fa-moon {
    display: none;
}

/* Mobile responsive for theme toggle */
@media (max-width: 767px) {
    .theme-toggle-btn {
        width: 50px;
        height: 26px;
    }
    .theme-toggle-btn .toggle-thumb {
        width: 20px;
        height: 20px;
    }
    .theme-toggle-btn.active .toggle-thumb {
        transform: translateX(24px);
    }
}