/* ==========================================================================
   SISTEMA DE DISEÑO PREMIUM - GESTION ACADEMICA (.NET 10 MVC)
   Fundación Hedwig y Robert Samuel
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Paleta de colores exactos del proyecto GestionAcademica Legacy */
    --primary: #3e8ede; /* Celeste Corporativo Original */
    --primary-hover: #2d75c7; /* Azul Corporativo Oscuro Original */
    --primary-light: rgba(62, 142, 222, 0.08);
    --secondary: #5e5e5e;
    --success: #28a745; /* Verde estándar original */
    --danger: #d9534f; /* Rojo de peligro original */
    --warning: #f0ad4e; /* Naranja/amarillo original */
    --info: #5bc0de; /* Info original */
    --background: #ffffff; /* Fondo blanco idéntico */
    --card-bg: #ffffff;
    --border: #e0e0e0; /* Borde original */
    --text-main: #5e5e5e; /* Texto original */
    --text-muted: #888888;
    
    /* Gradientes basados en los colores corporativos originales */
    --grad-primary: linear-gradient(135deg, #3e8ede 0%, #2d75c7 100%);
    --grad-success: linear-gradient(135deg, #28a745 0%, #218838 100%);
    --grad-dark: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%); /* Footer original */
    --grad-premium: linear-gradient(135deg, #3e8ede 0%, #2d75c7 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08); /* Sombra original */
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   ESTILOS GENERALES Y TIPOGRAFÍA
   ========================================================================== */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    padding-top: 155px; /* Altura del navbar de 2 filas */
}

main {
    flex: 1 0 auto;
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN MODERNA Y RESPONSIVA
   ========================================================================== */
.navbar-custom {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

/* Fila Superior: Logo y Perfil */
.navbar-top {
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    background-color: #ffffff;
}

.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.navbar-brand-custom:hover {
    transform: scale(1.02);
    color: var(--primary);
}

.navbar-brand-custom img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    line-height: 1.2;
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Fila Inferior: Menú de Navegación */
.navbar-bottom {
    background-color: #ffffff;
    padding: 2px 0;
}

.navbar-bottom .nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 12px 16px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-bottom .nav-link i {
    font-size: 1.05rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.navbar-bottom .nav-link:hover {
    color: var(--primary) !important;
}

.navbar-bottom .nav-link:hover i {
    color: var(--primary);
}

/* Línea de selección activa en la navegación */
.navbar-bottom .nav-item.active .nav-link,
.navbar-bottom .nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.navbar-bottom .nav-item.active .nav-link::after,
.navbar-bottom .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--grad-primary);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* Menú Dropdown Estilizado */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    margin-top: 4px !important;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
}

.dropdown-item {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.dropdown-item i {
    color: var(--text-muted);
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-item:hover i {
    color: var(--primary);
}

/* Submenús en cascada en Bootstrap 5 (para Reportes) */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px !important;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Opciones de Perfil Superior */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(30, 64, 175, 0.1);
}

/* ==========================================================================
   ELEMENTOS DE INTERFAZ PREMIUM
   ========================================================================== */
.card-premium {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-premium:hover {
    box-shadow: var(--shadow-premium);
    transform: translateY(-2px);
}

.card-premium .card-header-premium {
    background: var(--grad-primary);
    color: #ffffff;
    padding: 20px 24px;
    font-weight: 700;
    border: none;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Botones con Micro-animación */
.btn-premium {
    background: var(--grad-primary);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
}

.btn-premium:hover {
    background: var(--grad-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-premium:active {
    transform: translateY(1px);
}

.btn-premium-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    font-weight: 600;
    border-radius: 6px;
    padding: 10px 22px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
}

.btn-premium-secondary:hover {
    background: var(--background);
    color: var(--primary);
    border-color: var(--primary);
}

/* Inputs de Formulario Modernos */
.form-control-premium {
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-control-premium:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

/* ==========================================================================
   WIZARD DE PASOS (SOLICITUD DE BECA)
   ========================================================================== */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background-color: var(--border);
    z-index: 1;
}

.wizard-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: center;
}

.wizard-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

.wizard-step-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

/* Estados del Paso */
.wizard-step.active .wizard-step-circle {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

.wizard-step.active .wizard-step-label {
    color: var(--primary);
    font-weight: 700;
}

.wizard-step.completed .wizard-step-circle {
    border-color: var(--success);
    background-color: var(--success);
    color: #ffffff;
}

.wizard-step.completed .wizard-step-label {
    color: var(--success);
}

/* ==========================================================================
   FOOTER PREMIUM
   ========================================================================== */
.footer-premium {
    background: var(--grad-dark);
    color: #cbd5e1;
    padding: 50px 0 30px 0;
    margin-top: 60px;
    border-top: 4px solid var(--primary);
    font-size: 0.88rem;
}

.footer-premium h5 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 22px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-premium a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-premium a:hover {
    color: #ffffff;
    transform: translateX(4px);
}

.footer-premium hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 30px 0 20px 0;
}

/* ==========================================================================
   PANTALLA DE CARGA (LOADING SCREEN)
   ========================================================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: opacity 0.3s ease;
}

.spinner-premium {
    width: 50px;
    height: 50px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVIDAD Y ADAPTACIONES PARA MÓVILES
   ========================================================================== */
@media (max-width: 991.98px) {
    body {
        padding-top: 130px; /* Navbar adaptado en tableta */
    }
    
    .brand-title {
        font-size: 1rem;
    }
    
    .brand-subtitle {
        font-size: 0.72rem;
    }
    
    .navbar-bottom .nav-link {
        padding: 8px 12px !important;
        font-size: 0.85rem;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-top: 140px; /* Navbar adaptado en móvil */
    }
    
    .navbar-top {
        padding: 8px 0;
    }
    
    .navbar-brand-custom img {
        height: 40px;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .navbar-bottom {
        padding: 5px 0;
    }
    
    .navbar-bottom .navbar-nav {
        background-color: #ffffff;
        border-radius: 8px;
        padding: 10px;
        box-shadow: var(--shadow-lg);
        margin-top: 10px;
        border: 1px solid var(--border);
    }
    
    .navbar-bottom .nav-link {
        padding: 10px 15px !important;
    }
    
    .navbar-bottom .nav-item.active .nav-link::after,
    .navbar-bottom .nav-link.active::after {
        left: 0;
        right: auto;
        width: 4px;
        height: auto;
        top: 10px;
        bottom: 10px;
        border-radius: 4px;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: none;
        background-color: var(--background);
        padding-left: 15px;
    }
    
    .dropdown-submenu .dropdown-menu {
        position: static;
        margin-left: 15px !important;
        box-shadow: none;
    }
    
    .wizard-step-label {
        display: none; /* Ocultar texto en móviles para que quepa */
    }
    
    .wizard-steps::before {
        left: 20px;
        right: 20px;
    }
}