/* ================================================
   Carga Academica - Estilos personalizados
   ================================================ */

/* --- Animaciones --- */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(1rem);
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.animate-slide-out {
    animation: slide-out 0.3s ease-in forwards;
}

.animate-modal-in {
    animation: modal-in 0.2s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.2s ease-out;
}

/* --- Transiciones HTMX --- */
.htmx-settling {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.htmx-swapping {
    opacity: 0.5;
    transition: opacity 0.15s ease-in;
}

.htmx-added {
    opacity: 0;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
}

.htmx-request.htmx-indicator {
    display: inline-flex;
}

/* --- Scrollbar personalizado --- */
.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Sidebar mobile overlay --- */
#sidebar-overlay {
    transition: opacity 0.3s ease;
}

/* --- Tablas --- */
table thead th {
    white-space: nowrap;
}

/* --- Print styles para horarios --- */
@media print {
    /* Ocultar elementos no imprimibles */
    #sidebar,
    header,
    footer,
    #flash-container,
    #modal-container,
    .no-print,
    button,
    a[href="/auth/logout"] {
        display: none !important;
    }

    /* Layout sin sidebar */
    .lg\:ml-64 {
        margin-left: 0 !important;
    }

    /* Fondo blanco */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
    }

    main {
        padding: 0 !important;
    }

    /* Tablas de horario */
    .schedule-table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: avoid;
    }

    .schedule-table th,
    .schedule-table td {
        border: 1px solid #333 !important;
        padding: 4px 6px;
        font-size: 9pt;
    }

    .schedule-table th {
        background-color: #e5e7eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: bold;
    }

    /* Informacion del colegio para encabezado */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 1rem;
    }

    /* Saltos de pagina */
    .page-break {
        page-break-before: always;
    }

    /* Colores de fondo en celdas (forzar) */
    .schedule-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Ocultar print header en pantalla */
.print-header {
    display: none;
}

/* --- Focus styles accesibles --- */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Skeleton loading --- */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
