/* ================================================================= */
/* SISTEMA DE GESTIÓN ACADÉMICA - ESCUELA ANDRÉS CASTRO 2025        */
/* CSS FINAL OFICIAL */
/* ================================================================= */

/* ====================== LOGIN ====================== */
body.login-body {
    background: linear-gradient(135deg, #0227f8 0%, #eaeffa 50%, #05b4e994 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.login-header {
    background: #1e3a8a;
    color: white;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.login-header h3 { margin: 0; font-weight: 600; font-size: 1.9rem; }
.login-header p { margin: 12px 0 0; opacity: 0.95; font-size: 1.6rem; }

.login-body { padding: 4rem 2rem; }

.login-body .form-label {
    font-weight: 600;
    color: #070707;
    margin-bottom: 0.9rem;
    font-size: 1.05rem;
}

.login-body .form-control {
    height: 50px;
    border-radius: 26px !important;
    padding: 0 1.10rem;
    font-size: 1.2rem;
    border: 2.5px solid #e2e8f0;
    transition: all 0.35s ease;
    background-color: #fafafa;
}

.login-body .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.3rem rgba(59, 130, 246, 0.25);
    transform: translateY(-3px);
    background-color: white;
}

.btn-login {
    height: 56px;
    border-radius: 16px !important;
    font-size: 1.10rem;
    font-weight: 600;
    background: #1e3a8a;
    border: none;
    transition: all 0.35s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white !important;
}

.btn-login:hover {
    background: #162e73;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(30, 58, 138, 0.4);
}

input::placeholder {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #999;
}

/* ====================== AJUSTE LOGIN EN CELULAR ====================== */
@media (max-width: 576px) {
    body.login-body {
        padding: 15px !important;
    }

    .login-card {
        max-width: 100% !important;
        margin: 0 auto;
    }

    /* Reducir el encabezado azul */
    .login-header {
        padding: 1.5rem 1rem !important;
    }

    .login-header h3 {
        font-size: 1.4rem !important;
        margin: 10px 0 5px !important;
    }

    .login-header p {
        font-size: 0.95rem !important;
        margin: 0 !important;
    }

    /* Reducir el espacio del formulario */
    .login-body {
        padding: 1.5rem !important;
    }

    .login-body .form-label {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }

    .login-body .form-control {
        height: 45px !important;
        font-size: 0.95rem !important;
    }

    .btn-login {
        height: 45px !important;
        font-size: 0.95rem !important;
    }
}

/* ====================== BOTÓN VER CONTRASEÑA (LOGIN) FINAL ====================== */
.password-wrapper {
    position: relative;
    padding-right: 0; /* Evita que el contenedor empuje el botón */
}

.toggle-password {
    position: absolute;
    top: 55%;
    right: 15px;
    transform: translateY(-0%);
    background: transparent;
    border: 2px solid #6c757d;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
}

/* ELIMINAMOS la regla que movía el botón cuando el input tenía foco */
.form-control:focus ~ .toggle-password {
    transform: translateY(-1%); /* Se queda fijo en el centro SIEMPRE */
}

.toggle-password:hover {
    border-color: #1976d2;
    color: #1976d2;
}

.toggle-password.active {
    border-color: #1976d2;
    color: #1976d2;
    background-color: rgba(25, 118, 210, 0.1);
}

.toggle-password svg {
    pointer-events: none;
}
/* ====================== GENERAL ====================== */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
}

