/* =========================================================
   1. STRUKTUR UTAMA & HERO SECTION
   ========================================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.availability-hero {
    text-align: center;
    padding: 40px 0 20px 0;
}

.availability-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.availability-hero p {
    color: #64748b;
    font-size: 15px;
}

.availability-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 50px;
}

/* =========================================================
   2. HEADER TARIKH TERPILIH & IKON NAVIGASI (CSS ARROW)
   ========================================================= */
.date-picker-header {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

/* Base Butang Navigasi Bulan */
.cal-btn-prev, 
.cal-btn-next {
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    color: #334155;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.cal-btn-prev:hover, 
.cal-btn-next:hover {
    background: #0f172a;
    color: #ffffff;
}

/* Anak Panah Kiri CSS */
.cal-btn-prev::after {
    content: '';
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 3px;
}

/* Anak Panah Kanan CSS */
.cal-btn-next::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 3px;
}

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 15px;
    height: 36px;
}

/* =========================================================
   3. KALENDAR DINAMIK & JULAT TARIKH (MULTI-ROW SELECTION)
   ========================================================= */
.calendars-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.calendar-box {
    width: 100%;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-table th {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding-bottom: 12px;
}

.calendar-table td {
    text-align: center;
    padding: 4px 0;
    position: relative;
    height: 44px;
    vertical-align: middle;
}

/* Bulatan Nombor Tarikh */
.calendar-table td span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin: 0 auto;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.calendar-table td:not(.disabled-date):not(:empty) {
    cursor: pointer;
}

.calendar-table td:not(.disabled-date):not(:empty):hover span {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Jalur Highlight Latar Belakang (Julat Tarikh) */
.calendar-table td.in-range::before,
.calendar-table td.selected-start::before,
.calendar-table td.selected-end::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    background-color: #e2e8f0;
    z-index: 1;
}

.calendar-table td.in-range::before {
    left: 0;
    right: 0;
}

.calendar-table td.selected-start::before {
    left: 50%;
    right: 0;
}

.calendar-table td.selected-end::before {
    left: 0;
    right: 50%;
}

.calendar-table td.selected-single::before {
    display: none !important;
}

/* Kemasan Bucu Lengkok Hujung Baris */
.calendar-table td:first-child.in-range::before,
.calendar-table td:first-child.selected-end::before {
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

.calendar-table td:last-child.in-range::before,
.calendar-table td:last-child.selected-start::before {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

/* Bulatan Hitam Terpilih */
.calendar-table td.selected-start span,
.calendar-table td.selected-end span,
.calendar-table td.selected-single span {
    background-color: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
}

/* Tarikh Penuh / Disekat / Tarikh Lepas */
.calendar-table td.disabled-date {
    background-color: transparent !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.calendar-table td.disabled-date span {
    color: #cbd5e1 !important;
    text-decoration: line-through;
}

/* =========================================================
   4. MODEN BORANG PILIHAN (CHIP CARDS & TOGGLE SWITCH)
   ========================================================= */
.form-options-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 32px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}

.section-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

/* Tab Filter Kategori Pakej (All / Canopy / Marquee Tent / Patio Set) */
.category-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background: #e2e8f0;
}

.category-tab.active {
    background: #0f172a;
    color: #ffffff;
}

/* Grid Kad Pilihan (Chips) */
.package-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.chip-card {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.chip-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
}

.chip-text {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
}

.chip-icon {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #ffffff;
}

.chip-card:hover .chip-content {
    border-color: #94a3b8;
    background-color: #ffffff;
}

/* Keadaan Selected */
.chip-card input[type="checkbox"]:checked + .chip-content {
    background-color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.chip-card input[type="checkbox"]:checked + .chip-content .chip-text {
    color: #0f172a;
    font-weight: 600;
}

.chip-card input[type="checkbox"]:checked + .chip-content .chip-icon {
    background-color: #0f172a;
    border-color: #0f172a;
}

.chip-card input[type="checkbox"]:checked + .chip-content .chip-icon::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Dropdown & Selectors */
.side-selectors-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.select-box-modern {
    position: relative;
    width: 100%;
}

.select-box-modern select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.select-box-modern select:focus,
.select-box-modern select:hover {
    border-color: #0f172a;
}

.select-box-modern::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 5px;
    height: 5px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    pointer-events: none;
}

/* Time Box Toggle Switch */
.time-toggle-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 6px 6px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
}

.time-label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segment-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segmented-control input[type="radio"]:checked + .segment-btn {
    background-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-submit-availability {
    width: 100%;
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-submit-availability:hover {
    background-color: #1e293b;
}

/* =========================================================
   5. RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 900px) {
    .calendars-container,
    .form-options-grid {
        grid-template-columns: 1fr;
    }
    
    .package-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .package-cards-grid {
        grid-template-columns: 1fr;
    }
}