/* =========================================
   ACTRACK - SISTEMA ACADÉMICO
   Estilos Globales V8 (Premium & Responsivo)
   ========================================= */

:root {
    /* Paleta de Colores Corporativa */
    --primary: #2b4e84;       
    --primary-dark: #1a355e;
    --primary-gradient: linear-gradient(135deg, #2b4e84 0%, #1a355e 100%);
    
    --accent: #ff8c42;        /* Naranja (Acción) */
    --accent-hover: #e67e3a;
    
    --bg-body: #f0f2f5;       /* Fondo General */
    --white: #ffffff;
    
    /* Textos */
    --text-main: #2c3e50;
    --text-muted: #95a5a6;
    
    /* Estados */
    --success: #00b894;       /* Verde */
    --danger: #ff7675;        /* Rojo */
    --warning: #fdcb6e;       /* Amarillo */
    
    /* UI Moderna */
    --radius: 16px;           
    --shadow-soft: 0 5px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
}

/* --- RESET BÁSICO --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; transition: all 0.3s ease; }
ul { list-style: none; }

/* =========================================
   COMPONENTES UI (Botones, Inputs, Cards)
   ========================================= */

/* Botones Modernos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 50px; /* Estilo Píldora */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    gap: 8px;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(43, 78, 132, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(43, 78, 132, 0.4);
    transform: translateY(-2px);
    background: var(--primary);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(255, 140, 66, 0.3);
}
.btn-accent:hover { background: var(--accent-hover); }

/* Botones Pequeños (Iconos) */
.btn-icon {
    width: 35px; height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: white;
    transition: 0.3s;
}
.btn-edit { background: var(--primary); box-shadow: 0 4px 10px rgba(43, 78, 132, 0.3); }
.btn-delete { background: var(--danger); box-shadow: 0 4px 10px rgba(255, 118, 117, 0.3); }
.btn-icon:hover { opacity: 0.9; transform: scale(1.1); }

/* Inputs de Texto */
.form-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #eef2f7;
    border-radius: 12px;
    background: #fff;
    font-size: 1rem;
    color: var(--text-main);
    transition: 0.3s;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 78, 132, 0.1);
}

/* Tarjetas (Glassmorphism sutil) */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0;
}

/* Badges (Etiquetas) */
.badge-pill {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
}
.badge-green { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.badge-red { background: rgba(255, 118, 117, 0.15); color: var(--danger); }
.badge-orange { background: rgba(255, 140, 66, 0.15); color: var(--accent); }

/* =========================================
   PANEL ADMINISTRATIVO
   ========================================= */

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2b4e84 0%, #1e3c6b 100%);
    color: var(--white);
    position: fixed; height: 100%; left: 0; top: 0;
    padding: 30px 20px; z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
}

.brand {
    font-size: 1.8rem; font-weight: 800; text-align: center;
    margin-bottom: 40px; letter-spacing: 1px;
}
.brand span { color: var(--accent); }

.nav-link {
    display: flex; align-items: center; padding: 14px 20px;
    color: rgba(255,255,255,0.7); border-radius: 12px;
    margin-bottom: 8px; font-weight: 500;
}
.nav-link i { margin-right: 15px; width: 24px; text-align: center; font-size: 1.1rem; }
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1); color: var(--white);
    backdrop-filter: blur(5px); transform: translateX(5px);
}

/* Layout Principal */
.main-content {
    margin-left: 280px; width: calc(100% - 280px); padding: 40px;
    transition: margin-left 0.3s ease;
}

.top-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
}
.page-title { font-size: 1.8rem; font-weight: 800; color: var(--text-main); }

/* Estadísticas Dashboard */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px; margin-bottom: 35px;
}
.stat-card {
    background: white; padding: 25px; border-radius: var(--radius);
    box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 20px;
}
.stat-icon-box {
    width: 60px; height: 60px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}