body.bg-light { background-color: #f8f9fa !important; }

/* ====================== SIDEBAR ====================== */
.sidebar {
    background: linear-gradient(180deg, #0d47a1, #1976d2);
    min-height: 100vh;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    z-index: 1040;
}

/* Enlaces del menú (Optimizado para PC y Tablet) */
.sidebar .nav-link {
    color: #e3f2fd;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 4px 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Iconos del menú */
.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
}

/* Títulos de sección (Académico, Administración, etc.) */
.sidebar h6 {
    letter-spacing: 1px;
    padding-left: 20px;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Tarjeta de usuario en sidebar */
.user-card {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.3);
    transition: transform 0.3s;
    margin: 0 12px;
}

.user-card:hover { transform: translateY(-5px); }

/* ====================== AJUSTES MÓVILES (SIDEBAR) ====================== */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        overflow-y: auto;
        padding: 20px 10px;
    }

    .sidebar.active {
        left: 0;
    }

    /* Enlaces más grandes y fáciles de tocar en móvil */
    .sidebar .nav-link {
        padding: 14px 16px;
        font-size: 1rem;
        margin: 6px 8px;
    }

    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        transform: translateX(0); /* Se mantiene fijo para no verse tembloroso */
    }

    .sidebar h6 {
        padding-left: 16px;
    }
}

/* ====================== TARJETAS ====================== */
.card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18) !important;
}

.card-icon {
    font-size: 4.5rem;
    opacity: 0.15;
    position: absolute;
    right: 20px;
    bottom: 10px;
}

