/* =====================================================
   AGENDA ESCOLAR – ESTILOS COMPLETOS
   ===================================================== */


/* =====================================================
   CABECERA AGENDA (TÍTULO + DESCRIPCIÓN)
   ===================================================== */

.sa-main--agenda .sa-main__header {
    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 1200px;
    margin: 0 auto 2rem;
    text-align: center;
}

/* Forzamos que título y subtítulo ocupen todo el ancho */
.sa-main--agenda .sa-main__title,
.sa-main--agenda .sa-main__subtitle {
    width: 100%;
    text-align: center;
}


/* =====================================================
   CONTENEDOR DEL CALENDARIO
   ===================================================== */

#sa-agenda-calendar {
    margin-top: 5px;
}


/* =====================================================
   FULLCALENDAR – AJUSTES GENERALES
   ===================================================== */

/* Ocultamos la barra superior nativa de FullCalendar */
.fc-toolbar {
    display: none;
}

/* Título de cada mes (Septiembre, Octubre, etc.) */
.fc-multimonth-title {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: capitalize;
}

/* Cabecera de días (lun, mar, mié...) */
.fc-col-header-cell-cushion {
    font-size: 11px;
    padding: 4px 0;
}

/* Número del día */
.fc-daygrid-day-number {
    font-size: 12px;
    padding: 2px;
    position: relative;
    z-index: 2;
}

/* Altura mínima de cada celda de día */
.fc-daygrid-day-frame {
    min-height: 40px;
}


/* =====================================================
   DÍAS CON EVENTO
   ===================================================== */

/* Día que tiene evento (color por tipo) */
.fc-daygrid-day-frame.sa-dia-con-evento {
    background-color: var(--sa-bg);
    border-radius: 4px;
    cursor: pointer;
    transition: filter .2s ease;
}

/* Efecto hover en días con evento */
.fc-daygrid-day-frame.sa-dia-con-evento:hover {
    filter: brightness(0.95);
}

/* Eliminamos sombras y outlines innecesarios */
.fc-daygrid-day,
.fc-daygrid-day-frame {
    box-shadow: none !important;
    outline: none !important;
}

/* Ocultamos completamente los eventos nativos */
.fc-event {
    display: none !important;
}

/* Quitamos el fondo del día actual para que no se confunda con eventos */
.fc-day.fc-day-today {
    background-color: transparent !important;
}

/* Borde fino entre días */
.fc-daygrid-day {
    border: 1px solid rgba(0,0,0,0.08);
}

/* Días fuera del mes actual */
.fc-day-disabled {
    background: #f5f5f5;
}


/* =====================================================
   MODAL DE EVENTOS DEL DÍA
   ===================================================== */

/* Fondo del modal */
.sa-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    z-index: 9999;
}

/* Modal activo */
.sa-modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenido del modal */
.sa-modal__content {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

/* Botón de cerrar */
.sa-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
}

/* Título del modal */
#sa-modal-titulo {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Evento dentro del modal */
.sa-evento-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.sa-evento-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sa-evento-content strong {
    font-size: 15px;
}

.sa-evento-tipo {
    font-size: 12px;
    opacity: 0.7;
    margin: 2px 0 6px;
    text-transform: capitalize;
}

.sa-evento-desc {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}


/* =====================================================
   MULTI-MONTH (ESCRITORIO) – TARJETAS DE MESES
   ===================================================== */

/* Tarjeta de cada mes */
.fc-multimonth-month {
    position: relative;
    padding: 12px;
    margin-bottom: 20px;
}

/* Fondo tipo tarjeta */
.fc-multimonth-month::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    z-index: 0;
}

/* Contenido del mes por encima del fondo */
.fc-multimonth-month > * {
    position: relative;
    z-index: 1;
}

/* Fondo transparente para grid interno */
.fc-multimonth-month .fc-daygrid,
.fc-multimonth-month .fc-col-header {
    background: transparent;
}

/* Quitamos bordes grandes exteriores */
.fc-multimonth,
.fc-multimonth-months,
.fc-scrollgrid {
    border: none !important;
}


/* =====================================================
   DAYGRID MÓVIL / TABLET – TARJETA ÚNICA
   ===================================================== */

.fc-dayGridMonth-view {
    position: relative;
    padding: 16px;
}

/* Fondo tipo tarjeta */
.fc-dayGridMonth-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    z-index: 0;
}

.fc-dayGridMonth-view > * {
    position: relative;
    z-index: 1;
}

/* Ajustes de cabecera */
.fc-dayGridMonth-view .fc-header-toolbar {
    margin-bottom: 12px;
}

.fc-dayGridMonth-view .fc-toolbar-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: capitalize;
}

/* Botones navegación */
.fc-dayGridMonth-view .fc-button {
    background: #2c3e50;
    border: none;
    border-radius: 6px;
}

.fc-dayGridMonth-view .fc-button:hover {
    background: #1f2d3a;
}

/* Ajustes visuales finos */
.fc-dayGridMonth-view .fc-col-header {
    margin-bottom: 0 !important;
}

.fc-dayGridMonth-view .fc-scrollgrid-section-body {
    border-top: none !important;
}

.fc-dayGridMonth-view .fc-daygrid-body {
    margin-top: -2px;
}

.fc-dayGridMonth-view .fc-scrollgrid {
    border-left: 1px solid rgba(0,0,0,0.08) !important;
}


/* =====================================================
   LEYENDA DE LA AGENDA
   ===================================================== */

#sa-agenda-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 0;
    margin-left: auto;     /* Empuja la leyenda a la derecha */
    width: fit-content;    /* Ajusta al contenido */
}

/* Item individual de la leyenda */
.sa-agenda-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* Cuadro de color de la leyenda */
.sa-agenda-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}


/* =====================================================
   ORDEN LEYENDA / CALENDARIO (RESPONSIVE)
   ===================================================== */

/* Contenedor principal de la agenda */
.sa-main--agenda {
    display: flex;
    flex-direction: column;
}

/* Escritorio: leyenda arriba, calendario debajo */
#sa-agenda-legend {
    order: 1;
}

#sa-agenda-calendar {
    order: 2;
}

/* Tablet y móvil: calendario arriba, leyenda debajo */
@media (max-width: 1024px) {

    #sa-agenda-calendar {
        order: 1;
    }

    #sa-agenda-legend {
        order: 2;
        margin-top: 24px;
    }
}
