.church-events-calendar {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-navigation h2 {
    margin: 0;
    font-size: 1.5em;
}

.calendar-navigation button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 4px;
}

.calendar-navigation button:hover {
    background: #e0e0e0;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
}

.calendar-table th {
    background: #f8f9fa;
    padding: 8px 4px;
    text-align: center;
    border: 1px solid #dee2e6;
    width: 14.28%; /* Equal width for 7 columns */
    font-size: 0.9em;
}

.calendar-table td {
    border: 1px solid #dee2e6;
    padding: 4px;
    height: 120px;
    vertical-align: top;
    width: 14.28%; /* Equal width for 7 columns */
    position: relative;
    overflow: hidden;
}

.calendar-day {
    position: relative;
}

.day-number {
    font-size: 0.9em;
    margin-bottom: 3px;
    font-weight: bold;
    color: #333;
}

.other-month {
    background: #f8f9fa;
    color: #6c757d;
}

.has-events {
    background: #fff;
}

.day-events {
    font-size: 0.7em;
    line-height: 1.2;
}

.calendar-event {
    margin: 2px 0;
    padding: 3px 4px;
    background: #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75em;
    line-height: 1.2;
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.calendar-event:hover {
    background: #dee2e6;
}

.event-time {
    color: #495057;
    font-weight: bold;
    font-size: 1.5em;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-title {
    color: #333;
    font-size: 1.5em;
    line-height: 1.2;
    white-space: normal;
    display: block;
    margin: 0;
}

.more-events {
    color: #6c757d;
    font-size: 0.6em;
    text-align: center;
    margin-top: 1px;
    cursor: pointer;
    padding: 1px;
}

.calendar-popup {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    max-width: 300px;
    z-index: 1000;
}

.event-popup-content h3 {
    margin: 0 0 10px 0;
}

.event-meta {
    margin: 10px 0;
}

.event-meta p {
    margin: 5px 0;
}

.event-description {
    margin: 10px 0;
    font-size: 0.9em;
}

.view-event-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 3px;
}

.view-event-link:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}

@media (max-width: 768px) {
    .calendar-table td {
        height: 120px;
        padding: 3px;
    }
    
    .calendar-table th {
        padding: 6px 2px;
        font-size: 0.8em;
    }
    
    .calendar-event {
        font-size: 0.7em;
        padding: 2px 3px;
        margin: 1px 0;
    }
    
    .day-number {
        font-size: 0.8em;
        margin-bottom: 2px;
    }
    
    .event-time {
        font-size: 1.4em;
        margin-bottom: 2px;
    }
    
    .event-title {
        font-size: 1.0em;
        line-height: 1.2;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .more-events {
        font-size: 0.6em;
    }
}

/* Add to existing calendar.css */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-events-modal {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
}

.close-modal:hover {
    color: #343a40;
}

.modal-content {
    padding: 20px;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}

.events-list .event-item {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.events-list .event-item:last-child {
    border-bottom: none;
}

.events-list .event-meta {
    color: #6c757d;
    margin: 5px 0;
}

.events-list .event-description {
    margin: 10px 0;
}

.events-list .event-link {
    display: inline-block;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    margin-top: 10px;
}

.events-list .event-link:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}

/* Highlight selected day when auto-opened in Day view */
.calendar-day.selected {
    outline: 2px solid #007bff;
    background: #e7f1ff;
}