/* Estilos para el calendario de horarios */

/* ===== SOLUCIÓN PARA EVENTOS ESTRECHOS EN TIMEGRID ===== */

/* CRITICAL FIX: Forzar que eventos ocupen todo el ancho */
.fc-timegrid-event-harness {
    inset-inline-start: 0% !important;
    inset-inline-end: 0% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Evento en timeGrid con ancho completo */
.fc-timegrid-event {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    margin-bottom: 2px !important;
}

/* Forzar texto HORIZONTAL - NUNCA vertical */
.fc-timegrid-event,
.fc-timegrid-event *,
.fc-timegrid-event .fc-event-main,
.fc-timegrid-event .fc-event-title,
.fc-timegrid-event .fc-event-time {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
}

/* Contenido del evento legible */
.fc-timegrid-event .fc-event-main {
    display: block !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.fc-timegrid-event .fc-event-title {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
}

.fc-timegrid-event .fc-event-time {
    display: block !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    margin-bottom: 1px !important;
}

/* Columnas del timeGrid más anchas */
.fc-timegrid-slot-lane,
.fc-timegrid-col {
    min-width: 120px !important;
}

/* Permitir scroll horizontal si hay muchas columnas */
.fc-timegrid-body,
.fc-scrollgrid-section-body>td {
    overflow-x: auto !important;
}

/* ===== VISTA DÍA - Solo una columna, más simple ===== */
.fc-timeGridDay-view .fc-timegrid-event-harness {
    left: 5% !important;
    right: 5% !important;
}

.fc-timeGridDay-view .fc-timegrid-event {
    font-size: 0.85rem !important;
}

/* ===== VISTA MENSUAL ===== */
.fc-daygrid-event {
    white-space: normal !important;
    word-wrap: break-word !important;
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    padding: 2px 4px !important;
    margin-bottom: 2px !important;
    border-radius: 3px !important;
}

.fc-daygrid-event-harness {
    margin-bottom: 2px !important;
}

.fc-daygrid-day-frame {
    min-height: 90px !important;
}

/* ===== ESTILOS GENERALES ===== */
.fc-event {
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

.fc-event:hover {
    opacity: 0.9 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    z-index: 999 !important;
}

.fc-event-title,
.fc-event-title-container {
    font-size: inherit !important;
    line-height: inherit !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .fc-timegrid-slot-lane,
    .fc-timegrid-col {
        min-width: 80px !important;
    }

    .fc-timegrid-event {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
    }

    .fc-daygrid-event {
        font-size: 0.55rem !important;
    }
}

/* ===== COLORES DE ESTADO ===== */
.fc-event.bg-success,
.fc-event[style*="green"] {
    background-color: #28a745 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

.fc-event.bg-danger,
.fc-event[style*="red"] {
    background-color: #dc3545 !important;
    border-color: #bd2130 !important;
    color: white !important;
}

.fc-event.bg-warning,
.fc-event[style*="orange"],
.fc-event[style*="rgb(255, 193, 7)"] {
    background-color: #ffc107 !important;
    border-color: #d39e00 !important;
    color: #212529 !important;
}