/* Custom Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-select-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10000 !important;
    margin-top: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    background-color: #0f172a !important; /* Solid Slate 900 prevents see-through bleeding */
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0; /* Slate 200 */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.custom-select-options.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-select-option {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.custom-select-option.selected {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8; /* Indigo 400 */
    font-weight: 600;
}

.custom-select-trigger svg {
    transition: transform 0.2s ease;
}

.custom-select-trigger.open svg {
    transform: rotate(180deg);
}

/* Light Theme Overrides (Scoped to main content only; keeping sidebar dark) */
body {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Base properties for main-content in Light Mode */
body.theme-light .main-content {
    background-color: #f8fafc !important; /* Slate 50 */
    color: #334155 !important; /* Slate 700 */
}

/* Background overrides */
body.theme-light .main-content.bg-slate-900,
body.theme-light .main-content .bg-slate-900 {
    background-color: #f8fafc !important;
}
body.theme-light .main-content.bg-\[\#020617\],
body.theme-light .main-content .bg-\[\#020617\] {
    background-color: #f1f5f9 !important; /* Slate 100 */
}
body.theme-light .main-content.bg-slate-900,
body.theme-light .main-content .bg-slate-900 {
    background-color: #f8fafc !important;
}
body.theme-light .main-content.bg-\[\#0f172a\],
body.theme-light .main-content .bg-\[\#0f172a\],
body.theme-light .main-content .bg-\[\#0f172a\]\/95,
body.theme-light .main-content .bg-\[\#0f172a\]\/90 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .main-content .bg-\[\#0f172a\]\/50 {
    background-color: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .main-content .bg-black\/20 {
    background-color: #ffffff !important;
}
body.theme-light .main-content .bg-black\/30 {
    background-color: #f8fafc !important;
}
body.theme-light .main-content .bg-white\/5 {
    background-color: #f1f5f9 !important;
}
body.theme-light .main-content .bg-white\/10 {
    background-color: #e2e8f0 !important;
}
body.theme-light .main-content .bg-white\/\[0\.02\],
body.theme-light .main-content .bg-white\/\[0\.03\] {
    background-color: #f8fafc !important;
}
body.theme-light .main-content .bg-\[\#1e293b\] {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .main-content .bg-slate-800 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Borders */
body.theme-light .main-content .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}
body.theme-light .main-content .border-white\/10 {
    border-color: #e2e8f0 !important;
}
body.theme-light .main-content .border-slate-700 {
    border-color: #cbd5e1 !important;
}
body.theme-light .main-content .border-slate-800 {
    border-color: #cbd5e1 !important;
}

/* Text colors */
body.theme-light .main-content .text-white {
    color: #0f172a !important;
}
body.theme-light .main-content .text-gray-100 {
    color: #334155 !important;
}
body.theme-light .main-content .text-slate-100 {
    color: #0f172a !important;
}
body.theme-light .main-content .text-slate-200 {
    color: #1e293b !important;
}
body.theme-light .main-content .text-slate-300 {
    color: #475569 !important;
}
body.theme-light .main-content .text-slate-400 {
    color: #64748b !important;
}
body.theme-light .main-content .text-slate-500 {
    color: #94a3b8 !important;
}
body.theme-light .main-content .text-gray-400 {
    color: #64748b !important;
}
body.theme-light .main-content .text-gray-300 {
    color: #475569 !important;
}

/* Active states for UI widgets and badges (non-sidebar) */
body.theme-light .main-content .text-white.bg-blue-500\/10 {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    border-color: #bfdbfe !important;
}
body.theme-light .main-content .text-white.bg-purple-500\/10 {
    background-color: #faf5ff !important;
    color: #9333ea !important;
    border-color: #e9d5ff !important;
}
body.theme-light .main-content .text-purple-400 {
    color: #7c3aed !important;
}
body.theme-light .main-content .text-blue-400 {
    color: #2563eb !important;
}
body.theme-light .main-content .text-indigo-400 {
    color: #4f46e5 !important;
}
body.theme-light .main-content .text-emerald-400 {
    color: #059669 !important;
}
body.theme-light .main-content .text-orange-400 {
    color: #ea580c !important;
}
body.theme-light .main-content .text-pink-400 {
    color: #db2777 !important;
}

/* Hover effects inside main content */
body.theme-light .main-content .hover\:text-slate-100:hover {
    color: #0f172a !important;
}
body.theme-light .main-content .hover\:bg-white\/5:hover {
    background-color: #f1f5f9 !important;
}
body.theme-light .main-content .hover\:bg-white\/10:hover {
    background-color: #e2e8f0 !important;
}
body.theme-light .main-content .group-hover\:text-slate-300 {
    color: #64748b !important;
}
body.theme-light .main-content .hover\:text-white:hover {
    color: #0f172a !important;
}

/* Ambient lights - adjust for light mode */
body.theme-light .pointer-events-none div {
    opacity: 0.3 !important;
}

/* Form input fields - focus states and inputs */
body.theme-light .main-content input[type="text"],
body.theme-light .main-content input[type="number"],
body.theme-light .main-content input[type="email"],
body.theme-light .main-content input[type="password"],
body.theme-light .main-content input[type="search"],
body.theme-light .main-content input[type="date"],
body.theme-light .main-content input[type="time"],
body.theme-light .main-content input[type="tel"],
body.theme-light .main-content textarea {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Native calendar/clock picker styling for both themes */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    cursor: pointer;
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.85;
    filter: invert(0.85);
    padding: 4px;
    border-radius: 6px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

body.theme-light input[type="date"],
body.theme-light input[type="time"],
body.theme-light input[type="datetime-local"] {
    color-scheme: light !important;
}

body.theme-light input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-light input[type="time"]::-webkit-calendar-picker-indicator,
body.theme-light input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none !important;
    opacity: 0.75 !important;
}

body.theme-light input[type="date"]::-webkit-calendar-picker-indicator:hover,
body.theme-light input[type="time"]::-webkit-calendar-picker-indicator:hover,
body.theme-light input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1 !important;
}

body.theme-light .main-content input::placeholder,
body.theme-light .main-content textarea::placeholder {
    color: #94a3b8 !important;
}

/* Custom Guest Details fields (.field-box and .input-reset) in Light Mode */
body.theme-light .main-content .field-box {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}
body.theme-light .main-content .field-box:focus-within {
    border-color: #8b5cf6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1) !important;
}
body.theme-light .main-content .input-reset {
    color: #0f172a !important;
}
body.theme-light .main-content .input-reset::placeholder {
    color: #94a3b8 !important;
}
body.theme-light select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Custom selects in Light mode */
body.theme-light .main-content .custom-select-trigger {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.theme-light .main-content .custom-select-options {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body.theme-light .main-content .custom-select-option {
    color: #334155;
}

body.theme-light .main-content .custom-select-option:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

body.theme-light .main-content .custom-select-option.selected {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5; /* Indigo 600 */
}

/* Tables, headers, cells */
body.theme-light .main-content th {
    color: #475569 !important;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-light .main-content td {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.theme-light .main-content tr:hover {
    background-color: #f8fafc !important;
}

/* Badges and tags styling */
body.theme-light .main-content .bg-green-500\/10 {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
}

body.theme-light .main-content .bg-yellow-500\/10 {
    background-color: #fef9c3 !important;
    color: #a16207 !important;
}

body.theme-light .main-content .bg-red-500\/10 {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

body.theme-light .main-content .bg-blue-500\/10 {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

body.theme-light .main-content .bg-purple-500\/10 {
    background-color: #faf5ff !important;
    color: #6d28d9 !important;
}

/* Modals */
body.theme-light .main-content [x-show="isOpen"],
body.theme-light .main-content [x-show="showModal"],
body.theme-light .main-content .modal-container,
body.theme-light [x-show="isOpen"],
body.theme-light [x-show="showModal"],
body.theme-light .modal-container {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

/* Theme Toggle Button styles */
.theme-toggle-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    color: #fbbf24; /* Amber-400 */
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

body.theme-light .theme-toggle-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #475569; /* Slate-600 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.theme-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.5s ease;
}

.theme-toggle-btn:hover svg {
    transform: rotate(45deg);
}

/* Flatpickr calendar styling & light theme overrides */
.flatpickr-calendar {
    font-family: 'Inter', sans-serif !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2) !important;
}

body.theme-light .flatpickr-calendar {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05) !important;
    color: #0f172a !important;
}

body.theme-light .flatpickr-months {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.theme-light .flatpickr-current-month,
body.theme-light .flatpickr-current-month .cur-month,
body.theme-light .flatpickr-current-month input.cur-year {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.theme-light .flatpickr-monthDropdown-months {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.theme-light .flatpickr-prev-month,
body.theme-light .flatpickr-next-month {
    color: #64748b !important;
}

body.theme-light .flatpickr-prev-month svg,
body.theme-light .flatpickr-next-month svg {
    fill: #475569 !important;
}

body.theme-light .flatpickr-prev-month:hover svg,
body.theme-light .flatpickr-next-month:hover svg {
    fill: #4f46e5 !important;
}

body.theme-light span.flatpickr-weekday {
    color: #64748b !important;
    background: #ffffff !important;
    font-weight: 600 !important;
}

body.theme-light .flatpickr-day {
    color: #1e293b !important;
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
}

body.theme-light .flatpickr-day:hover {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.theme-light .flatpickr-day.today {
    border-color: #4f46e5 !important;
    color: #4f46e5 !important;
    background: transparent !important;
    font-weight: 700 !important;
}

body.theme-light .flatpickr-day.selected,
body.theme-light .flatpickr-day.selected:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

body.theme-light .flatpickr-day.prevMonthDay,
body.theme-light .flatpickr-day.nextMonthDay,
body.theme-light .flatpickr-day.flatpickr-disabled,
body.theme-light .flatpickr-day.flatpickr-disabled:hover {
    color: #cbd5e1 !important;
    background: transparent !important;
}

body.theme-light .flatpickr-calendar.hasTime.noCalendar {
    background: #ffffff !important;
}

body.theme-light .flatpickr-time {
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
}

body.theme-light .flatpickr-time input {
    color: #0f172a !important;
    background: #f8fafc !important;
}

body.theme-light .flatpickr-time .flatpickr-time-separator {
    color: #0f172a !important;
}

body.theme-light .flatpickr-time .flatpickr-am-pm {
    color: #0f172a !important;
    background: #f8fafc !important;
}

/* Dark mode Flatpickr enhancements */
.flatpickr-calendar:not(.theme-light) {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.flatpickr-calendar:not(.theme-light) .flatpickr-day.selected,
.flatpickr-calendar:not(.theme-light) .flatpickr-day.selected:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
}

.flatpickr-calendar:not(.theme-light) .flatpickr-day.today {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

.flatpickr-calendar:not(.theme-light) .flatpickr-day:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Custom Checkbox overrides in Light Theme */
body.theme-light .main-content .custom-checkbox {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

body.theme-light .main-content .custom-checkbox:checked {
    background-color: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
}

body.theme-light .main-content .custom-checkbox::before {
    box-shadow: inset 1em 1em #ffffff !important;
}

/* Ensure package select buttons have correct brand colors on hover/active/focus in light theme */
body.theme-light .main-content .group:hover a.bg-white\/5,
body.theme-light .main-content a.bg-white\/5:hover,
body.theme-light .main-content .group:hover a.bg-slate-800,
body.theme-light .main-content a.bg-slate-800:hover,
body.theme-light .main-content .group:hover a[href*="/create"],
body.theme-light .main-content a[href*="/create"]:hover,
body.theme-light .main-content .group:active a.bg-white\/5,
body.theme-light .main-content a.bg-white\/5:active,
body.theme-light .main-content .group:active a.bg-slate-800,
body.theme-light .main-content a.bg-slate-800:active,
body.theme-light .main-content .group:active a[href*="/create"],
body.theme-light .main-content a[href*="/create"]:active,
body.theme-light .main-content .group:focus-within a.bg-white\/5,
body.theme-light .main-content a.bg-white\/5:focus,
body.theme-light .main-content .group:focus-within a.bg-slate-800,
body.theme-light .main-content a.bg-slate-800:focus,
body.theme-light .main-content .group:focus-within a[href*="/create"],
body.theme-light .main-content a[href*="/create"]:focus {
    background-color: #8b5cf6 !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

/* Ensure input elements inside .field-box do not have internal borders and background in light mode */
body.theme-light .main-content input.input-reset,
body.theme-light .main-content select.input-reset,
body.theme-light .main-content textarea.input-reset,
body.theme-light .main-content .field-box input,
body.theme-light .main-content .field-box select,
body.theme-light .main-content .field-box textarea {
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Ensure custom select container has proper z-index and open dropdowns stack above all other elements */
.custom-select-container {
    position: relative;
    z-index: 10;
}

.custom-select-container.open-select,
.custom-select-container:has(.custom-select-options.open) {
    z-index: 9999 !important;
}

/* Elevate parent cards/forms/filter-bars so dropdown menu never renders under subsequent siblings */
.custom-select-elevated-parent,
*:has(> .custom-select-container.open-select),
*:has(.custom-select-options.open) {
    position: relative !important;
    z-index: 50 !important;
}

/* Peer checked state overrides for checkboxes, radios and tabs in Light Mode */
body.theme-light .main-content .peer:checked + .peer-checked\:bg-purple-600,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-purple-600 {
    background-color: #8b5cf6 !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3), 0 4px 6px -4px rgba(139, 92, 246, 0.3) !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:bg-purple-600 svg,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-purple-600 svg {
    color: #ffffff !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:text-white,
body.theme-light .main-content .peer:checked ~ .peer-checked\:text-white {
    color: #ffffff !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:border-purple-500,
body.theme-light .main-content .peer:checked ~ .peer-checked\:border-purple-500 {
    border-color: #7c3aed !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:bg-indigo-500,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-indigo-500 {
    background-color: #6366f1 !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:border-indigo-500,
body.theme-light .main-content .peer:checked ~ .peer-checked\:border-indigo-500 {
    border-color: #4f46e5 !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:bg-indigo-600,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-indigo-600 {
    background-color: #4f46e5 !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:border-indigo-600,
body.theme-light .main-content .peer:checked ~ .peer-checked\:border-indigo-600 {
    border-color: #4338ca !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:bg-emerald-500,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-emerald-500 {
    background-color: #10b981 !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:border-emerald-500,
body.theme-light .main-content .peer:checked ~ .peer-checked\:border-emerald-500 {
    border-color: #059669 !important;
}

body.theme-light .main-content .peer:checked + .peer-checked\:bg-slate-800,
body.theme-light .main-content .peer:checked ~ .peer-checked\:bg-slate-800 {
    background-color: #f1f5f9 !important;
}

/* Unchecked state hover styles for service type buttons in Light Mode */
body.theme-light .main-content .group:hover .peer:not(:checked) + .group-hover\:bg-white\/10 {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}


