/* General Calendar Styling */
#guesty-booking-calendar {
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
    font-family: Arial, sans-serif;
    color: #111111; /* Text color */
}

#calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#calendar-controls button {
    background-color: #CBB08F; /* Secondary color */
    color: #FFFFFF; /* White text */
    border: 1px solid #CBB08F;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

#calendar-controls button:hover {
    background-color: #C29C74; /* Primary color */
}

#calendar-controls button:disabled {
    background-color: #F3EDE6; /* Same as .calendar-cell.past */
    color: #999999;
    border: 1px solid #CBB08F;
    cursor: not-allowed;
}

#current-month {
    font-size: 18px;
    font-weight: bold;
    color: #111111; /* Text color */
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    min-width: 0; /* Prevent overflow */
}

.calendar-cell {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 48px; /* Set a fixed height, adjust as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid transparent; /* Default transparent border */
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.calendar-cell .day-number {
    font-weight: bold;
    margin-bottom: 2px;
}

.calendar-cell .calendar-price {
    font-size: 11px;
    color: #666;
    margin-bottom: 1px;
}

.calendar-cell .min-nights {
    font-size: 9px;
    color: inherit; /* Inherit the same color as the parent cell text */
    font-weight: bold;
    background: rgba(194, 156, 116, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
    white-space: nowrap;
}

.calendar-cell.has-min-nights {
    border-left: 3px solid #C29C74;
}

.calendar-cell.has-min-nights.available {
    background: linear-gradient(135deg, #CCFFCC 0%, #E8F5E8 100%);
}

/* Selected Range - MUST override has-min-nights gradient */
.calendar-cell.selected-range,
.calendar-cell.available.selected-range,
.calendar-cell.has-min-nights.available.selected-range {
    background: #B3D9FF !important; /* Light blue for range - override gradient */
    color: #111111 !important; /* Dark text color */
    border: 1px solid #0073AA !important; /* Blue border */
}

/* Past Dates */
.calendar-cell.past {
    background-color: #F3EDE6; /* Accent color */
    color: #999999;
    cursor: not-allowed;
    border: 1px solid #D4C5B5; /* Darker beige border */
}

/* Booked Dates */
.calendar-cell.booked {
    background-color: #FFCCCC; /* Light red */
    color: #666666; /* Dark gray text instead of white */
    cursor: not-allowed;
    border: 1px solid #FF9999; /* Darker red border */
}

/* Unavailable Dates */
.calendar-cell.unavailable {
    background-color: #FFE6E6; /* Pale red */
    color: #666666; /* Dark gray text instead of light gray */
    cursor: not-allowed;
    border: 1px solid #FFCCCC; /* Darker pink border */
}

/* Available Dates */
.calendar-cell.available {
    background-color: #CCFFCC; /* Light green */
    color: #111111; /* Text color */
    cursor: pointer;
    border: 1px solid #99FF99; /* Darker green border */
}

/* Empty Cells */
.calendar-cell.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

/* Selected Start Date (higher specificity to override range styling) */
.calendar-cell.selected-range.selected-start,
.calendar-cell.selected-start,
.calendar-cell.has-min-nights.available.selected-start,
.calendar-cell.has-min-nights.available.selected-range.selected-start {
    background: #0073AA !important; /* Bold blue background - override gradient */
    color: #FFFFFF !important; /* White text for contrast on dark blue */
    font-weight: bold !important;
    border: 2px solid #005F8D !important; /* Darker blue border */
}

/* Selected End Date (higher specificity to override range styling) */
.calendar-cell.selected-range.selected-end,
.calendar-cell.selected-end,
.calendar-cell.has-min-nights.available.selected-end,
.calendar-cell.has-min-nights.available.selected-range.selected-end {
    background: #0073AA !important; /* Same blue background as start - override gradient */
    color: #FFFFFF !important; /* White text for contrast on dark blue */
    font-weight: bold !important;
    border: 2px solid #005F8D !important; /* Darker blue border */
}

/* Book Now Button */
#book-now {
    background-color: #C29C74; /* Primary color */
    color: #FFFFFF; /* White text */
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

#book-now:hover {
    background-color: #CBB08F; /* Secondary color */
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top: 2px solid #C29C74;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

/* Centered Loading Spinner for Quote */
#quote-details .loading-spinner {
    display: block;
    margin: 20px auto;
    width: 24px;
    height: 24px;
    border: 3px solid #ffffff;
    border-top: 3px solid #C29C74; /* Primary color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Force removal of any border from the days-of-the-week header row */
.guesty-calendar-days-row {
    border: none !important;
}

/* Half Day (Departure Day) Cell */
.calendar-cell.departure-day-half {
    background-color: #FFF7CC; /* Unique yellow for half day */
    color: #B8860B; /* Dark gold text */
    border: 2px dashed #FFD700; /* Gold border */
    cursor: pointer;
    position: relative;
}

/* Selected Half Day (Departure Day) in Range */
.calendar-cell.departure-day-half.selected-halfday,
.calendar-cell.departure-day-half.selected-range {
    background-color: #B3D9FF; /* Same as .selected-range */
    color: #111111;
    border: 1px solid #0073AA;
}

/* Past Half Day (Departure Day) Cell - match .past */
.calendar-cell.past.departure-day-half {
    background-color: #F3EDE6 !important; /* Same as .past */
    color: #999999 !important;
    border: 1px solid #CBB08F !important;
    cursor: not-allowed !important;
}

/* Legend Key for Half Day */
.guesty-key-halfday {
    background: #FFF7CC !important;
    border-color: #FFD700 !important;
}

/* Make the key wrap on small screens */
.guesty-calendar-key-row {
    flex-wrap: wrap !important;
    row-gap: 8px !important;
    word-break: break-word !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for smaller cells */
@media (max-width: 600px) {
    .calendar-cell {
        height: 55px;
        font-size: 12px;    }
    
    .calendar-cell .min-nights {
        font-size: 8px;
    }
    
    .calendar-cell .calendar-price {
        font-size: 10px;
    }
}

/* Collapsible quote details */
.quote-details-container {
    margin: 15px 0 0 0;
}

.quote-details-toggle {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quote-details-toggle:hover {
    color: #666;
}

.toggle-arrow {
    text-decoration: none;
    font-size: 12px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.quote-details-breakdown {
    margin: 10px 0;
    padding-left: 20px;
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.quote-details-breakdown li {
    margin: 5px 0;
    line-height: 1.4;
}

.quote-details-breakdown strong {
    font-weight: 500;
}
