﻿.calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 0;
    min-width: 892px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
}

.week-calendar-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-auto-rows: 20px; /* each 30-min slot height */
    position: relative;
}

.calendar-header {
    background-color: #0d6efd;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #0b5ed7;
}

.week-calendar-header {
    background-color: #0d6efd;
    color: white;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #0b5ed7;
    line-height: 20px;
}

.calendar-day {
    background-color: white;
    min-height: 60px;
    position: relative;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}

    .calendar-day.other-month {
        background-color: #f8f9fa;
        opacity: 0.6;
    }

    .calendar-day.today {
        background-color: #fff3cd;
        border: 2px solid #ffc107;
    }

.day-number {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.calendar-day.today .day-number {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1rem;
}

.events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
    min-width: 8rem;
}

.event-item {
    padding: 4px 1.5px;
    border-radius: 4px;
    color: white;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

    .event-item:hover {
        opacity: 0.8;
        transform: translateX(2px);
    }

.modal.show {
    background-color: rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .event-item {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .calendar-header {
        padding: 8px;
        font-size: 0.75rem;
    }
}








.time-column {
    text-align: right;
    padding-right: 5px;
    font-weight: 600;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    line-height: 20px;
    font-size: 0.75rem;
}

.week-slot-cell {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    background-color: white;
    position: relative;
    z-index: 0; /* grid below events */
}

.week-day-column {
    position: relative;
    grid-column: auto; /* overlay column */
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

    /* Event inside cell */
    .week-day-column .event-item {
        position: absolute;
        left: 2px;
        right: 2px;
        border-radius: 4px;
        font-size: 0.7rem;
        color: white;
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        transition: all 0.2s;
        z-index: 2; /* ensure event is above grid */
    }

        .week-day-column .event-item:hover {
            opacity: 0.8;
            transform: translateX(2px);
        }

@media (max-width: 768px) {
    .week-calendar-grid {
        grid-template-columns: 40px repeat(7, 1fr);
    }

    .week-calendar-header {
        font-size: 0.75rem;
        line-height: 15px;
    }

    .time-column {
        font-size: 0.65rem;
        padding-right: 3px;
    }

    .week-day-column {
        /* height controlled by grid-auto-rows, no need for magic number */
    }

    .week-day-column .event-item {
        font-size: 0.6rem;
        padding: 1px 2px;
    }
}