/*
 * style.css
 * ✅ REDISEÑADO: Flat Design tipo Google
 * Estilos unificados para todo el Sistema de Feedback Docente (SFD)
 */

/* --- Fuentes y Base --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #fafafa;
    color: #202124;
    line-height: 1.6;
}

/* --- Loader Global (de auth-guard) --- */
body.loading::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9998;
}
body.loading::after {
    content: 'Verificando acceso...';
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    font-weight: 500;
    font-size: 1rem;
    color: #5f6368;
}

/* --- Colores de Marca (SGI) --- */
.brand-bg { background-color: #c80000 !important; }
.brand-bg-hover:hover { background-color: #a00000 !important; }
.brand-text { color: #c80000 !important; }
.brand-bg-light { background-color: #fce8e8 !important; }

/* --- ESTILOS DE FORMULARIO UNIFICADOS (Flat Design) --- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    display: block;
    width: 100%;
    height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #202124;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Textarea altura auto */
textarea {
    height: auto;
    min-height: 5rem;
    resize: vertical;
}

/* Inputs de solo lectura */
input:read-only,
select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Estado de Foco (Focus) - Flat */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #c80000;
    background-color: #ffffff;
    box-shadow: none;
}

/* Hover suave */
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="time"]:hover:not(:focus),
input[type="tel"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: #5f6368;
}

/* --- Labels --- */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
}

/* --- Botones (Flat Design) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.25px;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus {
    outline: none;
}

.btn-primary {
    color: white;
    background-color: #c80000;
}
.btn-primary:hover {
    background-color: #a00000;
}
.btn-primary:disabled {
    background-color: #dadce0;
    color: #80868b;
    cursor: not-allowed;
}

.btn-secondary {
    color: #5f6368;
    background-color: #ffffff;
    border: 1px solid #dadce0;
}
.btn-secondary:hover {
    background-color: #f8f9fa;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* --- Botones de Radio (Para Frecuencia) - Flat --- */
.freq-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
    background-color: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.freq-radio-label:hover {
    border-color: #5f6368;
    background-color: #f8f9fa;
}

.freq-radio-input:checked + .freq-radio-label {
    color: #c80000;
    background-color: #fce8e8;
    border-color: #c80000;
    border-width: 2px;
}

.freq-radio-input {
    display: none;
}

/* --- Checkboxes de Días Personalizados (Para Chino Privado) --- */
.dia-checkbox-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 2px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
    min-height: 70px;
}

.dia-checkbox-label:hover {
    border-color: #5f6368;
    background-color: #f8f9fa;
}

.dia-checkbox-label:has(.dia-checkbox-input:checked) {
    background-color: #fce8e8;
    border-color: #c80000;
    border-width: 2px;
}

.dia-checkbox-label:has(.dia-checkbox-input:checked) span {
    color: #c80000;
    font-weight: 600;
}

.dia-checkbox-input {
    margin-bottom: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c80000;
}

/* --- Componente de Búsqueda de Aulas --- */
#novedad_aula_search_container,
#eval_aula_search_container {
    position: relative;
}

#novedad_aula_dropdown,
#eval_aula_dropdown {
    position: absolute;
    z-index: 50;
    width: 100%;
    margin-top: 0.25rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 15rem;
    overflow-y: auto;
}

#novedad_aula_dropdown div,
#eval_aula_dropdown div {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

#novedad_aula_dropdown div:last-child,
#eval_aula_dropdown div:last-child {
    border-bottom: none;
}

#novedad_aula_dropdown div:hover,
#eval_aula_dropdown div:hover {
    background-color: #eff6ff;
}

#novedad_aula_clear,
#eval_aula_clear {
    pointer-events: auto !important;
    cursor: pointer;
}

#novedad_aula_clear:hover i,
#eval_aula_clear:hover i {
    color: #374151;
}

/* --- Tarjetas (Cards) - Flat --- */
.card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- Tablas - Flat Design --- */
table {
    border-collapse: collapse;
    width: 100%;
}

thead {
    background-color: #f8f9fa;
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: #202124;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* --- Badges - Flat --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 16px;
    letter-spacing: 0.25px;
}

