/* ==========================================================================
   ACADEMIAQR - TEACHER STUDENT MANAGEMENT DECK & 1-TAP TELEGRAM AUTH
   Estilos modernos con paleta Tailwind/Fintech, glassmorphism y micro-animaciones
   ========================================================================== */

/* --- MODAL DE ESPERA PUSH TELEGRAM (1-TAP) --- */
.push-auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: pushFadeIn 0.25s ease-out;
}

@keyframes pushFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.push-auth-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.8rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.push-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
}

.push-radar-wrap {
    width: 84px;
    height: 84px;
    margin: 0.5rem auto 1.2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.push-radar-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.25);
    animation: radarPulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.push-radar-pulse-2 {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.15);
    animation: radarPulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite 0.6s;
}

@keyframes radarPulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.4); opacity: 0; }
}

.push-radar-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
    position: relative;
    z-index: 2;
}

.push-auth-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.push-auth-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.45;
    margin-bottom: 1.2rem;
}

.push-target-student-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-align: left;
    margin-bottom: 1.3rem;
}

.push-student-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0284c7;
}

.push-student-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.push-student-sub {
    font-size: 0.76rem;
    color: #64748b;
}

.push-instructions-pill {
    background: #eff6ff;
    border: 1px dashed #93c5fd;
    color: #1e40af;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.push-auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.push-auth-close:hover {
    color: #0f172a;
}

/* --- TOAST FLOTANTE DE APROBACIÓN 1-TAP --- */
.push-toast-1tap {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100002;
    background: #0f172a;
    border: 1.5px solid #38bdf8;
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    box-shadow: 0 25px 50px -12px rgba(2, 132, 199, 0.45);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.push-toast-1tap.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.btn-1tap-approve {
    width: 100%;
    margin-top: 0.8rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: transform 0.15s, background 0.15s;
}

.btn-1tap-approve:hover {
    transform: scale(1.02);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ==========================================================================
   TEACHER STUDENT MANAGEMENT DECK (EL MENÚ DEL MAESTRO)
   ========================================================================== */
.teacher-deck-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: pushFadeIn 0.2s ease-out;
}

.teacher-deck-modal {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    position: relative;
}

/* Header del Docente Activo */
.teacher-deck-topbar {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    color: white;
    padding: 0.9rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.teacher-profile-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.teacher-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #34d399;
    object-fit: cover;
}

.teacher-chip-name {
    font-size: 0.88rem;
    font-weight: 700;
}

.teacher-chip-role {
    font-size: 0.72rem;
    color: #a7f3d0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.teacher-chip-role::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.teacher-deck-close {
    background: transparent;
    border: none;
    color: #d1fae5;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.teacher-deck-close:hover {
    color: white;
}

/* Hero del Estudiante Gestionado */
.teacher-student-hero {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.teacher-student-info-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.teacher-student-avatar {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #0284c7;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
}

.teacher-student-name {
    font-size: 1.12rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.2rem 0;
}

.teacher-student-meta {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Barra de Pestañas de Gestión Rápida */
.teacher-deck-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 0.4rem 0.6rem;
    gap: 0.35rem;
    overflow-x: auto;
    border-bottom: 1px solid #e2e8f0;
}

.teacher-deck-tab {
    background: transparent;
    border: none;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.teacher-deck-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.teacher-deck-tab.is-active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.teacher-deck-tab.tab-grade.is-active { color: #2563eb; }
.teacher-deck-tab.tab-attendance.is-active { color: #059669; }
.teacher-deck-tab.tab-conduct.is-active { color: #d97706; }
.teacher-deck-tab.tab-task.is-active { color: #7c3aed; }
.teacher-deck-tab.tab-modules.is-active { color: #0284c7; }

/* Contenedor del Cuerpo de Paneles */
.teacher-deck-body {
    padding: 1.4rem;
    overflow-y: auto;
    flex: 1;
}

.teacher-panel {
    display: none;
    animation: pushFadeIn 0.2s ease-out;
}

.teacher-panel.is-active {
    display: block;
}

/* Formularios y Componentes del Deck */
.deck-form-group {
    margin-bottom: 1.1rem;
}

.deck-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.deck-form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.92rem;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.deck-form-control:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Score Input de Calificación */
.grade-score-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.grade-score-input {
    width: 90px;
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    color: #0284c7;
    border: 2px solid #0284c7;
    border-radius: 12px;
    padding: 0.3rem;
    outline: none;
}

.grade-score-slider {
    flex: 1;
    accent-color: #0284c7;
    cursor: pointer;
}

.grade-status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

/* Selector de Asistencia 1-Tap */
.att-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.att-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    transition: all 0.15s ease;
}

.att-card-btn i {
    font-size: 1.4rem;
}

.att-card-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.att-card-btn.selected-present {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.att-card-btn.selected-late {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.att-card-btn.selected-excused {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.att-card-btn.selected-absent {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

/* Selector de Tipos de Conducta */
.conduct-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.conduct-pill-btn {
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    padding: 0.65rem 0.4rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.conduct-pill-btn.is-active-merit {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.conduct-pill-btn.is-active-warning {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.conduct-pill-btn.is-active-infraction {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

/* Accesos a Módulos de Gestión */
.modules-deck-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.module-deck-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.15s ease;
}

.module-deck-card:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.module-deck-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.module-deck-title {
    font-size: 0.88rem;
    font-weight: 700;
}

.module-deck-sub {
    font-size: 0.72rem;
    color: #64748b;
}

/* Botón de Acción Principal en Formularios */
.btn-deck-submit {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s, opacity 0.15s;
}

.btn-deck-submit:hover {
    transform: scale(1.01);
    opacity: 0.95;
}

/* Botón flotante para activar modo docente desde carnet móvil */
.btn-carnet-teacher-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    color: #ffffff;
    border: 1.5px solid #10b981;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(6, 78, 59, 0.25);
    margin-top: 0.8rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-carnet-teacher-mode:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(6, 78, 59, 0.35);
}

@media (max-width: 600px) {
    .teacher-deck-modal {
        max-height: 95vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        position: fixed;
        bottom: 0;
    }
    .att-quick-grid,
    .modules-deck-grid {
        grid-template-columns: 1fr;
    }
}
