/*
Nombre del archivo: frontend/modulos/curso-concreto/calendario/calendario.css
*/

/* ============================================================
   CALENDARIO — ESTILOS BASE
   ============================================================ */

.bazan-calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bazan-calendario-header h3 {
    margin: 0;
    font-size: 26px;
    line-height: 1;
}

.bazan-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.bazan-cal-dia-titulo {
    text-align: center;
    font-weight: bold;
    padding: 6px 0;
}

/* ============================================================
   BOTONES PARA CAMBIAR DE MES
   ============================================================ */

.bazan-calendario-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.bazan-calendario-header .bazan-cal-prev,
.bazan-calendario-header .bazan-cal-next {
    font-size: 32px;
    font-weight: 200;
    color: #333;
    cursor: pointer;
    padding: 6px 12px;
    line-height: 1;
    user-select: none;
    transition: color 0.15s, transform 0.15s;
}

.bazan-calendario-header .bazan-cal-prev:hover,
.bazan-calendario-header .bazan-cal-next:hover {
    color: rgb(0,127,162);
    transform: scale(1.25);
}

/* ============================================================
   CELDAS DEL CALENDARIO (ESCRITORIO)
   ============================================================ */

.bazan-cal-dia {
    background: #f4f4f4;
    border-radius: 6px;
    padding: 6px;
    min-height: 120px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: 0.15s;
    overflow: hidden;
}

.bazan-cal-dia:hover {
    background: #e8f7fb;
    transform: scale(1.02);
}

.bazan-cal-dia-vacio {
    background: #fafafa;
    cursor: default;
}

.bazan-cal-dia-vacio:hover {
    transform: none;
    background: #fafafa;
}

.bazan-cal-hoy {
    border: 2px solid rgb(0,127,162);
}

/* ============================================================
   CONTENIDO DEL DÍA
   ============================================================ */

.bazan-cal-numero {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

/* ============================================================
   TARJETA DE EVENTO (ESCRITORIO)
   ============================================================ */

.bazan-cal-evento {
    flex-grow: 1;
    background: color-mix(in srgb, var(--color-evento) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-evento) 40%, transparent);
    border-left: 6px solid var(--color-evento);
    border-radius: 6px;
    padding: 6px 8px 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    box-shadow: 0 0 6px color-mix(in srgb, var(--color-evento) 55%, transparent);
}

.bazan-cal-titulo {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bazan-cal-extracto {
    font-size: 11px;
    opacity: 0.75;
    line-height: 1.25;
    max-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================================
   RESPONSIVE (600px)
   ============================================================ */

@media (max-width: 600px) {
    .bazan-cal-dia {
        min-height: 100px;
        padding: 6px;
    }

    .bazan-calendario-header h3 {
        font-size: 18px;
    }
}

/* ============================================================
   MODAL PARA EVENTOS DEL CALENDARIO
   ============================================================ */

#bazan-cal-form-contenido {
    height: auto;
    min-height: 10em;
    line-height: 1.4;
    resize: vertical;
}

.bazan-cal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    z-index: 9999;
    overflow: hidden;
}

.bazan-cal-modal.visible {
    display: flex;
}

.bazan-cal-modal-contenido {
    background: #fff;
    max-width: 500px;
    width: 90%;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bazan-cal-modal-contenido h3 {
    margin-top: 0;
}

.bazan-cal-modal-fecha {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.bazan-cal-modal-texto {
    white-space: pre-line;
    line-height: 1.5;
}

/* ============================================================
   BOTONES DEL MODAL (ADMIN Y LECTURA)
   ============================================================ */

/* 1. Estilos estéticos BASE para CUALQUIER botón del modal */
.bazan-cal-modal button,
#bazan-cal-modal-cerrar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    box-sizing: border-box;
}

/* 2. Colores individuales */
#bazan-cal-form-guardar {
    background: rgb(0, 127, 162);
    color: #fff;
}

#bazan-cal-form-guardar:hover {
    background: rgb(0, 110, 140);
    transform: translateY(-1px);
}

