/**
 * ESTILOS DEL SISTEMA DE MATRÍCULA 2026
 * Liceo Polivalente Esmeralda
 */

/* ========================================== */
/* VARIABLES CSS */
/* ========================================== */
:root {
    --primary-color: #1976D2;
    --secondary-color: #424242;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --light-bg: #F5F5F5;
    --white: #FFFFFF;
    --text-dark: #212121;
    --text-light: #757575;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================== */
/* ESTILOS GLOBALES */
/* ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: var(--light-bg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================== */
/* BARRA DE NAVEGACIÓN */
/* ========================================== */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand i {
    font-size: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info i {
    font-size: 1.8rem;
}

.btn-logout {
    background-color: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: rgba(255,255,255,0.3);
}

/* ========================================== */
/* SECCIÓN HERO */
/* ========================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #1565C0);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1rem !important;
    opacity: 0.9;
    margin-bottom: 40px !important;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================== */
/* BOTONES */
/* ========================================== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
    margin: 20px 0;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-back:hover {
    text-decoration: underline;
}

/* ========================================== */
/* FORMULARIOS */
/* ========================================== */
.form-section {
    padding: 60px 0;
}

.form-container {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 0 auto;
}

.form-container-large {
    max-width: 900px;
}

.form-container h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title {
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.form-section-title h3 {
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: var(--font-family);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-actions {
    margin-top: 30px;
}

/* ========================================== */
/* ESTUDIANTES DINÁMICOS */
/* ========================================== */
.estudiante-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.estudiante-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.estudiante-header h4 {
    color: var(--secondary-color);
}

.btn-remove {
    background-color: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ========================================== */
/* DASHBOARD */
/* ========================================== */
.dashboard {
    padding: 60px 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--white);
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Barra de progreso */
.progress-section {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.progress-section h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #66BB6A);
    border-radius: 15px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

/* Tarjetas de estudiantes */
.estudiante-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.estudiante-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.estudiante-info h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.estudiante-info p {
    color: var(--text-light);
}

.badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background-color: #E8F5E9;
    color: var(--success-color);
}

.badge-warning {
    background-color: #FFF3E0;
    color: var(--warning-color);
}

/* Lista de documentos */
.documentos-list {
    display: grid;
    gap: 15px;
}

.documento-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.documento-item:hover {
    background-color: #EEEEEE;
}

.documento-info {
    flex: 1;
}

.documento-info h4 {
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.documento-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.documento-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* ========================================== */
/* MODAL */
/* ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-firma {
    max-width: 700px;
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.btn-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 30px;
}

/* Canvas de firma */
.firma-canvas-container {
    border: 3px dashed var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
    background: var(--light-bg);
    display: flex;
    justify-content: center;
}

#firmaCanvas {
    cursor: crosshair;
    background: var(--white);
}

.firma-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ========================================== */
/* LOADING */
/* ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
}

.spinner {
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid var(--white);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* ========================================== */
/* RESPONSIVE */
/* ========================================== */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .documento-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .documento-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
    }
    
    #firmaCanvas {
        width: 100%;
        height: auto;
    }
}

/* ========================================== */
/* UTILIDADES */
/* ========================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
