body::-webkit-scrollbar{
    display: none; /* For Chrome, Safari, and Opera */
}

.container {
    display: flex;
    margin-top: 80px;
    height: calc(100vh - 80px);
    overflow: hidden;
    background: linear-gradient(
        250deg,
        #BE0404 65%,    
        #960101 75%,
        #BD0000 85%,
        #800000 95%
    );
}

.calendar-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}


.event-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 30%;
    background: transparent;
    padding: 30px;
    color: white;
    overflow: hidden;
}

.event-panel .title {
    text-align: left;
    padding: 10px;
    font-size: 20px;
    font-weight: 600;
}

.event-container{
    flex: 1;
    display: flex;
    overflow: hidden;
}

.event-wrapper{
    flex: 1;
    display: flex;
    overflow: hidden;
}

#eventList{
    flex: 1;
    overflow-y: auto; /* Enable vertical scrolling for table body */
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#eventList::-webkit-scrollbar {
    display: none;
}

.event-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: white;
    color: black;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    gap: 10px;
}

.event-card img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    cursor: zoom-in;
}

.event-card .event-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: #800000;
    font-size: 14px;
}

.event-card .event-details strong {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.event-card .event-details em {
    font-style: italic;
    color: #6b7280;
}

#calendar {
    flex: 1;
    width: 70%;
    background: white;
    display: flex;
    flex-direction: column;
}

#calendar .calendar-header {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    display: flex;
}

#calendar .calendar-body {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    flex: 1;
    display: flex;
}

#calendar tbody {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: inherit;
}


#calendar th {
    flex: 1;          
    border: 1px solid #EEEEEE;
    vertical-align: middle;
    font-size: 18px;
    box-sizing: border-box;
    text-align: center;
    padding: 5px;
    overflow: hidden;
    white-space: nowrap;
}

#calendar tr{
    display: flex;
    flex: 1;
}


#calendar td {
    border: 1px solid #EEEEEE;
    vertical-align: top;
    position: relative;
    padding: 5px;
    font-size: 14px;
    text-align: right;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    box-sizing: border-box;
    overflow: hidden;
    flex: 1;
}

#calendar td:hover {
    background-color: #ffe6e6;
}

#calendar td.selected-day {
    background-color: rgba(128, 0, 0, 0.5);
    border: 1px solid #6a0101;
}

#calendar td.selected-day .day-number {
    color: white;
    font-weight: bold;
}

.today {
    background-color: rgba(139, 0, 0, 0.1);
}

.day-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.day-number {
    font-weight: bold;
    margin-bottom: 3px;
}

.faded-day {
    color: rgba(0, 0, 0, 0.3);
}

.event-title {
    font-size: 11px;
    background-color: #800000;
    color: #ffffff;
    margin-top: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.event-indicator {
    width: 20px;
    height: 20px;
    background: darkred;
    border-radius: 50%;
    margin: auto;
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

/* Month Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 17px;
    box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.month-navigation h2 {
    font-size: 24px;
    font-weight: bold;
    color: #8B0000;
    min-width: 200px;
    text-align: center;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #800000;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.nav-btn:hover {
    background: #6a0101;
}

/* ==== EVENT IMAGE MODAL ==== */
.event-image-modal {
    display: none;                     /* hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.event-image-modal .modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.event-image-modal .modal-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: .2s;
}
.event-image-modal .modal-close:hover { color: #ff5a5a; }

/* ============================= */
/* RESPONSIVE DESIGN */
/* ============================= */

/* ===== Small screens (phones ≤600px) ===== */
@media (max-width: 600px) {
    .container {
        flex-direction: column-reverse;
        height: auto;
        margin-top: 70px;
    }

    .calendar-container {
        flex-direction: column-reverse;
        overflow: visible;
    }

    /* Calendar section */
    #calendar {
        width: 100%;
        order: 1;
        overflow-x: auto;
        padding: 10px;
    }

    #calendar th {
        font-size: 13px;
        padding: 6px 2px;
    }

    #calendar td {
        font-size: 12px;
        height: 80px;
        padding: 4px;
    }

    .day-number {
        font-size: 12px;
    }

    .event-title {
        font-size: 10px;
    }

    /* Month navigation */
    .month-navigation {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }

    .month-navigation h2 {
        font-size: 18px;
        min-width: unset;
    }

    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    /* Event panel */
    .event-panel {
        width: 100%;
        order: 2;
        padding: 20px;
        box-shadow: 0 -4px 8px rgba(0,0,0,0.2);
        overflow-y: auto;
        height: 220px;
    }

    .event-panel .title {
        text-align: center;
        font-size: 1.1rem;
        padding: 5px 0;
    }

    #eventList {
        gap: 10px;
    }

    .event-card {
        flex-direction: row;
        padding: 10px;
        gap: 10px;
    }

    .event-card img {
        width: 70px;
        height: 70px;
    }

    .event-card .event-details strong {
        font-size: 14px;
    }

    .event-card .event-details {
        font-size: 12px;
    }
}

/* ===== Medium screens (tablets 601px–1024px) ===== */
@media (min-width: 601px) and (max-width: 1024px) {
    .container {
        flex-direction: column-reverse;
        height: auto;
        margin-top: 75px;
    }

    .calendar-container {
        flex-direction: column-reverse;
        overflow: visible;
    }

    #calendar {
        width: 100%;
        padding: 15px;
        overflow-x: auto;
    }

    #calendar th {
        font-size: 15px;
    }

    #calendar td {
        font-size: 13px;
        height: 90px;
    }

    .month-navigation h2 {
        font-size: 20px;
    }

    .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .event-panel {
        width: 100%;
        padding: 25px;
        order: 2;
        height: 280px;
        overflow-y: auto;
    }

    .event-card img {
        width: 90px;
        height: 90px;
    }

    .event-card .event-details {
        font-size: 13px;
    }
}

/* ===== Large screens (desktop ≥1025px) ===== */
@media (min-width: 1025px) {
    .container {
        flex-direction: row;
        height: calc(100vh - 80px);
    }

    .calendar-container {
        flex-direction: row;
    }

    .event-panel {
        width: 30%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    #calendar {
        width: 70%;
        height: 100%;
    }
}

/* Animations */
#calendar {
    animation: fadeInSlideDown 700ms ease both;
}

 .event-panel {
    animation: fadeInSlideDown 1000ms ease both;
}

.event-card { animation: popUp 600ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both; animation-delay: 120ms;}
.event-card:nth-child(2) { animation-delay: 180ms; }
.event-card:nth-child(3) { animation-delay: 240ms; }
.event-card:nth-child(4) { animation-delay: 300ms; }