/* ===== RESET Y CONFIGURACIÓN BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%); /* MISMO COLOR PARA AMBOS */
    color: white;
    padding: 35px 30px;
    text-align: center;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #e74c3c;
    border-radius: 2px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.header h2 {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 400;
    line-height: 1.4;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== NAVEGACIÓN ===== */
.navegacion {
    display: flex;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 6px;
    margin: 25px 30px 30px 30px;
    border: 1px solid #e9ecef;
    justify-content: space-between;
}

.nav-btn {
    flex: 1;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.nav-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.nav-btn.active {
    background: white;
    color: #2c3e50;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    font-weight: 600;
}

/* ===== CONTENIDO ===== */
.content {
    padding: 0 30px 30px 30px;
    background: #ffffff;
}

/* ===== PANTALLAS ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.screen-title {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.screen-header .screen-title {
    margin-bottom: 0;
    flex: 1;
    text-align: left;
    font-size: 18px;
}

.carrera-descripcion {
    text-align: center;
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

/* ===== OPCIONES DE CARRERA ===== */
.carreras-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
}

.carrera-option {
    background: white;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.carrera-option:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.12);
}

.carrera-icon {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.carrera-content {
    flex: 1;
}

.carrera-content h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

.carrera-content p {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

/* ===== BOTONES ===== */
.btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    width: 100%;
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(44, 62, 80, 0.12);
}

.btn-back {
    background: #6c757d;
    margin-top: 10px;
}

.btn-back:hover {
    background: #5a6268;
}

.btn-back-small {
    background: #6c757d;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.btn-back-small:hover {
    background: #5a6268;
}

/* ===== BOTONES EN LÍNEA ===== */
.botones-linea {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-inscripcion-linea {
    background: #3498db;
    color: white;
    border: 1.5px solid #3498db;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex: 1;
    min-width: 140px;
    justify-content: center;
    text-align: center;
}

.btn-inscripcion-linea:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.btn-horarios-linea {
    background: #2c3e50;
    color: white;
    border: 1.5px solid #2c3e50;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.btn-horarios-linea:hover {
    background: #34495e;
    border-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.btn-horarios-linea.active {
    background: #e74c3c;
    border-color: #e74c3c;
}

.btn-horarios-linea.active:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* ===== SECCIONES DE LINKS ===== */
.links-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.links-section {
    margin-bottom: 25px;
}

.links-section:last-child {
    margin-bottom: 0;
}

.links-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 8px;
    font-weight: 600;
}

.link-item {
    display: block;
    background: white;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-item:hover {
    background: #2c3e50;
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.15);
    border-color: #2c3e50;
}

.link-item i {
    font-size: 16px;
    width: 20px;
}

/* ===== HORARIOS VISUALES ===== */
.horarios-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border: 1.5px solid #e9ecef;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    max-height: 800px;
    opacity: 1;
}

.horarios-container.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

.horario-visual-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    font-size: 13px;
}

.horario-visual-table th {
    background: #2c3e50;
    color: white;
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    border-right: 1px solid #34495e;
}

.horario-visual-table th.dia-header {
    background: #34495e;
    font-size: 14px;
}

.horario-visual-table td {
    padding: 12px;
    border: 1px solid #e9ecef;
    vertical-align: top;
    min-height: 90px;
    height: 100px;
    background: #f8f9fa;
}

.horario-visual-table td.fila-numero {
    background: #f1f3f5;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    width: 50px;
    border-right: 1.5px solid #dee2e6;
}

.horario-visual-table td.materia-cell {
    background: #f8f9fa;
    transition: all 0.1s ease;
}

.materia-card {
    background: white;
    border-radius: 6px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    font-size: 12px;
}

.materia-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    border-left-color: #e74c3c;
}

.materia-nombre {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.2;
}

.materia-profesor {
    color: #6c757d;
    font-size: 11px;
    margin-bottom: 6px;
    font-style: italic;
}

.materia-hora {
    color: white;
    background: #3498db;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    align-self: flex-start;
}

/* Colores según duración */
.materia-card[data-duracion="1"] {
    border-left-color: #e74c3c;
}

.materia-card[data-duracion="2"] {
    border-left-color: #3498db;
}

.materia-card[data-duracion="3"] {
    border-left-color: #2ecc71;
}

.materia-card[data-duracion="4"] {
    border-left-color: #9b59b6;
}

/* ===== ACLARACIONES ===== */
.aclaracion {
    background: #fff8e1;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0 0 0;
    border-left: 3px solid #f39c12;
    font-size: 13px;
}

.aclaracion i {
    color: #f39c12;
    margin-right: 8px;
}

/* ===== FOOTER ===== */
.footer {
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 25px;
    margin-top: 30px;
    border-top: 1px solid #e9ecef;
}

.footer p {
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-note {
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header h2 {
        font-size: 12px;
    }
    
    .content {
        padding: 0 20px 20px 20px;
    }
    
    .navegacion {
        margin: 20px 20px 25px 20px;
    }
    
    .nav-btn {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .carreras-grid {
        gap: 15px;
    }
    
    .carrera-option {
        padding: 18px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .carrera-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .carrera-content h3 {
        font-size: 16px;
    }
    
    .carrera-content p {
        font-size: 12px;
    }
    
    .screen-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .screen-header .screen-title {
        font-size: 16px;
    }
    
    .links-container {
        padding: 20px;
    }
    
    .links-section h4 {
        font-size: 15px;
    }
    
    .link-item {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    /* BOTONES EN LÍNEA - MÓVIL */
    .botones-linea {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-inscripcion-linea,
    .btn-horarios-linea {
        width: 100%;
        min-width: unset;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .horarios-container {
        padding: 15px;
        margin: 10px -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .horario-visual-table {
        min-width: 100%;
        font-size: 12px;
    }
    
    .horario-visual-table th {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .horario-visual-table td {
        padding: 8px;
        height: 85px;
    }
    
    .materia-card {
        padding: 8px;
        font-size: 11px;
    }
    
    .materia-nombre {
        font-size: 11px;
    }
    
    .materia-profesor {
        font-size: 10px;
    }
    
    .materia-hora {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .aclaracion {
        padding: 12px;
        font-size: 12px;
    }
    
    .footer {
        padding: 20px;
        font-size: 12px;
    }
}

/* Vista muy pequeña */
@media (max-width: 480px) {
    .carrera-option {
        padding: 15px;
    }
    
    .carrera-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .horario-visual-table td {
        height: 80px;
    }
    
    .materia-card {
        padding: 6px;
    }
}

/* Animación para horarios */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.horarios-container:not(.hidden) {
    animation: fadeIn 0.3s ease forwards;
}
/* ===== ESTILOS PARA CUPO CUBIERTO ===== */

.cupo-cubierto-mensaje {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cupo-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.cupo-texto {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.cupo-texto strong {
    font-weight: 600;
}

/* Versión móvil */
@media (max-width: 768px) {
    .cupo-cubierto-mensaje {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .cupo-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .cupo-texto {
        font-size: 13px;
    }
}
