.class-schedule-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.week-header {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px;
    background: #f2e8cf;
    margin-bottom: 10px;
    border-radius: 4px;
    color: #386641;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.day-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #386641;
    color: white;
}

.calendar-grid {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.grid-header {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    background: #386641;
    border-bottom: 2px solid #e7c776;
    font-weight: bold;
    color: white;
}

.time-header {
    padding: 5px;
    text-align: center;
    border-right: 2px solid #e7c776;
}

.day-header {
    padding: 5px;
    text-align: center;
    border-left: 2px solid #e7c776;
}

.time-row {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    border-bottom: 1px solid #e7c776;
    min-height: 60px;
}

.time-label {
    padding: 2px 5px;
    text-align: center;
    background: #386641;
    font-size: 0.9em;
    border-right: 2px solid #e7c776;
    color: white;
    font-weight: 500;
}

.time-cell {
    border-left: 2px solid #e7c776;
    padding: 1px;
    position: relative;
    height: 60px;
}

.event {
    color: white;
    padding: 1px;
    margin: 0;
    position: absolute;
    left: 1px;
    right: 1px;
    overflow: hidden;
    z-index: 1;
    font-size: 0.8em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    border: 2px solid;
}

/* Event type styles */
.event-regular {
    background: #6a994e;
    border-color: #a7c957;
}

.event-regular:hover {
    background: #386641;
}

/* Beginner event styles */
.event-beginner {
    background: #77bde0 !important;
    border-color: #5ca8d3 !important;
}

.event-beginner:hover {
    background: #4095c6 !important;
}

/* Past event styles */
.event-past {
    background: #cccccc !important;
    border-color: #bbbbbb !important;
    color: #666666 !important;
    cursor: default;
    opacity: 0.7;
}

.event-past:hover {
    background: #cccccc !important;
    opacity: 0.8;
}

.event-past::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.5em;
    opacity: 0.8;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    color: #386641;
    line-height: 1;
    padding: 10px;
}

.close-modal:hover {
    color: #bc4749;
}

#modal-title {
    margin-top: 0;
    color: #386641;
    font-size: 1.5em;
    padding-right: 30px;
}

#modal-date,
#modal-time,
#modal-location,
#modal-description {
    margin: 10px 0;
    color: #333;
}

.modal-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-button {
    padding: 8px 16px;
    background: #6a994e;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    word-break: break-word;
    text-align: center;
}

.modal-button:hover {
    background: #386641;
    color: white;
    text-decoration: none;
}

/* Past event modal styles */
.modal-past .modal-button {
    background: #999999 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.modal-past .modal-button:hover {
    background: #888888 !important;
}

/* Fix for iOS momentum scrolling */
.modal-open {
    position: fixed;
    width: 100%;
    height: 100%;
}

.schedule-header {
    margin-bottom: 20px;
}

/* Nav button styles */
.nav-button {
    font-weight: normal;
    font-size: 0.8em;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #386641;
    color: white;
}

/* Only show pointer cursor for actual links */
a.nav-button {
    cursor: pointer;
}

/* Google Calendar button styles */
.google-calendar-button {
    background: #386641 !important;
    color: white !important;
    transition: background-color 0.3s;
    font-size: 0.8em;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: normal;
}

.google-calendar-button:hover {
    background: #c53929 !important;
    text-decoration: none;
    color: white !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .grid-header,
    .time-row {
        grid-template-columns: 35px repeat(5, 1fr);
    }
    
    .day-header {
        padding: 3px;
        font-size: 0.85em;
    }
    
    .time-label {
        padding: 2px;
        font-size: 0.5em;
    }
    
    .event {
        font-size: 0.5em;
        padding: 0;
    }
    
    .modal-content {
        margin: 10px auto;
        padding: 15px;
        width: calc(100% - 30px);
        max-width: 400px;
        position: relative;
        box-sizing: border-box;
    }
    
    .modal-actions {
        flex-direction: column;
        margin: 15px 0;
    }
    
    .modal-button {
        width: 100%;
        margin: 0;
    }

    #modal-title {
        line-height: 1.2;
        margin-bottom: 10px;
        padding-right: 25px;
    }

    #modal-date,
    #modal-time,
    #modal-location,
    #modal-description {
        line-height: 1.3;
        margin: 8px 0;
    }

    .close-modal {
        right: 15px;
        top: 8px;
        padding: 8px;
    }

    .week-header {
        padding: 10px;
    }
    
    .day-label {
        padding: 2px 4px;
    }
}

@media (max-width: 480px) {
    .event {
        font-size: 0.40em;
    }

    .modal-content {
        padding: 12px;
    }
    
    .modal-actions {
        margin: 12px 0;
    }

    #modal-title {
        padding-right: 20px;
    }

    .nav-button {
        padding: 8px 16px;
    }
}