/* Core Global Theme Styles */
body {
    background-color: var(--lodgehog-bg) !important;
    color: var(--lodgehog-bg-text) !important;
}

:root {
    --bs-body-color: var(--lodgehog-bg-text);
    --bs-body-bg: var(--lodgehog-bg);
    --bs-secondary-color: var(--lodgehog-bg-text-muted);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--lodgehog-bg-text) !important;
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6,
.calendar-popover h1,
.calendar-popover h2,
.calendar-popover h3,
.calendar-popover h4,
.calendar-popover h5,
.calendar-popover h6,
.calendar-modal h1,
.calendar-modal h2,
.calendar-modal h3,
.calendar-modal h4,
.calendar-modal h5,
.calendar-modal h6,
.rate-plan-card h1,
.rate-plan-card h2,
.rate-plan-card h3,
.rate-plan-card h4,
.rate-plan-card h5,
.rate-plan-card h6,
.hero-text h1,
.hero-text h2,
.hero-text h3,
.hero-text h4,
.hero-text h5,
.hero-text h6 {
    color: inherit !important;
}

.text-muted {
    color: var(--lodgehog-bg-text-muted) !important;
}

.calendar-popover .text-muted,
.calendar-modal .text-muted {
    color: #64748b !important;
}

.text-dark {
    color: var(--lodgehog-bg-text) !important;
}

.category-title {
    color: var(--lodgehog-bg-text) !important;
}

/* ── Header & Navigation ── */
.top-nav {
    background-color: var(--lodgehog-bg) !important;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15) !important;
}

.top-nav .tn-left li {
    color: var(--lodgehog-bg-text) !important;
}

.top-nav .tn-left li:after {
    background: rgba(128, 128, 128, 0.2) !important;
}

.top-nav .tn-left li i {
    color: var(--lodgehog-primary) !important;
}

.top-nav .tn-right .bk-btn {
    background: var(--lodgehog-primary) !important;
    color: var(--lodgehog-primary-text, #fff) !important;
    transition: all 0.3s ease !important;
}

.top-nav .tn-right .bk-btn:hover {
    background: var(--lodgehog-primary-dark) !important;
    color: var(--lodgehog-primary-text, #fff) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.menu-item .logo a {
    color: var(--lodgehog-bg-text) !important;
    font-weight: 700 !important;
}

.nav-menu .mainmenu li a {
    color: var(--lodgehog-bg-text) !important;
}

.nav-menu .mainmenu li a:after {
    background: var(--lodgehog-primary) !important;
}

.nav-menu .mainmenu li.active a:after,
.nav-menu .mainmenu li:hover a:after {
    opacity: 1 !important;
}

/* Global Background Overrides for Dark Mode */
[data-lodgehog-theme="dark"] .bg-white,
[data-lodgehog-theme="dark"] .card {
    background-color: color-mix(in srgb, var(--lodgehog-bg) 92%, white) !important;
}

[data-lodgehog-theme="dark"] .bg-light,
[data-lodgehog-theme="dark"] .bg-light-subtle {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-lodgehog-theme="dark"] .bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.15) !important;
}

[data-lodgehog-theme="dark"] .bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-lodgehog-theme="dark"] .shadow-sm,
[data-lodgehog-theme="dark"] .shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

[data-lodgehog-theme="dark"] .border-0 {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ── Dark Theme Overrides ── */
[data-lodgehog-theme="dark"] {
    --ibw-input-bg: rgba(255, 255, 255, 0.12);
    --ibw-input-border: rgba(255, 255, 255, 0.18);
}

[data-lodgehog-theme="dark"] .glass-header {
    background: rgba(0, 0, 0, 0.35) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

[data-lodgehog-theme="dark"] .glass-header .premium-control,
[data-lodgehog-theme="dark"] .index-booking-widget .premium-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .glass-header .text-dark,
[data-lodgehog-theme="dark"] .glass-header .text-muted,
[data-lodgehog-theme="dark"] .index-booking-widget .text-dark,
[data-lodgehog-theme="dark"] .index-booking-widget .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-lodgehog-theme="dark"] .glass-header .premium-control *,
[data-lodgehog-theme="dark"] .glass-header .premium-control span,
[data-lodgehog-theme="dark"] .glass-header .premium-control svg,
[data-lodgehog-theme="dark"] .index-booking-widget .premium-control *,
[data-lodgehog-theme="dark"] .index-booking-widget .premium-control span,
[data-lodgehog-theme="dark"] .index-booking-widget .premium-control svg {
    color: rgba(255, 255, 255, 0.9) !important;
}

[data-lodgehog-theme="dark"] .glass-header .occupancy-picker-container .room-select,
[data-lodgehog-theme="dark"] .glass-header .room-guest-picker-container .room-select,
[data-lodgehog-theme="dark"] .index-booking-widget .room-guest-picker-container .room-select {
    color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .text-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-lodgehog-theme="dark"] .card,
[data-lodgehog-theme="dark"] .premium-card {
    background: color-mix(in srgb, var(--lodgehog-bg) 88%, white) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--lodgehog-bg-text) !important;
}