/* Zona de Carga (Dropzone Premium) */
.upload-card-wrapper {
    background: white; border-radius: var(--radius); padding: 5px;
    box-shadow: var(--shadow-soft); height: 100%; display: flex; flex-direction: column;
}
.upload-zone {
    flex-grow: 1; border: 2px dashed #d1d8e0; border-radius: 12px;
    background: #f8fbff; padding: 40px 20px; text-align: center;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 250px;
}
.upload-zone:hover { border-color: var(--primary); background: #eef6ff; transform: scale(1.01); }
.upload-icon-circle {
    width: 80px; height: 80px; background: rgba(43, 78, 132, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; transition: 0.3s;
}
.upload-zone:hover .upload-icon-circle {
    background: var(--primary); color: white; transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(43, 78, 132, 0.3);
}

/* =========================================
   SITIO PÚBLICO (LANDING PAGE)
   ========================================= */

/* =========================================
   SITIO PÚBLICO PREMIUM (V9)
   ========================================= */

/* Navbar Transparente/Blanca */
.public-navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 5% 20px 5%; /* % para márgenes seguros en móvil */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

/* Botón de Login (Outlined) */
.btn-login-outline {
    color: var(--primary);
    font-weight: 700;
    border: 2px solid var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
}
.btn-login-outline:hover {
    background: var(--primary); color: white;
    box-shadow: 0 5px 15px rgba(43, 78, 132, 0.3);
}

/* HERO SECTION (Encabezado) */
.hero-section {
    background: var(--primary-gradient);
    padding: 80px 20px 160px 20px; /* Mucho padding abajo para el buscador */
    text-align: center; color: white;
    position: relative; overflow: hidden;
    /* Curva suave SVG clip-path */
    clip-path: ellipse(150% 100% at 50% 0%);
}

/* Patrón de fondo (Puntos sutiles) */
.hero-pattern {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.hero-title {
    font-size: 3rem; font-weight: 900; margin-bottom: 15px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative; z-index: 2;
}
.hero-subtitle {
    font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto;
    font-weight: 300; position: relative; z-index: 2; line-height: 1.6;
}

/* BUSCADOR FLOTANTE (Animado) */
.search-container-floating {
    max-width: 800px; margin: -80px auto 50px auto; /* Sube sobre el header */
    padding: 0 20px; position: relative; z-index: 50;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.search-card {
    background: white; padding: 15px; border-radius: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(255,255,255,0.5);
}

.search-input-lg {
    flex-grow: 1; border: none; font-size: 1.1rem; padding: 15px 20px;
    outline: none; background: transparent; color: #333;
}

.search-btn-lg {
    padding: 15px 40px; border-radius: 50px; font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(43, 78, 132, 0.4);
}

/* TARJETA DE RESULTADO (Estilo Certificado) */
.certificate-card {
    background: white; border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 40px; border: 1px solid #f0f0f0;
    position: relative;
    transition: transform 0.3s;
}
.certificate-card:hover { transform: translateY(-5px); }

.certificate-header {
    background: #f8f9fa; padding: 25px; border-bottom: 2px dashed #e0e0e0;
    display: flex; justify-content: space-between; align-items: center;
}

.certificate-body { padding: 30px; }

/* Ilustraciones de estado vacio */
.empty-state { text-align: center; padding: 60px 20px; color: #aab2bd; }
.empty-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { padding-bottom: 100px; clip-path: none; border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; }
    
    .search-card {
        flex-direction: column; border-radius: 20px; padding: 20px;
        animation: none; /* Quitar flotación en móvil para no marear */
    }
    .search-input-lg { width: 100%; text-align: center; border-bottom: 1px solid #eee; margin-bottom: 10px; }
    .search-btn-lg { width: 100%; }
    
    .certificate-header { flex-direction: column; text-align: center; gap: 10px; }
    .public-navbar { padding: 15px 20px; }
    .btn-login-text { display: none; } /* Ocultar texto "Admin" en móvil muy pequeño */
}

/* =========================================
   TABLAS Y MODALES
   ========================================= */

/* Tabla Responsiva */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 15px; }
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
.table-custom th {
    background: #f8f9fa; padding: 15px; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; font-size: 0.8rem;
    border-bottom: 2px solid #eef2f7; text-align: left;
}
.table-custom td { padding: 15px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.score-high { color: var(--success); font-weight: 700; }
.score-low { color: var(--danger); font-weight: 700; }

/* Modal */
.modal-preview { background: #f1f3f5; padding: 15px; border-radius: 8px; display: flex; align-items: center; gap: 15px; margin: 20px 0; border: 1px solid #e9ecef; }

/* Animaciones */
.fade-in-up { animation: fadeInUp 0.8s ease-out forwards; opacity: 0; transform: translateY(30px); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* =========================================
   RESPONSIVE MOBILE
   ========================================= */

/* Header Móvil */
.top-bar-mobile { display: none; } 

@media (max-width: 992px) {
    /* Sidebar Oculto */
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 0 0 100px rgba(0,0,0,0.5); }
    
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    
    .top-bar-mobile {
        display: flex; align-items: center; justify-content: space-between;
        margin-bottom: 25px; background: white; padding: 15px 20px;
        border-radius: 12px; box-shadow: var(--shadow-soft);
    }
    .hamburger { font-size: 1.5rem; color: var(--primary); background: none; border: none; cursor: pointer; }
    
    /* Overlay */
    .overlay {
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 900; opacity: 0; transition: opacity 0.3s;
    }
    .overlay.active { display: block; opacity: 1; }
    
    /* Ajustes Landing Page Móvil */
    .public-navbar { padding: 15px 20px; flex-direction: column; gap: 15px; }
    .hero-section { clip-path: none; padding-bottom: 80px; }
    .hero-title { font-size: 2rem; }
    .search-card-public { flex-direction: column; border-radius: 20px; }
    
    /* Grids */
    .admin-layout { grid-template-columns: 1fr; }
    .status-grid { flex-direction: column; }
}/* --- ANIMACIONES Y VIDA (V9) --- */

/* Banner de Bienvenida con Degradado Animado */
.welcome-banner {
    background: linear-gradient(-45deg, #2b4e84, #1e3c6b, #4a69bd, #2b4e84);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(43, 78, 132, 0.3);
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efecto de aparición suave */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

/* Contenedor del Gráfico */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
/* --- DISEÑO DE RESULTADOS (Tipo Expediente) --- */

.results-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.certificate-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 40px; /* Separación grande entre programas */
    overflow: hidden;
    position: relative;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Franja de estado lateral (Dinámica) */
.card-border-left-ok { border-left: 6px solid var(--success); }
.card-border-left-fail { border-left: 6px solid var(--danger); }

/* Cabecera del Diplomado */
.cert-header {
    padding: 25px 30px;
    border-bottom: 1px dashed #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #fff;
}

.cert-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 5px;
}

.cert-version {
    font-size: 0.9rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cuerpo de la tarjeta */
.cert-body {
    padding: 30px;
}

/* Grid de Estados (Admin y Académico) */
.status-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    background: #f9fafc;
    padding: 20px;
    border-radius: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-icon-box {
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: white;
}
.bg-ok { background: var(--success); box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3); }
.bg-fail { background: var(--danger); box-shadow: 0 4px 10px rgba(255, 118, 117, 0.3); }

/* Datos del alumno */
.student-info {
    margin-bottom: 30px;
}
.student-label { font-size: 0.75rem; color: #aaa; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 5px; }
.student-value { font-size: 1.2rem; color: var(--text-main); font-weight: 700; }

/* Secciones (Docs y Notas) */
.section-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 30px 0 20px 0;
    font-size: 0.9rem; font-weight: 700; color: var(--primary);
    text-transform: uppercase;
}
.section-line { flex-grow: 1; height: 1px; background: #eee; }

/* Grid de Documentos (Píldoras) */
.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.doc-pill {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #eee;
    display: flex; align-items: center; gap: 8px;
}
.pill-ok { background: #e6fffa; color: #00b894; border-color: #b2f5ea; }
.pill-fail { background: #fff5f5; color: #fc8181; border-color: #fed7d7; opacity: 0.7; }

/* Móvil */
@media (max-width: 768px) {
    .cert-header { flex-direction: column; gap: 10px; }
    .status-wrapper { grid-template-columns: 1fr; }
}
/* --- ESTILOS NÚMERO DE DIPLOMA --- */
.diploma-box {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed; /* Borde punteado tipo "recorte" */
}

/* Caso: TIENE DIPLOMA (Dorado elegante) */
.diploma-gold {
    background: #fff9db; 
    color: #d48806; 
    border-color: #ffe066;
}

/* Caso: NO TIENE (Gris sutil) */
.diploma-gray {
    background: #f8f9fa; 
    color: #adb5bd; 
    border-color: #dee2e6;
    font-size: 0.9rem;
}