/* General Layout */
#display-calendar-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

#calendar-container {
    flex: 1;
    min-width: 600px;
}

#agenda-container {
    flex: 0 0 300px;
    border-left: 1px solid #ddd;
    padding-left: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #display-calendar-wrapper {
        flex-direction: column;
    }
    
    #calendar-container {
        min-width: auto;
    }
    
    #agenda-container {
        border-left: none;
        border-top: 1px solid #ddd;
        padding-left: 0;
        padding-top: 20px;
    }
}

/* Calendar Header */
#calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#calendar-header h2 {
    margin: 0;
}

/* Calendar Grid */
#calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Forces fixed column widths */
}

#calendar-grid th, #calendar-grid td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
    width: 14.28%;
    height: 100px; /* Fixed height */
    max-height: 100px; /* Enforce maximum height */
    overflow: hidden; /* Hide overflow content */
    position: relative;
}

/* Day number styling */
#calendar-grid td {
    font-weight: bold;
    font-size: 14px;
}

#calendar-grid td.other-month {
    color: #aaa;
    background-color: #f9f9f9;
}

#calendar-grid td.has-events {
    background-color: #f0f8ff;
}

.events-container {
    font-size: 0.75em;
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    max-height: 60px; /* Limit event container height */
    overflow: hidden;
}

.event-title {
    background-color: #0073aa;
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    margin-bottom: 1px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.2;
    display: block;
    max-width: 100%;
}

.event-title:hover {
    background-color: #005a87;
}


/* Agenda */
#agenda-list h3 {
    margin-top: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.agenda-event {
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
}

.agenda-event:hover {
    background: #f0f0f0;
}

.agenda-event h4 {
    margin: 0 0 5px 0;
}

/* Modal */
#event-detail-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

#modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
    border-radius: 5px;
}

#modal-close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#modal-close-btn:hover,
#modal-close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
