/* ============================================
   Instant Book - Date Selector Calendar
   ============================================ */

.ib-calendar-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.ib-calendar-wrapper h3 {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #006fc4;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Month Header with Navigation */
.ib-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ib-nav-btn {
    background: #006fc4;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.ib-nav-btn:hover {
    background: #005a9e;
}

.ib-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ib-nav-spacer {
    width: 30px;
    flex-shrink: 0;
}

/* Mobile Navigation Bar (hidden on desktop) */
.ib-mobile-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Calendar Grid Container */
.ib-calendars {
    display: flex;
    gap: 12px;
}

.ib-month {
    flex: 1;
    min-width: 0;
}

.ib-month-title {
    text-align: center;
    font-weight: 600;
    font-size: 1.05em;
    color: #333;
    flex: 1;
}

/* Calendar Table */
.ib-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ib-table th {
    text-align: center;
    padding: 6px 2px;
    font-size: 0.75em;
    font-weight: 500;
    color: #aaa;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
}

.ib-table td {
    text-align: center;
    padding: 2px;
    vertical-align: top;
}

.ib-table tr:first-child td {
    padding-top: 6px;
}

/* Day Cell */
.ib-day {
    position: relative;
    border-radius: 8px;
    padding: 6px 2px;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: all 0.15s;
    border: 2px solid transparent;
}

/* Tooltip on hover */
.ib-day:hover .ib-day-slots {
    display: block;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
    font-size: 0.7em;
}

.ib-day:hover .ib-day-slots::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.ib-day-num {
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.2;
}

.ib-day-slots {
    font-size: 0.6em;
    font-weight: 700;
    line-height: 1;
    margin-top: 2px;
    white-space: nowrap;
    display: none;
}

/* States */

/* Empty cell */
.ib-day--empty {
    background: transparent;
}

/* Past / today / disabled */
.ib-day--disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.ib-day--disabled .ib-day-num {
    color: #ccc;
}

/* Available (green) */
.ib-day--available {
    background: #e8f5e9;
    cursor: pointer;
}

.ib-day--available .ib-day-num {
    color: #2e7d32;
}

.ib-day--available .ib-day-slots {
    color: #43a047;
}

.ib-day--available:hover {
    background: #c8e6c9;
    border-color: #43a047;
}

/* Low slots (less than 5) - red */
.ib-day--low {
    background: #fff3e0;
    cursor: pointer;
}

.ib-day--low .ib-day-num {
    color: #d32f2f;
}

.ib-day--low .ib-day-slots {
    color: #d32f2f;
}

.ib-day--low:hover {
    background: #ffccbc;
    border-color: #d32f2f;
}

/* Full (grey) - Enquire Now */
.ib-day--full {
    background: #eeeeee;
    cursor: pointer;
}

.ib-day--full .ib-day-num {
    color: #666;
}

.ib-day--full .ib-day-slots {
    color: #666;
}

.ib-day--full:hover {
    background: #e0e0e0;
    border-color: #999;
}

/* Selected */
.ib-day--selected {
    border-color: #006fc4 !important;
    box-shadow: 0 0 0 2px rgba(0,111,196,0.25);
}

/* Legend */
.ib-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ib-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    color: #555;
}

.ib-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ib-legend-swatch--available {
    background: #e8f5e9;
    border: 2px solid #43a047;
}

.ib-legend-swatch--low {
    background: #fff3e0;
    border: 2px solid #d32f2f;
}

.ib-legend-swatch--full, .ib-legend-swatch--disabled {
    background: #eee;
    border: 2px solid #999;
}

/* Selected Date Display */
.ib-selected-display {
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    font-weight: 600;
    color: #006fc4;
    display: none;
}

.ib-selected-display.active {
    display: block;
}

/* Responsive */
@media (max-width: 767px) {
    .ib-calendars {
        flex-direction: column;
        gap: 12px;
    }

    .ib-month {
        display: flex;
        flex-direction: column;
    }

    .ib-month-header {
        order: -1;
    }

    /* Show mobile navigation bar */
    .ib-mobile-nav {
        display: flex;
    }

    /* Hide navigation buttons from month headers, keep titles */
    .ib-month-header .ib-nav-btn,
    .ib-month-header .ib-nav-spacer {
        display: none;
    }

    .ib-month-header {
        justify-content: center;
        background-color: rgb(0 111 196 / 10%);
        border-radius: 8px;
        padding: 2px;
    }

    .ib-month-title {
        display: block;
    }

    .ib-nav-title {
        min-width: auto;
        font-size: 0.95em;
    }

    .ib-calendar-wrapper {
        padding: 16px 12px;
    }

    .ib-day {
        padding: 4px 1px;
    }

    .ib-day-num {
        font-size: 0.8em;
    }

    .ib-day-slots {
        font-size: 0.55em;
    }

    .ib-legend {
        gap: 12px;
    }
}

/* Package Buttons Flexbox Layout */
.package-buttons {
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    align-items: stretch;
    justify-content: center;
}

.package-button-item {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.package-button-item > a {
    width: 100%;
    display: block;
}

.package-button-item .btn {
    width: 100%;
    max-width: 100%;
}

/* 3-column layout on desktop */
@media (min-width: 992px) {
    .package-button-item {
        flex-basis: calc(33.333% - 7px);
    }
}

/* Responsive: stack on mobile and tablet */
@media (max-width: 991px) {
    .package-button-item {
        flex-basis: 100%;
        max-width: 100%;
    }
}