#bazan-cal-form-eliminar {
    background: #d9534f;
    color: #fff;
}

#bazan-cal-form-eliminar:hover {
    background: #c9302c;
    transform: translateY(-1px);
}

#bazan-cal-modal-cerrar {
    background: #e0e0e0;
    color: #333;
}

#bazan-cal-modal-cerrar:hover {
    background: #d5d5d5;
    transform: translateY(-1px);
}

/* 3. Disposición MODO ALUMNO (Botón Cerrar aislado) */
#bazan-cal-modal-cerrar {
    margin: 25px auto 0 auto;
    width: fit-content;
}

/* 4. Disposición MODO ADMIN (Botonera de 3 botones) */
.bazan-cal-modal-botones {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
    width: 100%;
}

.bazan-cal-modal-botones button {
    flex: 1;
    min-height: 48px;
}

/* Reset cuando Cerrar está dentro de la botonera Admin */
.bazan-cal-modal-botones #bazan-cal-modal-cerrar {
    margin: 0 !important;
    width: auto !important;
}

/* ============================================================
   SELECTOR DE COLORES
   ============================================================ */

.bazan-cal-colores-wrapper {
    display: flex;
    gap: 8px;
    margin: 10px 0 15px 0;
}

.bazan-cal-color-opcion {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.bazan-cal-color-opcion.activo {
    border-color: #000;
}

.excel-verde   { background: #2ecc71; }
.excel-azul    { background: #3498db; }
.excel-rojo    { background: #e74c3c; }
.excel-morado  { background: #9b59b6; }
.excel-naranja { background: #e67e22; }

/* ============================================================
   LISTA INFERIOR DE EVENTOS DEL MES
   ============================================================ */

#bazan-cal-lista-eventos {
    margin-top: 25px;
}

.bazan-cal-lista-item {
    background: #fff;
    border-left: 6px solid var(--color-evento);
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: 0.15s;
}

.bazan-cal-lista-item:hover {
    background: #f9f9f9;
    transform: translateY(-1px);
}

.bazan-cal-lista-titulo {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.bazan-cal-lista-fecha {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.bazan-cal-lista-contenido {
    font-size: 14px;
    line-height: 1.45;
    margin-top: 6px;
    white-space: pre-line;
}

.bazan-cal-lista-separador {
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e5e5;
}

.bazan-cal-lista-separador h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* ============================================================
   RESPONSIVE / MEDIA QUERIES (CONSOLIDADAS)
   ============================================================ */

@media (max-width: 768px) {
    .bazan-cal-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .bazan-cal-dia,
    .bazan-cal-dia-vacio {
        aspect-ratio: 1 / 1;
        padding: 4px;
        font-size: 13px;
        position: relative;
        min-height: 0 !important;
    }

    .bazan-cal-numero {
        font-size: 14px;
        font-weight: 600;
    }

    .bazan-cal-evento {
        display: none !important;
    }

    .bazan-cal-dia-evento-movil {
        border-radius: 6px;
        background-color: var(--color-evento-movil);
        color: #fff;
    }

    .bazan-cal-dia-evento-movil::after {
        content: "";
        width: 6px;
        height: 6px;
        background: #fff;
        border-radius: 50%;
        position: absolute;
        bottom: 4px;
        right: 4px;
        opacity: 0.9;
    }

    .bazan-cal-hoy {
        outline: 2px solid rgb(0, 127, 162);
        outline-offset: 0;
        overflow: visible !important;
    }

    .bazan-cal-modal-botones {
        justify-content: center;
    }

    .bazan-cal-modal-botones button {
        flex: 1 1 45%;
    }
}

@media (max-width: 480px) {
    .bazan-cal-modal-botones {
        justify-content: space-between;
    }

    .bazan-cal-modal-botones button {
        width: 100%;
        flex: 1 1 100% !important;
    }
}

/*====================================
   DESPLAZAR FECHAS
   ============================================================ */

.bazan-cal-desplazar {
    padding: 6px 12px;
    margin-top: 10px;
    cursor: pointer;
}
