/* ==========================================================================
   layouts.css - Estilos compartidos para todos los layouts modernos
   (prefecto, docente, tutor, modern/admin)
   ========================================================================== */

/* --- Animación fadeIn --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* --- Sidebar Links --- */
.sidebar-link,
.mobile-sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #374151; /* gray-700 */
    transition: all 0.2s ease-in-out;
}

.sidebar-link:hover,
.mobile-sidebar-link:hover {
    color: #ea580c; /* orange-600 */
    background-color: #fff7ed; /* orange-50 */
    text-decoration: none;
}

.sidebar-link-active,
.mobile-sidebar-link-active {
    background-color: #fff7ed; /* orange-50 */
    color: #ea580c; /* orange-600 */
    border-right: 4px solid #f97316; /* orange-500 */
}

.sidebar-link-active:hover,
.mobile-sidebar-link-active:hover {
    background-color: #fff7ed;
    color: #ea580c;
}

/* --- Sidebar colapso: ocultar texto que desborda --- */
#sidebar.w-20 {
    overflow: hidden;
}

/* --- Sidebar text transition (para colapsar/expandir) --- */
.sidebar-text {
    transition: opacity 0.2s ease-in-out;
    white-space: nowrap;
}

/* --- Dropdown hover effects --- */
.dropdown-item:hover .dropdown-icon {
    color: #ea580c !important; /* orange-600 */
}

.dropdown-item-red:hover .dropdown-icon-red {
    color: #dc2626 !important; /* red-600 */
}

/* --- Mobile sidebar overlay & transitions --- */
#mobile-overlay {
    transition: opacity 0.3s ease-in-out;
}

#mobile-overlay.show {
    display: block !important;
}

#mobile-sidebar {
    transition: transform 0.3s ease-in-out;
}

#mobile-sidebar.show {
    transform: translateX(0);
}

/* --- Switch de modo oscuro (.theme-switch) ---
   Pastilla con sol/luna y knob deslizante. El estado lo pinta el CSS a
   partir de html[data-theme="dark"]; theme.js solo alterna el atributo y
   la cookie. En modo oscuro el switch queda excluido de la inversión
   (dark-mode.css lo re-invierte), por eso aquí los colores del estado
   oscuro se escriben literales, tal como deben verse. */
/* El selector doble .theme-toggle.theme-switch es necesario: el preflight de
   Tailwind (app.css) resetea [type='button'] a fondo transparente con la misma
   especificidad que una clase y se carga después; el compuesto lo supera.
   El selector simple cubre la variante <span> (fila del sidebar del tutor). */
.theme-switch,
.theme-toggle.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background-color: #f97316; /* orange-500 */
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.theme-switch:hover {
    background-color: #ea580c; /* orange-600 */
}

.theme-switch:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

.theme-switch i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    line-height: 1;
    color: #ffffff;
    pointer-events: none;
}

.theme-switch .theme-switch-sun {
    left: 6px;
}

.theme-switch .theme-switch-moon {
    right: 6px;
    display: none;
}

.theme-switch-knob {
    position: absolute;
    top: 3px;
    left: 27px; /* reposo a la derecha (modo claro) */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

/* Estado oscuro: track gris, luna visible, knob deslizado a la izquierda */
html[data-theme="dark"] .theme-switch {
    background-color: #374151; /* gray-700 */
}

html[data-theme="dark"] .theme-switch:hover {
    background-color: #4b5563; /* gray-600 */
}

html[data-theme="dark"] .theme-switch .theme-switch-sun {
    display: none;
}

html[data-theme="dark"] .theme-switch .theme-switch-moon {
    display: inline;
    color: #e5e7eb; /* gray-200 */
}

html[data-theme="dark"] .theme-switch-knob {
    transform: translateX(-24px);
}
