/* Availability Calendar Styles */

/* Anchor target for "Check Prices & Availability" buttons (Sykes) */
#availabilityCalendarTop {
    scroll-margin-top: 20px;
}
html {
    scroll-behavior: smooth;
}

.availability-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    max-width: 1200px;
}

/* Calendar Container */
.calendar-container {
    flex: 1;
    min-width: 300px;
}

/* Search Filter Bar */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #d4ddc5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #c5ceb5;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 90px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5638;
    margin-bottom: 6px;
    text-align: center;
}

.filter-group label .age-hint {
    font-weight: 400;
    font-size: 11px;
    color: #6b7a52;
}

.select-wrapper {
    position: relative;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    background: white;
    border: none;
    border-radius: 6px;
    padding: 10px 35px 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.filter-select:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 103, 65, 0.3);
}

.select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 12px;
}

/* Month Navigation Row */
.month-nav-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Month Header */
.month-header {
    background: #4a6741;
    color: white;
    border-radius: 30px;
    padding: 15px 30px;
    flex: 1;
    text-align: center;
}

.month-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    font-style: italic;
}

.month-header .subtitle {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
}

.month-header .subtitle i {
    font-size: 16px;
}

.month-nav {
    background: none;
    border: none;
    color: #4a6741;
    font-size: 40px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.month-nav:hover {
    transform: scale(1.15);
    color: #3a5731;
}

.month-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.month-nav:disabled:hover {
    transform: none;
    color: #4a6741;
}

.month-title-wrapper {
    text-align: center;
}

/* Calendar Grid */
.calendar-grid {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #8b9d4a;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.calendar-header span {
    padding: 12px 5px;
    text-align: center;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    cursor: default;
    position: relative;
    min-height: 70px;
    transition: all 0.2s;
}

.calendar-day .day-number {
    font-size: 14px;
    color: #999;
    position: absolute;
    top: 5px;
    left: 8px;
}

.calendar-day .price {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-top: 10px;
}

.calendar-day.empty {
    background: #f0f0f0;
}

.calendar-day.past {
    background: #e6e6e6;
}

.calendar-day.past .day-number {
    color: #aaa;
}

.calendar-day.available {
    background: #8bc34a;
    cursor: pointer;
}

.calendar-day.available:hover {
    background: #7cb342;
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.calendar-day.available .day-number {
    color: white;
}

.calendar-day.selected {
    background: #f57c00 !important;
}

.calendar-day.selected .day-number {
    color: white !important;
}

.calendar-day.selected-range {
    background: #ffb74d !important;
}

.calendar-day.selected-range .day-number {
    color: white !important;
}

.calendar-day.unavailable {
    background: #e6e6e6;
}

.calendar-day.unavailable .day-number {
    color: #aaa;
}

/* Genuinely booked dates: faint diagonal stripes + "Booked" label */
.calendar-day.booked {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.04),
        rgba(0, 0, 0, 0.04) 6px,
        transparent 6px,
        transparent 12px
    );
}

.calendar-day.booked .day-number {
    text-decoration: line-through;
}

.calendar-day .booked-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #b0b0b0;
    margin-top: 10px;
}

/* Available but not a valid check-in day: plain faded cell, no stripes/label */
.calendar-day.not-changeover {
    background: #f5f5f5;
}

.calendar-day.not-changeover .day-number {
    color: #999;
    text-decoration: none;
}

/* Booking Panel */
.booking-panel {
    width: 300px;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    height: fit-content;
    flex-shrink: 0;
}

.booking-panel-header {
    background: #f5f5f5;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.booking-panel-header i {
    color: #999;
}

.property-name-bar {
    background: #0288d1;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.booking-details {
    padding: 20px;
    text-align: center;
}

.booking-details .location {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
}

