/* ============================================
   ESTILOS PRINCIPALES - MINEDU KB
   Diseño profesional estilo UniSimulacro
   ============================================ */

/* === VARIABLES === */
:root {
    --primary: #1a56db;
    --primary-dark: #1242b0;
    --primary-light: #e8f0fe;
    --secondary: #059669;
    --secondary-light: #d1fae5;
    --accent: #f59e0b;
    --danger: #dc2626;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-800);
    background-color: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding-top: 80px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* === NAVBAR === */
#mainNav {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray-800) 100%);
    padding: 0.75rem 0;
    transition: var(--transition);
}

#mainNav.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-weight: 700;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    display: block;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 400;
    display: block;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background: rgba(255,255,255,0.1);
}

/* === HERO SECTION === */
.hero-section {
    background: linear-gradient(135deg, #1a56db 0%, #0f3a8e 50%, #052061 100%);
    color: white;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-badge i {
    margin-right: 0.5rem;
    color: var(--accent);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.95rem;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.25rem;
}

/* === CARDS === */
.card-custom {
    background: white;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-custom .card-body {
    padding: 1.75rem;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}

.card-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.card-icon.success {
    background: var(--secondary-light);
    color: var(--secondary);
}

.card-icon.warning {
    background: #fef3c7;
    color: var(--accent);
}

.card-icon.danger {
    background: #fee2e2;
    color: var(--danger);
}

.card-custom h5 {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.card-custom p {
    color: var(--gray-500);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* === SECTION HEADERS === */
.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header .section-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* === ESPECIALIDADES GRID === */
.especialidad-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.especialidad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.especialidad-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.especialidad-card:hover::before {
    opacity: 1;
}

.especialidad-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    background: var(--primary-light);
    color: var(--primary);
}

.especialidad-card h6 {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.especialidad-card .meta {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: auto;
    padding-top: 0.75rem;
}

/* === STATS CARDS === */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* === FORMS === */
.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    padding: 1rem 0.75rem;
    height: auto;
    transition: var(--transition);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 86, 219, 0.15);
}

.form-floating > label {
    padding: 1rem 0.75rem;
    color: var(--gray-400);
}

.form-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.form-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.form-section-subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* === BUTTONS === */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0d3594 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 86, 219, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary) 0%, #047857 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* === TABLES === */
.table-custom {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-custom thead {
    background: var(--gray-50);
}

.table-custom thead th {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--gray-200);
}

.table-custom tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.table-custom tbody tr:hover {
    background: var(--gray-50);
}

/* === BADGES === */
.badge-soft {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
}

.badge-soft-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-soft-success {
    background: var(--secondary-light);
    color: var(--secondary);
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

/* === FOOTER === */
.footer {
    background: var(--gray-900) !important;
}

.footer h6 {
    color: white;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--gray-400);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.brand-icon-footer {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    color: white !important;
    transform: translateY(-3px);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .hero-stat-number {
        font-size: 1.75rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* === LOADING SPINNER === */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;
}

/* === ALERTS === */
.alert-custom {
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.alert-custom i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* === SEARCH BAR === */
.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-bar input {
    border-radius: 50px;
    padding: 0.75rem 1.25rem 0.75rem 3rem;
    border: 2px solid var(--gray-200);
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 86, 219, 0.15);
    outline: none;
}

.search-bar i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--gray-600);
    font-weight: 600;
}