/* Booking Date & Time Step Styling */

/* Main Container Layout */
.date-time-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    align-items: flex-start;
}

#booking-date-picker {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border: none !important;
    padding: 0 !important;
}

#time-slots-container {
    flex: 1;
    min-width: 300px;
    padding-top: 10px;
}

/* -------------------------------------------------------------------------- */
/* jQuery UI Datepicker Overrides */
/* -------------------------------------------------------------------------- */

/* Container */
.ui-datepicker {
    width: 100% !important;
    font-family: 'Lato', sans-serif !important;
    background: #fff !important;
    border: none !important;
    padding: 0 !important;
}

/* Header (Month/Year) */
.ui-datepicker-header {
    background: #fff !important;
    border: none !important;
    padding: 10px 0 20px 0 !important;
    display: block !important;
    /* Changed from flex to block to stabilize absolute positioning context */
    position: relative !important;
    text-align: center !important;
    height: 40px !important;
}

.ui-datepicker-title {
    font-family: 'Playfair Display', serif !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: var(--text-dark, #333) !important;
    line-height: 40px !important;
    margin: 0 40px !important;
    /* Ensure space for arrows */
}

/* Navigation Buttons */
.ui-datepicker-prev,
.ui-datepicker-next {
    position: absolute !important;
    top: 50% !important;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer !important;
    border-radius: 50%;
    background: transparent !important;
    border: 1px solid #e0e0e0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
}

.ui-datepicker-prev {
    left: 10px !important;
    right: auto !important;
}

.ui-datepicker-next {
    right: 10px !important;
    left: auto !important;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
    background: var(--sage-green, #6B8E6B) !important;
    border-color: var(--sage-green, #6B8E6B) !important;
}

/* Hide default span text and use icons */
.ui-datepicker-prev span,
.ui-datepicker-next span {
    display: none !important;
}

/* Add custom icons via pseudo-elements */
.ui-datepicker-prev::after {
    content: "‹";
    font-size: 20px;
    line-height: 1;
    color: #666;
    margin-top: -2px;
    /* Visual adjustment */
}

.ui-datepicker-next::after {
    content: "›";
    font-size: 20px;
    line-height: 1;
    color: #666;
    margin-top: -2px;
}

.ui-datepicker-prev:hover::after,
.ui-datepicker-next:hover::after {
    color: #fff;
}


/* Calendar Table */
.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

.ui-datepicker-calendar thead th {
    color: #999 !important;
    font-weight: normal !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    padding-bottom: 15px !important;
}

.ui-datepicker-calendar tbody td {
    padding: 4px !important;
    border: none !important;
    /* Remove default borders */
}

/* Day Cells */
/* Day Cells */
.ui-state-default,
.ui-widget-content .ui-state-default {
    background: transparent !important;
    border: 1px solid transparent !important;
    /* Placeholder for alignment */

    /* Perfect Centering with Flexbox */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    font-weight: normal !important;
    color: #333 !important;
    width: 40px !important;
    height: 40px !important;

    margin: 0 auto !important;
    border-radius: 8px !important;
    /* Rounded Squares */
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    /* Remove link underline */
}

/* Hover State */
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-state-default:hover {
    background: #f0f4f0 !important;
    /* Light sage */
    color: var(--sage-green, #6B8E6B) !important;
    cursor: pointer !important;
}

/* Active / Selected State (User's Choice) */
.ui-datepicker-current-day .ui-state-active,
.ui-state-active,
.ui-widget-content .ui-state-active {
    background: var(--sage-green, #6B8E6B) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid var(--sage-green, #6B8E6B) !important;
    /* Make it pop */
    box-shadow: 0 4px 12px rgba(107, 142, 107, 0.4) !important;
}

/* Today's Date (if distinct from selected) */
.ui-state-highlight,
.ui-widget-content .ui-state-highlight {
    color: var(--sage-green, #6B8E6B) !important;
    border: 1px solid var(--sage-green, #6B8E6B) !important;
    background: transparent !important;
    font-weight: 600 !important;
}

/* Ensure selected today merges styles nicely */
.ui-state-active.ui-state-highlight {
    background: var(--sage-green, #6B8E6B) !important;
    color: #fff !important;
    border-color: var(--sage-green, #6B8E6B) !important;
}

/* Disabled / Unavailable Dates */
.ui-state-disabled,
.ui-state-disabled span,
.ui-state-disabled .ui-state-default {
    cursor: default !important;
    /* Or not-allowed if preferred */
    color: #cccccc !important;
    /* Light gray text */
    background: transparent !important;
    border: none !important;
    opacity: 0.6 !important;
    /* Desaturate/Fade */
    pointer-events: none !important;
}

.ui-datepicker-unselectable .ui-state-default {
    background: #f9f9f9 !important;
    /* Very subtle grey background for unavailable */
    color: #d0d0d0 !important;
}


/* -------------------------------------------------------------------------- */
/* Time Slots Styling */
/* -------------------------------------------------------------------------- */

#time-slots h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-dark, #333);
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.time-slot {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    /* Pill shape */
    padding: 10px 15px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.time-slot small {
    display: none;
    /* Hide therapist name for cleaner pill look, or keep if desired */
}

/* Hover */
.time-slot:hover {
    border-color: var(--sage-green, #6B8E6B);
    color: var(--sage-green, #6B8E6B);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Selected */
.time-slot.selected {
    background: var(--sage-green, #6B8E6B);
    border-color: var(--sage-green, #6B8E6B);
    color: #fff;
    box-shadow: 0 4px 12px rgba(107, 142, 107, 0.3);
}

/* Therapist Dropdown Styling */
#therapist-select {
    width: 100%;
    margin-bottom: 25px;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    background-color: #f9f9f9;
    cursor: pointer;
    color: #555;
}

#therapist-select:focus {
    outline: none;
    border-color: var(--sage-green, #6B8E6B);
    background-color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .date-time-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    #booking-date-picker,
    #time-slots-container {
        width: 100%;
        min-width: 0;
    }

    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Mobile Adjustments */
@media (max-width: 480px) {
    .date-time-container {
        padding: 15px;
    }

    .ui-datepicker-title {
        font-size: 1.2rem !important;
    }

    .ui-state-default,
    .ui-widget-content .ui-state-default {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 14px !important;
    }

    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}