.booking-details .date {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.booking-details .nights {
    font-size: 24px;
    font-weight: 700;
    color: #8bc34a;
    margin-bottom: 15px;
}

.price-alert {
    background: #fff9c4;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #795548;
}

.price-alert i {
    color: #ffc107;
    font-size: 18px;
}

.booking-details .price-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.booking-details .price-value {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.booking-details .price-guarantee {
    color: #4caf50;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.booking-details .price-guarantee i {
    color: #4caf50;
}

.book-now-btn {
    display: block;
    width: 100%;
    background: linear-gradient(to bottom, #ff9800, #f57c00);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    text-align: center;
}

.book-now-btn:hover {
    background: linear-gradient(to bottom, #ffa726, #fb8c00);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,152,0,0.4);
    color: white !important;
    text-decoration: none !important;
}

.book-now-btn:visited,
.book-now-btn:active,
.book-now-btn:focus {
    color: white !important;
    text-decoration: none !important;
}

.book-now-btn i {
    margin-left: 5px;
}

/* No selection state */
.booking-panel.no-selection .booking-details {
    padding: 40px 20px;
    color: #999;
}

.booking-panel.no-selection .select-prompt {
    font-size: 16px;
}

/* Loading state */
.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-radius: 8px;
}

.calendar-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #8bc34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No availability banner */
.no-availability-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 15px;
    color: #6d5b1f;
    font-size: 15px;
}

.no-availability-banner i.far,
.no-availability-banner > i {
    color: #f0ad00;
    font-size: 18px;
}

.no-availability-banner .msg {
    font-weight: 600;
    flex: 1;
    min-width: 140px;
}

.jump-next-btn {
    background: #4a6741;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.jump-next-btn:hover {
    background: #3a5731;
    box-shadow: 0 3px 10px rgba(74, 103, 65, 0.3);
}

.jump-next-btn i {
    margin-left: 6px;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.available {
    background: #8bc34a;
}

.legend-color.selected {
    background: #f57c00;
}

.legend-color.unavailable {
    background: #e0e0e0;
}

/* Duration Selector */
.duration-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.duration-selector label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.duration-selector label i {
    color: #4a6741;
    font-size: 18px;
}

.duration-select-wrapper {
    position: relative;
}

.duration-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(to bottom, #4a6741, #3a5731);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 45px 10px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(74, 103, 65, 0.3);
}

.duration-select:hover {
    background: linear-gradient(to bottom, #5a7751, #4a6741);
    box-shadow: 0 5px 15px rgba(74, 103, 65, 0.4);
}

.duration-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.3), 0 5px 15px rgba(74, 103, 65, 0.4);
}

.duration-select option {
    background: white;
    color: #333;
    padding: 10px;
}

.duration-select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    pointer-events: none;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .availability-wrapper {
        flex-direction: column;
    }

    .calendar-container {
        max-width: 100%;
    }

    .booking-panel {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .month-nav {
        font-size: 32px;
        width: 40px;
        height: 40px;
    }

    .month-header {
        padding: 12px 20px;
    }

    .search-filter-bar {
        padding: 12px 15px;
    }

    .filter-group {
        min-width: calc(33.33% - 10px);
    }
}

@media (max-width: 600px) {
    .availability-wrapper {
        padding: 10px;
        margin: 10px 0;
    }

    .month-header h3 {
        font-size: 20px;
    }

    .month-nav {
        font-size: 28px;
        padding: 5px 10px;
    }

    .calendar-header span {
        padding: 10px 2px;
        font-size: 12px;
    }

    .calendar-day {
        min-height: 55px;
    }

    .calendar-day .day-number {
        font-size: 12px;
        top: 3px;
        left: 5px;
    }

    .calendar-day .price {
        font-size: 12px;
        margin-top: 8px;
    }

    .booking-details .price-value {
        font-size: 28px;
    }

    .booking-details .nights {
        font-size: 20px;
    }

    .search-filter-bar {
        gap: 8px;
        padding: 10px 12px;
    }

    .filter-group {
        min-width: calc(50% - 8px);
    }

    .filter-group label {
        font-size: 12px;
    }

    .filter-select {
        padding: 8px 30px 8px 10px;
        font-size: 13px;
    }
}

/* Hide on non-Sykes properties */
.availability-wrapper.hidden {
    display: none;
}
