/* --- RESET AND BASE STYLES --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    background-color: #192D36;
    color: white;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Evita el scroll horizontal en toda la página */
}

a,
button {
    transition: all 0.3s ease;
    text-decoration: none;
}

/* --- ANIMATIONS --- */

.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes resaltar {
    0% {
        background-color: #fff6ef;
    }
    100% {
        background-color: #fff;
    }
}

@keyframes logo-fade {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- LAYOUT & HEADER --- */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    color: white;
    gap: 2rem;
}

.logo {
    order: 1;
}

.logo img {
    height: 70px;
    animation: logo-fade 1.2s ease-in-out;
}

.social-icons {
    order: 2;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex: 1;
}

.social-icons a {
    color: white;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #f0f0f0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links li a {
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #f0f0f0;
}

/* --- MOBILE MENU TOGGLE (HAMBURGER) --- */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.4s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(9px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-9px);
}

/* --- MAIN CONTENT --- */

main {
    padding: 0.5rem;
    max-width: 1000px;
    margin: auto;
}

main h2 {
    color: #000;
    margin-bottom: 1rem;
    text-align: center;
}

.intro-horario {
    background-color: #E5E6E2;
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.intro-horario h1 {
    color: #2369B7;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.intro-horario .descripcion {
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.intro-horario .mensaje {
    font-weight: bold;
    color: #9D1515;
    font-size: 0.8rem;
}

/* --- FORM ELEMENTS & BUTTONS --- */

#menu-niveles,
#menu-materias,
#menu-grupos {
    margin-top: 10px;
}

select {
    display: block;
    width: 50%;
    padding: 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 2px solid #ccc;
    background-color: #fff;
    margin: 10px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    appearance: none;
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #fe761e;
    background-color: #fff6ef;
    transform: scale(1.02);
}

.borde-amarillo {
    border-color: #fcb500 !important;
}

.select-animado {
    animation: resaltar 0.4s ease;
}

/* ========================
   BOTONES ACCIONES
======================== */
.botones-acciones {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.botones-acciones button {
    background-color: #db3a56;
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.botones-acciones button:hover {
    background-color: #b22c43;
    transform: scale(1.1);
}

.botones-acciones i { pointer-events: none; }


/* --- HORARIO & TABLE --- */

.contenedor-horario {
    overflow-x: auto;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td, th {
    border: 0.5px solid #ccc;
    padding: 1px;
    text-align: center;
}

select {
    margin: 10px 10;
}

#horario {
    width: 100%;
    border-collapse: collapse;
    background-image: url('ceo.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    background-color: rgba(100, 100, 100, 10);
    background-blend-mode: lighten;
    opacity: 1;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#horario td,
#horario th {
    border: 0.5px solid #ccc;
    padding: 1px;
    text-align: center;
}

#tabla-horario {
    min-width: 900px;
    border-collapse: collapse;
}

/* --- MATERIAS CONTENT --- */

.contenido-materia {
    background-color: #F1441C;
    padding: 5px;
    margin: 0px 0;
    border-radius: 4px;
    font-size: 15px;
    position: relative;
    border: 1px solid white;
}

.contenido-materia .cerrar {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
}

.conflicto {
    background-color: #f8d7da !important;
    border: 2px solid #c0392b !important;
}

.materias-sublista,
.grupos-sublista {
    transition: max-height 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
}

/* === LICENCIADO vs AUXILIATURA === */
.contenido-materia.lic {
    background-color: #eb2525 !important; /* Azul */
    border: 1px solid #ffffff;
    color: white;
}

.contenido-materia.aux {
    background-color: #000000 !important; /* Verde */
    border: 1px solid #ffffff;
    color: white;
}



/* --- MATERIAS CONTENT --- */

.contenido-materia {
    background-color: #F1441C;
    padding: 5px;
    margin: 0px 0;
    border-radius: 4px;
    font-size: 15px;
    position: relative;
    border: 1px solid white;
}

.contenido-materia .cerrar {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
}

.conflicto {
    background-color: #f8d7da !important;
    border: 2px solid #c0392b !important;
}

.materias-sublista,
.grupos-sublista {
    transition: max-height 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
}

/* --- EXTRA SECTIONS (FOOTER LINKS) --- */

.extra-sections {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    background: #f5f5f5;
    padding: 2rem 1rem;
    color: #000;
    border-top: 2px solid #000;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.extra-sections.visible {
    opacity: 1;
    transform: translateY(0);
}

.enlaces-fce,
.redes-ceo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 300px;
    width: 100%;
}

.enlaces-fce h3,
.redes-ceo h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: bold;
}

.enlaces-fce ul,
.redes-ceo ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.enlaces-fce li,
.redes-ceo li {
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: center;
}

.extra-sections a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: #ffffff;
    color: #000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: all 0.3s ease;
}

.extra-sections a:hover {
    background-color: #192D36;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* --- FOOTER --- */

footer {
    background-color: rgba(0, 0, 0, 0.8);
    text-align: center;
    padding: 1rem;
    margin-top: 0;
    color: white;
}

/* --- TOAST NOTIFICATION --- */

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    font-size: 14px;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE / MEDIA QUERIES --- */

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        order: 4;
    }

    .social-icons {
        order: 3;
    }

    .nav-links {
        order: 2;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        width: 220px;
        padding: 1rem 0;
        border-radius: 0 0 0 10px;
        transform: translateX(100%);
        transition: transform 0.4s ease, opacity 0.4s ease;
        opacity: 0;
        pointer-events: none;
    }

    .nav-links.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 12px 20px;
        width: 100%;
    }

    .extra-sections {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .extra-sections > div {
        max-width: 320px;
        width: 100%;
    }
}

@media (min-width: 769px) {
    .navbar {
        flex-wrap: nowrap;
    }

    .logo {
        order: 1;
    }

    .social-icons {
        order: 2;
    }

    .nav-links {
        order: 3;
        margin-left: 0;
    }
}