/* --- Estados - Flat Colors --- */
.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-pending {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status-completed {
    background-color: #f5f5f5;
    color: #616161;
}

/* --- Alertas - Flat --- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-left: 4px solid;
}

.alert-error {
    background-color: #fce8e8;
    border-left-color: #c80000;
    color: #5f0000;
}

.alert-success {
    background-color: #e8f5e9;
    border-left-color: #2e7d32;
    color: #1b5e20;
}

.alert-warning {
    background-color: #fff9e6;
    border-left-color: #f9a825;
    color: #5f4c00;
}

.alert-info {
    background-color: #e3f2fd;
    border-left-color: #1565c0;
    color: #003d82;
}

/* --- Modal - Flat --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Sidebar Navigation - Flat --- */
nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #5f6368;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-bottom: 0.25rem;
}

nav a:hover {
    background-color: #f8f9fa;
    color: #202124;
}

nav a.nav-link-active {
    background-color: #fce8e8;
    color: #c80000;
}

/* --- Iconos Lucide --- */
.lucide {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    display: inline-block;
}

/* --- Spacing Utilities (Google-like) --- */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* --- Estrellas de Calificación (Encuesta) --- */
.star {
    cursor: pointer;
    transition: all 0.2s ease;
    color: #dadce0;
}

.star:hover,
.star.hovered {
    color: #fbbc04;
    transform: scale(1.1);
}

.star.selected {
    color: #fbbc04;
}

/* --- Mejoras de Accesibilidad --- */
*:focus-visible {
    outline: 2px solid #c80000;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #c80000;
    outline-offset: 2px;
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5f6368;
}/* Estilos adicionales para Generar Encuesta */

/* Botón de éxito (cuando se copia) */
.btn-success {
    background-color: #10b981;
    color: white;
}
.btn-success:hover {
    background-color: #059669;
}

/* Animación suave para el modal */
.modal-overlay {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

/* Mejorar el aspecto del botón de emoji */
.copy-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.copy-quick-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

.copy-quick-btn:active {
    transform: scale(0.95);
}

/* ========================================= */
/* --- FASE 3: Componentes UI Globales --- */
/* ========================================= */

/* --- Contenedor de Toasts --- */
#sfd-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 320px;
    width: 90%;
}

.toast-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-left-width: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: white;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
}

.toast-item p {
    flex: 1;
}

.toast-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.toast-close-btn:hover {
    opacity: 1;
}

/* Variantes de Toast (usando clases de colores ya definidos) */
.toast-success { border-color: #2e7d32; }
.toast-error { border-color: #c80000; }
.toast-info { border-color: #1565c0; }

/* --- Modal Global Reutilizable --- */
/* 🛑 ELIMINADO: Se movieron estas propiedades a clases de Tailwind en el HTML
#sfd-global-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s ease;
}
*/

.sfd-modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.2s ease; /* Usar animación existente */
}

.sfd-modal-icon-bg {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

/* Botones de Modal */
.sfd-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Colores de Botones de Confirmación */
.btn-danger {
    color: white;
    background-color: #c80000;
}
.btn-danger:hover {
    background-color: #a00000;
}
.btn-success {
    color: white;
    background-color: #2e7d32;
}
.btn-success:hover {
    background-color: #1b5e20;
}
.btn-warning {
    color: #4d2d00;
    background-color: #f9a825;
}
.btn-warning:hover {
    background-color: #f59e0b;
}

/* ========================================= */
/* --- Menú Hamburguesa (Móvil)           --- */
/* ========================================= */

/* Topbar fija en móvil */
#mobile-topbar {
    border-bottom: 1px solid #e0e0e0;
}

/* Drawer: transición suave */
#mobile-drawer {
    will-change: transform;
}

/* Link activo en el drawer móvil */
#mobile-drawer nav a.nav-link-active {
    background-color: #fce8e8;
    color: #c80000;
}

/* Asegurar que el body no haga scroll cuando el drawer está abierto */
body.drawer-open {
    overflow: hidden;
}
