/* Calendrier des formations - Structure */
.calendar-month {
    font-size: 0.875rem;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.weekday-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 8px 0;
    color: #6c757d;
}

/* Week structure - unified grid with relative positioning for overlay */
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
    position: relative;
}

/* Day cells */
.day-cell {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 4px;
    min-height: 32px;
    background: white;
    transition: all 0.2s;
}

.day-cell:hover:not(.empty) {
    background-color: #f8f9fa;
}

.day-cell.empty {
    background-color: #fafafa;
    border-color: transparent;
}

.day-cell.today {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
}

.day-number {
    font-size: 0.75rem;
    display: block;
    text-align: right;
    font-weight: 500;
    color: #495057;
}

.day-cell.today .day-number {
    color: #856404;
    font-weight: bold;
}

/* Event bars overlay - positioned absolutely over the week grid */
.week-events-overlay {
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    pointer-events: none;
}

.event-bar {
    position: absolute;
    height: 20px;
    line-height: 16px;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
    pointer-events: auto;
    z-index: 5;
}

.event-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    z-index: 10;
}

/* Single-day events fill 100% of their day cell */
.event-bar.single-day {
    width: calc(14.2857% - 4px);
}

.card-header {
    background-color: var(--bs-primary, #0d6efd);
    color: white;
    padding: 0.75rem 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-week {
        gap: 1px;
    }
    
    .day-cell {
        padding: 2px;
    }
    
    .day-number {
        font-size: 0.6rem;
    }
    
    .event-bar {
        font-size: 0.55rem;
        height: 16px;
        padding: 1px 3px;
    }
    
    .week-events-overlay {
        top: 18px;
    }
    
    .weekday-header {
        font-size: 0.6rem;
        padding: 4px 0;
    }
}

/* Navigation buttons */
.calendar-nav {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.period-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    text-transform: capitalize;
}

/* Month cards */
.card.shadow-sm {
    border: none;
}