[data-lodgehog-theme="dark"] .rate-plan-card {
    background: color-mix(in srgb, var(--lodgehog-bg) 80%, white) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-lodgehog-theme="dark"] .footer-section {
    background: rgba(0, 0, 0, 0.4) !important;
}

[data-lodgehog-theme="dark"] .footer-section .copyright-option {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* Index Booking Widget Container Overrides */
[data-lodgehog-theme="dark"] .index-booking-widget {
    background: color-mix(in srgb, var(--lodgehog-bg) 95%, white) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
}

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

[data-lodgehog-theme="dark"] .ibw-chip {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--lodgehog-bg-text) !important;
}

/* Dark Mode Header Adjustments */
[data-lodgehog-theme="dark"] .top-nav {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

[data-lodgehog-theme="dark"] .menu-item {
    background-color: transparent !important;
}

/* Calendar */
[data-lodgehog-theme="dark"] .calendar-popover,
[data-lodgehog-theme="dark"] .calendar-modal {
    background: color-mix(in srgb, var(--lodgehog-bg) 92%, white) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

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

[data-lodgehog-theme="dark"] .btn-close-custom {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--lodgehog-bg-text) !important;
}

[data-lodgehog-theme="dark"] .btn-close-custom:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

[data-lodgehog-theme="dark"] .rdp-root {
    color: var(--lodgehog-bg-text) !important;
    --rdp-accent-background-color: color-mix(in srgb, var(--lodgehog-primary) 40%, transparent) !important;
    --rdp-range_middle-background-color: color-mix(in srgb, var(--lodgehog-primary) 40%, transparent) !important;
    --rdp-range_middle-color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .rdp-nav button,
[data-lodgehog-theme="dark"] .rdp-month_caption,
[data-lodgehog-theme="dark"] .rdp-weekday {
    color: var(--lodgehog-bg-text) !important;
}

[data-lodgehog-theme="dark"] .rdp-day:not(.rdp-range_start):not(.rdp-range_end):not(.rdp-range_middle):not(.rdp-selected) .rdp-day_button {
    color: var(--lodgehog-bg-text) !important;
}

[data-lodgehog-theme="dark"] .rdp-day:not(.rdp-range_start):not(.rdp-range_end):not(.rdp-range_middle) .rdp-day_button:hover:not([disabled]) {
    background-color: color-mix(in srgb, var(--lodgehog-primary) 40%, transparent) !important;
    color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .rdp-range_start .rdp-day_button,
[data-lodgehog-theme="dark"] .rdp-range_end .rdp-day_button {
    color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .rdp-range_middle .rdp-day_button {
    background-color: transparent !important;
    color: #ffffff !important;
}

[data-lodgehog-theme="dark"] .rdp-day:not(.rdp-range_start):not(.rdp-range_end):not(.rdp-range_middle) .day-price {
    color: var(--lodgehog-bg-text-muted) !important;
}

[data-lodgehog-theme="dark"] .rdp-range_middle .day-price,
[data-lodgehog-theme="dark"] .rdp-range_start .day-price,
[data-lodgehog-theme="dark"] .rdp-range_end .day-price {
    color: rgba(255, 255, 255, 0.75) !important;
}

[data-lodgehog-theme="dark"] .booked-full {
    background-color: rgba(239, 68, 68, 0.25) !important;
}

[data-lodgehog-theme="dark"] .booked-full .day-number {
    color: rgba(255, 130, 130, 0.9) !important;
}

[data-lodgehog-theme="dark"] .booked-start {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 50%, transparent 50.1%) !important;
}

[data-lodgehog-theme="dark"] .booked-end {
    background: linear-gradient(135deg, transparent 50%, rgba(239, 68, 68, 0.25) 50.1%) !important;
}

[data-lodgehog-theme="dark"] .booked-start .day-number,
[data-lodgehog-theme="dark"] .booked-end .day-number {
    color: rgba(255, 130, 130, 0.9) !important;
}

[data-lodgehog-theme="dark"] .calendar-modal h2,
[data-lodgehog-theme="dark"] .calendar-modal h3,
[data-lodgehog-theme="dark"] .calendar-modal h4,
[data-lodgehog-theme="dark"] .calendar-modal h5,
[data-lodgehog-theme="dark"] .calendar-modal h6 {
    color: var(--lodgehog-bg-text) !important;
}

/* Room Guest Picker */
[data-lodgehog-theme="dark"] .room-guest-picker-container>div:not(.room-select):not(.premium-control) {
    background: color-mix(in srgb, var(--lodgehog-bg) 92%, white) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container [style*="fafbfc"],
[data-lodgehog-theme="dark"] .room-guest-picker-container [style*="f8fafc"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container [style*="f1f5f9"] {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container span[style*="334155"],
[data-lodgehog-theme="dark"] .room-guest-picker-container span[style*="0f172a"],
[data-lodgehog-theme="dark"] .room-guest-picker-container span[style*="475569"],
[data-lodgehog-theme="dark"] .room-guest-picker-container span[style*="64748b"] {
    color: var(--lodgehog-bg-text) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container svg {
    color: var(--lodgehog-bg-text-muted) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container button[style*="cbd5e1"] {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--lodgehog-bg-text-muted) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container select {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--lodgehog-bg-text) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container button[disabled] {
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.25) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container [style*="primary-subtle"],
[data-lodgehog-theme="dark"] .room-guest-picker-container [style*="lodgehog-primary-subtle"] {
    background: rgba(255, 255, 255, 0.1) !important;
}

[data-lodgehog-theme="dark"] .room-guest-picker-container>div:not(.room-select):not(.premium-control) span,
[data-lodgehog-theme="dark"] .room-guest-picker-container>div:not(.room-select):not(.premium-control) div[style*="color"] {
    color: var(--lodgehog-bg-text) !important;
}

/* Mobile & Misc */
[data-lodgehog-theme="dark"] .mobile-cart-items-panel .bg-light,
[data-lodgehog-theme="dark"] .mobile-cart-items-panel .bg-light-subtle {
    background: rgba(255, 255, 255, 0.06) !important;
}

[data-lodgehog-theme="dark"] .bg-primary-subtle {
    background: color-mix(in srgb, var(--lodgehog-primary) 15%, transparent) !important;
}

[data-lodgehog-theme="dark"] .add-room-btn:disabled,
[data-lodgehog-theme="dark"] .add-room-btn[disabled] {
    background-color: rgba(128, 128, 128, 0.25) !important;
    border-color: rgba(128, 128, 128, 0.25) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    opacity: 1 !important;
}

/* Guest Info Form */
[data-lodgehog-theme="dark"] .guest-info-form .bg-white {
    background-color: transparent !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .bg-light {
    background-color: rgba(128, 128, 128, 0.08) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .border-white {
    border-color: rgba(128, 128, 128, 0.15) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .form-control,
[data-lodgehog-theme="dark"] .guest-info-form .form-select,
[data-lodgehog-theme="dark"] .guest-info-form .input-group-text {
    color: var(--bs-body-color) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .form-control::placeholder {
    color: var(--lodgehog-bg-text-muted) !important;
    opacity: 0.6 !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .form-control:focus,
[data-lodgehog-theme="dark"] .guest-info-form .form-select:focus {
    background-color: rgba(128, 128, 128, 0.12) !important;
    border-color: var(--lodgehog-primary) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .iti__country-list {
    background-color: color-mix(in srgb, var(--lodgehog-bg) 95%, white) !important;
    color: var(--bs-body-color) !important;
    border-color: rgba(128, 128, 128, 0.2) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .iti__country.iti__highlight,
[data-lodgehog-theme="dark"] .guest-info-form .iti__country:hover {
    background-color: rgba(128, 128, 128, 0.15) !important;
}

[data-lodgehog-theme="dark"] .guest-info-form .iti__divider {
    border-bottom-color: rgba(128, 128, 128, 0.2) !important;
}

.tooltip-inner {
    color: #ffffff !important;
}

/* ── Pill Navigation ── */
:root {
    /* Fallback variables for internal PMS pages where dynamic config might be missing */
    --lodgehog-primary: #16a34a;
    --lodgehog-primary-rgb: 22, 163, 74;
    --lodgehog-bg-text-muted: #64748b;
}

.glass-pills .nav-link {
    color: var(--lodgehog-bg-text-muted, #64748b) !important;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
}

[data-lodgehog-theme="dark"] .glass-pills .nav-link {
    background: rgba(255, 255, 255, 0.05);
}

.glass-pills .nav-link:hover {
    color: var(--lodgehog-primary) !important;
    background: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.08);
    border-color: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.15);
}

.glass-pills .nav-link.active {
    color: #fff !important;
    background: var(--lodgehog-primary) !important;
    box-shadow: 0 4px 12px rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.25);
    border-color: var(--lodgehog-primary);
}

.glass-pills .nav-link i {
    font-size: 1.1rem;
}

.more-pill-indicator {
    background: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.1);
    color: var(--lodgehog-primary) !important;
    border: 1px solid rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.2);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.more-pill-indicator:hover {
    background: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.15);
    border-color: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: var(--lodgehog-primary) !important;
}

[data-lodgehog-theme="dark"] .more-pill-indicator {
    background: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.2);
    border-color: rgba(var(--lodgehog-primary-rgb, 22, 163, 74), 0.4);
}

.pill-nav-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pill-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
}

.pill-nav-scroll::-webkit-scrollbar {
    display: none;
}

.more-pill-indicator.visible {
    display: flex;
}

/* ── Mobile Compact View ── */
@media (max-width: 576px) {
    .glass-pills .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .glass-pills .nav-link i {
        font-size: 1rem;
        margin-right: 0.35rem !important;
    }

    .more-pill-indicator {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        border-radius: 8px !important;
    }

    .pill-nav-container {
        gap: 0.5rem;
    }
}