/* ==========================================================================
   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: 0 !important;
}

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: sticky;
    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: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-bottom .navbar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    gap: 2px;
}

.navbar-bottom .nav-link {
    color: var(--text-main) !important;
    font-weight: 600;
    font-size: 0.77rem;
    padding: 8px 8px !important;
    text-transform: uppercase;
    letter-spacing: 0.15px;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap !important;
    border-radius: 4px;
}

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

.navbar-bottom .nav-link:hover {
    color: var(--primary) !important;
    background-color: rgba(62, 142, 222, 0.08);
}

.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: 700;
    background-color: rgba(62, 142, 222, 0.08);
}

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

/* 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: 1400px) {
    .navbar-bottom .nav-link {
        font-size: 0.74rem;
        padding: 7px 6px !important;
        gap: 4px;
    }
    .navbar-bottom .nav-link i {
        font-size: 0.86rem;
    }
}

@media (max-width: 1200px) {
    .navbar-bottom .nav-link {
        font-size: 0.72rem;
        padding: 6px 5px !important;
        gap: 3px;
    }
}

@media (max-width: 991.98px) {
    body {
        padding-top: 0 !important;
    }
    
    .brand-title {
        font-size: 1rem;
    }
    
    .brand-subtitle {
        font-size: 0.72rem;
    }
    
    .navbar-bottom .navbar-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 2px;
    }
    
    .navbar-bottom .nav-link {
        padding: 9px 12px !important;
        font-size: 0.85rem;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-top: 0 !important;
    }
    
    .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;
    }
}

/* ==========================================================================
   ESTANDARIZACIÓN VISUAL Y SISTEMA DE DISEÑO INSTITUCIONAL "FUNDACIÓN SAMUEL"
   ========================================================================== */

/* 1. Sobreescritura Corporativa de Bootstrap */
.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

/* 2. Botones Estándar Institucionales */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(62, 142, 222, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(62, 142, 222, 0.25);
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
    transform: translateY(-1px);
}

.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.btn-outline-secondary {
    color: #64748b;
    border-color: #cbd5e1;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

/* 3. Banner de Encabezado Institucional Samuel */
.samuel-header-banner {
    background: linear-gradient(135deg, #1b3d6d 0%, #3e8ede 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 22px 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(62, 142, 222, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.samuel-header-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.samuel-header-banner h1, 
.samuel-header-banner h2, 
.samuel-header-banner h3, 
.samuel-header-banner h4 {
    color: #ffffff !important;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.samuel-header-banner p {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.samuel-header-banner .banner-icon {
    font-size: 2rem;
    color: #f5a623; /* Amarillo/Dorado institucional Samuel */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* 4. Tarjetas de Filtro y Contenido */
.card-filter-samuel, .card-samuel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card-filter-samuel:hover, .card-samuel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card-filter-samuel .card-body, .card-samuel .card-body {
    padding: 20px 24px;
}

/* 5. Inputs y Selects Focus Halo */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(62, 142, 222, 0.18);
    outline: none;
}

/* 6. Tablas Institucionales */
.table-samuel thead th,
.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding-top: 12px;
    padding-bottom: 12px;
}

.table-hover tbody tr:hover {
    background-color: rgba(62, 142, 222, 0.035);
}

/* 7. Badges y Píldoras */
.badge-samuel-gold {
    background-color: #fff8e1;
    color: #b78103;
    border: 1px solid #ffe082;
    font-weight: 600;
}

.badge-samuel-blue {
    background-color: rgba(62, 142, 222, 0.1);
    color: var(--primary);
    border: 1px solid rgba(62, 142, 222, 0.2);
    font-weight: 600;
}

/* 8. Paginación Uniforme */
.pagination .page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(62, 142, 222, 0.3);
}

.pagination .page-link {
    color: var(--primary);
    border-color: #e2e8f0;
    font-weight: 500;
}

.pagination .page-link:hover {
    background-color: rgba(62, 142, 222, 0.08);
    color: var(--primary-hover);
}