/*
=========================================================
  SCHEDULE SECTION STYLES (MOBILE-FIRST & RESPONSIVE)
=========================================================
*/

/* === COMMON STYLES (Berlaku untuk Mobile & Desktop) === */
.schedule {
    padding: 40px 0;
}

/* Pindahkan styling H2 ke dalam .container agar padding konsisten */
.schedule .container h2 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Wrapper untuk Navigasi Bulan */
.schedule-nav-wrapper {
    background-color: var(--primary-yellow, #F9E800);
    border-top: 1px solid black;
    border-bottom: 1px solid black;
}

.schedule-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    font-weight: 600;
    /* max-width: 1200px;*/
    /* Batas lebar agar sejajar konten */
    margin: 0 auto;
}

.schedule-nav span {
    margin: 0 20px;
    font-size: 16px;
    font-weight: 500;
}

.schedule-nav button {
    font-size: 1.2rem;
}

.schedule-nav button img {
    display: block;
    /* Agar tidak ada spasi ekstra */
}

/* === MOBILE STYLES (Default) === */
.schedule-calendar-desktop {
    display: none;
    /* Sembunyikan kalender desktop di mobile */
}

.schedule-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Jarak antar card */
    margin-top: 20px;
}

.schedule-card {
    border: 1px solid #000;
    /*border-radius: 8px;*/
    background-color: #f7f7f7;
    padding: 15px;
}

.card-header {
    display: flex;
    align-items: baseline;
    /* Sejajarkan tulisan bawah */
    margin-bottom: 12px;
}

.card-header .date {
    font-size: 1rem;
    font-weight: 400;
}

.card-header .day {
    margin-left: 20px;
    color: #555;
    font-size: 14px;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Jarak antar event di dalam card */
}

.schedule-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.schedule-pagination button {
    /*font-size: 1.5rem;*/
}

.active-pages {
    font-weight: 500;
    text-decoration: underline;
}

.inactive-pages {
    font-weight: 300;
}

.schedule-pagination .pages {
    font-size: 18px;
    display: flex;
    gap: 8px;
}