/* Colores por rol */
.bg-admin { background: linear-gradient(135deg, #42a5f5, #1976d2) !important; }
.bg-maestro { background: linear-gradient(135deg, #66bb6a, #43a047) !important; }
.bg-estudiante { background: linear-gradient(135deg, #ffa726, #ff8f00) !important; }

/* Ajustes de tarjetas en móviles */
@media (max-width: 576px) {
    .card-body {
        padding: 1.2rem !important;
    }
    .card h3, .card h4 {
        font-size: 1.2rem !important;
    }
    .card p {
        font-size: 0.85rem !important;
    }
}
/* ====================== BOTONES ====================== */
.btn-success {
    background: #43a047;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #388e3c;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 20px rgba(67, 160, 71, 0.4);
}

.btn-primary {
    background: #1976d2;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
}

.btn-warning, .btn-danger {
    border-radius: 50px;
}

/* ====================== TABLAS ====================== */
.table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.table thead {
    background: #0d47a1;
    color: white;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: #e3f2fd !important;
    transition: all 0.2s;
}

/* ====================== BADGES ====================== */
.badge-admin { background-color: #dc3545 !important; }
.badge-maestro { background-color: #0d6efd !important; }
.badge-estudiante { background-color: #198754 !important; }

.badge-insert { background-color: #198754 !important; }
.badge-update { background-color: #ffc107 !important; color: #212529 !important; }
.badge-delete { background-color: #dc3545 !important; }

.badge-aprobado { background-color: #28a745 !important; }
.badge-reprobado { background-color: #dc3545 !important; }

/* ====================== NOTAS Y HORARIO ====================== */
.nota-aprobado { background-color: #d4edda !important; color: #155724 !important; }
.nota-reprobado { background-color: #f8d7da !important; color: #721c24 !important; }

.horario-table th {
    background-color: #0d6efd;
    color: white;
    font-weight: 600;
}

.materia { font-weight: bold; color: #0d6efd; }
.profesor { font-size: 0.85rem; color: #555; }
.hora { background-color: #f8f9fa; font-weight: bold; }

/* ====================== RELOJ Y FECHA ====================== */
#reloj {
    font-size: 2.8rem;
    font-weight: bold;
    color: #1976d2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}



/* ====================== INGRESAR NOTAS ====================== */
.card-grado {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.card-header-grado {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    padding: 16px 22px;
    color: white;
}

.badge-aula {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
}

.fila-activa {
    background-color: #f0fdf4 !important;
}

.fila-inactiva {
    opacity: 0.7;
}

.btn-ingresar {
    min-width: 145px;
    border-radius: 50px;
    font-weight: 600;
}

.resumen-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform 0.25s ease;
}

.resumen-card:hover {
    transform: translateY(-5px);
}

.resumen-numero {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.table-notas th {
    font-weight: 600;
    background-color: #f1f5f9;
}

/* Fondo general de la página de notas */

body.bg-notas {
    background: linear-gradient(135deg, #f0f7ff 0%, #fef3e8 50%, #f5f9ff 100%);
    min-height: 100vh;
}

/* ====================== DETALLE DE NOTAS ====================== */
.notas-header {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    color: white;
    border-radius: 14px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(13, 71, 161, 0.25);
}

.notas-header h2 {
    margin-bottom: 5px;
    font-weight: 700;
}

.tabla-notas-detalle {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.tabla-notas-detalle thead {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: white;
}

.tabla-notas-detalle th {
    font-weight: 600;
    padding: 14px 12px;
    text-align: center;
}

.tabla-notas-detalle td {
    padding: 12px;
    vertical-align: middle;
}

.input-nota {
    max-width: 100px;
    margin: 0 auto;
    text-align: center;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    transition: all 0.25s ease;
}

.input-nota:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

.btn-guardar-notas {
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(67, 160, 71, 0.3);
    transition: all 0.3s ease;
}

.btn-guardar-notas:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 160, 71, 0.4);
}

.info-profesor {
    background: #e3f2fd;
    border-left: 5px solid #1976d2;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}


/* ====================== CAMBIAR CONTRASEÑA ====================== */
.card-password {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(19, 2, 253, 0.08);
}

.card-password .card-header {
    background: linear-gradient(135deg, #1976d2, #1976d2);
    color: rgb(1, 24, 1);
    padding: 16px 22px;
}

.form-password .form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 12px 15px;
    transition: all 0.25s ease;
}

.form-password .form-control:focus {
    border-color: #6406fc;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

.btn-guardar-password {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(238, 240, 238, 0.3);
    transition: all 0.3s ease;
}

.btn-guardar-password:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(230, 69, 6, 0.4);
}

/* ====================== MENÚ RESPONSIVE ====================== */
sidebar {
    transition: all 0.3s ease;
}

/* Botón hamburguesa (solo visible en móvil) */
.btn-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;
    background: #0d47a1;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Overlay oscuro cuando el menú está abierto en móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1030;
}

.sidebar-overlay.active {
    display: block;
}

/* En pantallas pequeñas (celulares y tablets) */
@media (max-width: 991.98px) {
    .btn-menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1040;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    /* El contenido principal se ajusta para dejar espacio al botón */
    .col-lg-9.col-xl-10 {
        width: 100% !important;
        margin-left: 0 !important;
        padding-top: 70px !important; /* Baja el contenido para dejar espacio al botón */
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Ajusta el título para que no choque con el botón */
    .col-lg-9.col-xl-10 h1 {
        padding-left: 60px !important;
        text-align: left !important;
    }
}

/* ====================== CARRUSEL ====================== */
.carrusel-img {
    height: 400px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 991.98px) {
    .carrusel-img {
        height: 220px;
    }
}

@media (max-width: 575.98px) {
    .carrusel-img {
        height: 180px;
    }
}

/* ====================== AJUSTES FINALES PARA MÓVILES Y TABLETAS ====================== */

/* Reducir el tamaño de los títulos en pantallas pequeñas */
@media (max-width: 768px) {
    .display-5 {
        font-size: 1.8rem !important;
    }
    
    h1, h2, h3, h4 {
        line-height: 1.3 !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    /* Ajustar los títulos de las tarjetas */
    .card h3 {
        font-size: 1.3rem !important;
    }

    /* Espaciado y centrado en el contenido del dashboard */
    .col-lg-9.col-xl-10 {
        padding: 15px !important;
    }
    
    .p-4.p-md-5 {
        padding: 1rem !important;
    }
    
    /* Ajustar fecha y hora */
    .card .fs-3 {
        font-size: 1.4rem !important;
    }
    
    /* Ajustar textos pequeños */
    .text-muted, .small {
        font-size: 0.85rem !important;
    }
}

/* Para tabletas (pantallas medianas) */
@media (max-width: 991.98px) {
    .display-5 {
        font-size: 2.2rem !important;
    }
}

/* Evitar que las tarjetas tengan padding excesivo en móviles */
@media (max-width: 576px) {
    .card-body {
        padding: 1.2rem !important;
    }
    .text-center {
        text-align: center !important;
    }
}