/* === DESKTOP STYLES (Menggunakan Media Query) === */
@media (min-width: 1024px) {
    .schedule-list-mobile {
        display: none;
        /* Sembunyikan daftar mobile di desktop */
    }

    .schedule-nav span {
        margin: 0 20px;
        font-size: 22px;
        font-weight: 500;
    }

    .schedule .container h2 {
        font-size: 1.5rem;
        font-weight: 500;
        margin-bottom: 20px;
    }

    /* Tampilkan dan tata kalender desktop */
    .schedule-calendar-desktop {
        display: block;
        /* Tampilkan kembali */
        border: 1px solid #ccc;
        border-top: none;
    }

    /* Ganti parent dari nav bulan ke .container-schedule */
    .container-schedule {
        /*max-width: 1200px;*/
        margin: 0 auto;
        /*padding: 0 5%;*/
    }

    .schedule-nav-wrapper {
        background-color: transparent;
        /* Hapus latar kuning di wrapper */
    }

    .schedule-nav {
        background-color: var(--primary-yellow, #F9E800);
        padding: 12px;
    }

    /*
     * Styling untuk grid kalender desktop (tetap sama seperti sebelumnya)
     */
    .calendar-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        text-align: center;
    }

    .calendar-header span {
        padding: 10px;
        font-weight: 600;
        font-size: 0.8rem;
        /* border-bottom: 1px solid #ccc; */
        border-right: 1px solid black;
    }

    .calendar-header span:last-child {
        border-right: none;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        border-bottom: 1px solid black;
    }

    .day-cell {
        position: relative;
        min-height: 120px;
        padding: 8px;
        border-right: 1px solid #ccc;
        border-top: 1px solid #ccc;
    }

    .day-cell:nth-child(7n) {
        border-right: none;
    }

    .day-cell:nth-child(-n+7) {
        /*border-top: none;*/
    }

    .date-number {
        font-size: 0.9rem;
        font-weight: 500;
    }

    .date-number.is-highlighted {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background-color: var(--primary-yellow, #F9E800);
        border-radius: 50%;
    }

    .events-container {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* SCHEDULE - DESKTOP */
    .schedule {
        padding: 30px 0;
    }

    .schedule-header h2 {
        font-size: 1.5rem;
    }

    .schedule-list-mobile {
        display: none;
    }

    .schedule-calendar-desktop {
        display: block;
    }

    .calendar-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        text-align: center;
        font-weight: 600;
        font-size: 0.9rem;
    }

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

    .calendar-grid>div {
        background-color: #fff;
        min-height: 120px;
        padding: 10px;
        text-align: center;
        font-weight: 600;
        position: relative;
        border-right: 1px solid black;
        border-top: 1px solid black;
    }

    .day-item.has-event {
        background-color: #f7f7f7;
        cursor: pointer;
    }

    .day-item .event-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: var(--text-dark);
        display: block;
        margin: 5px 0 0 auto;
    }

    .day-item.sold-out {
        background-color: #e0e0e0;
    }

    .day-item.active {
        background-color: var(--primary-red);
        color: var(--text-light);
    }

    .day-item.active .event-dot {
        background-color: var(--text-light);
    }

    .day-item .event-tooltip {
        display: none;
        position: absolute;
        bottom: 5px;
        left: 5px;
        right: 5px;
        background-color: var(--primary-yellow);
        padding: 5px;
        font-size: 0.8rem;
        text-align: left;
        font-weight: 500;
        z-index: 10;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .day-item.has-event:hover .event-tooltip {
        display: block;
    }
}

/* === SHARED STYLES (Agar tidak duplikasi kode) === */
/* Styling ini berlaku untuk event di mobile dan desktop */
.event-item {
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 400;
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

.event-item.event-black {
    background-color: #2c2c2c;
    color: #fff;
}

.event-item.event-grey {
    background-color: #888;
    color: #fff;
}

.event-item.event-red {
    background-color: var(--primary-red, #D81E1E);
    color: #fff;
}

.show-more {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    border: 1px solid #000;
    border-radius: 4px;
    background-color: #f7f7f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.show-more span {
    font-size: 0.7rem;
}

/* Posisi relative pada cell agar overlay bisa absolute tepat di atasnya */
.day-cell,
.schedule-card {
    position: relative;
}

/* Container extra events (Overlay) */
.extra-events-wrapper {
    display: none;
    position: absolute;
    top: -45%;
    left: 5%;
    width: 90%;
    min-height: 100%;
    background: white;
    border: 1px solid #000;
    z-index: 50;
    padding: 10px;
    box-sizing: border-box;
}

/* Munculkan overlay saat parent aktif */
.events-container.active .extra-events-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Styling nomor tanggal di dalam overlay agar mirip gambar */
.date-number-overlay {
    display: block;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    /* margin-bottom: 15px; */
}

/* Button positioning saat aktif (agar tetap terlihat di bawah overlay) */
.show-more-btn {
    position: relative;
    z-index: 60;
    /* Di atas overlay */
    width: 100%;
    background: white;
    border: 1px solid #000;
    padding: 5px;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Animasi Caret */
.events-container.active .icon-caret svg {
    transform: rotate(180deg);
}

.icon-caret svg {
    transition: transform 0.3s ease;
}

/* Animasi Rotasi Caret */
.caret-icon svg {
    transition: transform 0.3s ease;
}

/* Saat class .is-expanded ada di parent */
.is-expanded .caret-icon svg {
    transform: rotate(180deg);
}

.is-empty{
    background-color: #FBFBFB !important;
}

.extra-events {
    flex-direction: column;
    gap: 10px;
}

/* Untuk tampilan desktop yang menimpa (Overlay) */
@media (min-width: 992px) {
    .day-cell {
        position: relative;
    }

    /* Jika ingin Desktop tetap gaya overlay sesuai gambar awal */
    .day-cell.is-expanded .events-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        z-index: 100;
        border: 1px solid black;
        padding: 5px;
        min-height: 100%;
    }

    /* Styling Tombol Umum */
    .show-more-btn {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: transparent;
        border: 1px solid #ccc;
        padding: 8px 12px;
        margin-top: 10px;
        cursor: pointer;
        font-family: inherit;
        font-weight: 500;
    }


}