/* =========================================
   VARIABLES Y RESET
   ========================================= */
:root {
    /* Colores Primarios LibreMente */
    --primary-blue: #6B4C7F;          /* Morado principal */
    --primary-blue-dark: #5A3F6F;     /* Morado oscuro */
    --primary-blue-light: #F0E6F5;    /* Morado ultra claro */

    --accent-yellow: #5A9E7F;         /* Verde menta principal */
    --accent-yellow-light: #E8F5E9;   /* Verde menta ultra claro */
    --accent-yellow-border: #5A9E7F;
    --accent-yellow-text: #4A8B6F;    /* Verde menta oscuro */

    /* Texto */
    --text-dark: #1A1A1A;
    --text-light: #6C757D;

    /* Blancos */
    --white: #FFFFFF;

    /* Sombras LibreMente */
    --shadow-card: 0 4px 16px rgba(107, 76, 127, 0.12);
    --shadow-hover: 0 8px 32px rgba(107, 76, 127, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   LOADER OVERLAY
   ========================================= */
#loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-box {
    text-align: center;
    width: 320px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(107, 76, 127, 0.3);
    border: 2px solid var(--primary-blue-light);
}

.loader-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loader-title i {
    font-size: 20px;
    color: var(--accent-yellow);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--primary-blue-light);
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--primary-blue);
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-yellow));
    animation: loading 2s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(107, 76, 127, 0.4);
}

.loader-text {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-light);
    font-style: italic;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 85%; }
    100% { width: 0%; }
}

/* =========================================
   BARRA SUPERIOR
   ========================================= */
.top-bar-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white);
    padding: 12px 40px;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.top-bar-modern .logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-modern .top-label {
    color: #2e7d32;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.esap-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.esap-logo:hover {
    transform: scale(1.05);
}

.top-bar-modern .docente-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-dark);
    background: #f8f9fa;
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid #e0e0e0;
}

.top-bar-modern .docente-container i {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.top-bar-modern .docente-container strong {
    color: var(--primary-blue);
}

/* =========================================
   PAGINADOR (ESTILO DEBATES) - COMPACTO PARA 16 PASOS
   ========================================= */
.paginator-container {
    width: 100%;
    max-width: 95%;
    margin: 10px auto 8px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.paginator-progress-track {
    width: 100%;
    height: 4px;
    background: #D7D7D7;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.paginator-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-yellow));
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.paginator-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 5px 0;
}

.paginator-steps::-webkit-scrollbar {
    display: none;
}

.paginator-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-width: 32px;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f5f7fa;
    border: 1.5px solid #D7D7D7;
    color: #888888;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s ease;
    position: relative;
    z-index: 2;
}

.step-dot i {
    font-size: 0.65rem;
}

.step-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s ease;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.paginator-step.active .step-dot {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 0 0 3px rgba(107, 76, 127, 0.25);
    transform: scale(1.15);
}

.paginator-step.active .step-label {
    color: var(--primary-blue);
    font-weight: 700;
}

.paginator-step.completed .step-dot {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.paginator-step.completed .step-label {
    color: #333333;
}

.paginator-connector {
    width: 15px;
    height: 1.5px;
    background: #D7D7D7;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.connector-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary-blue);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* SLIDES ANIMATIONS */
.slides-wrapper {
    position: relative;
    overflow: hidden;
    transition: min-height 0.4s ease;
}

.page-slide {
    display: none;
}

.page-slide.active {
    display: block;
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-out-left {
    animation: slideOutLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-60px); }
}

.slide-out-right {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

/* NAVEGACIÓN INFERIOR */
.paginator-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 700px;
    margin: 15px auto 30px;
    padding: 0 20px;
    gap: 20px;
}

.paginator-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--primary-blue);
    background: var(--white);
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.paginator-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 76, 127, 0.3);
}

.paginator-btn:active:not(:disabled) {
    transform: translateY(0);
}

.paginator-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #D7D7D7;
    color: #888888;
}

.paginator-btn.btn-finish {
    border-color: #2e7d32;
    color: #2e7d32;
    background: #f1f8e9;
}

.paginator-btn.btn-finish:disabled {
    opacity: 0.7;
    cursor: default;
    border-color: #2e7d32;
    color: #2e7d32;
}

.paginator-center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    text-align: center;
}

.paginator-counter {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.paginator-page-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    text-align: center;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   FADE IN ANIMATION
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */

/* --- MEDIA 768PX --- */
@media (max-width: 768px) {
    .top-bar-modern {
        padding: 10px 20px;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    .top-bar-modern .logo-container {
        justify-content: center;
        width: 100%;
    }
    .top-bar-modern .docente-container {
        width: 100%;
        justify-content: center;
        font-size: 0.85rem;
    }
    .top-bar-modern .esap-logo {
        height: 40px;
    }
    .top-bar-modern .top-label {
        font-size: 1rem;
    }
    
    .loader-box {
        width: 280px;
        padding: 25px;
    }
    .loader-title {
        font-size: 16px;
    }
    .progress-bar-container {
        height: 10px;
    }

    /* PAGINADOR SUPERIOR */
    .paginator-container {
        max-width: 100%;
        margin-bottom: 8px;
        padding: 0 10px;
    }
    .paginator-connector {
        width: 8px;
    }
    .step-dot {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }
    .step-dot i {
        font-size: 0.55rem;
    }
    .step-label {
        display: none;
    }
    .paginator-step {
        min-width: 26px;
    }

    /* PAGINADOR INFERIOR */
    .paginator-nav {
        margin: 12px auto 20px;
        padding: 0 15px;
        gap: 15px;
        max-width: 100%;
    }
    .paginator-btn {
        padding: 8px 15px;
        font-size: 0.78rem;
        min-width: 100px;
    }
    .paginator-page-title {
        font-size: 0.72rem;
        max-width: 200px;
    }
}

/* --- MEDIA 480PX --- */
@media (max-width: 480px) {
    .top-bar-modern .top-label { font-size: 0.9rem; }

    /* PAGINADOR SUPERIOR */
    .paginator-container {
        padding: 0 5px;
    }
    .paginator-connector {
        width: 5px;
    }
    .step-dot {
        width: 22px;
        height: 22px;
        font-size: 0.55rem;
    }
    .step-dot i {
        font-size: 0.5rem;
    }
    .paginator-step {
        min-width: 22px;
    }

    /* PAGINADOR INFERIOR */
    .paginator-nav {
        margin: 10px auto 15px;
        padding: 0 10px;
        gap: 10px;
    }
    .paginator-btn {
        padding: 7px 12px;
        font-size: 0.72rem;
        min-width: 85px;
        gap: 5px;
    }
    .paginator-center-info {
        gap: 1px;
    }
    .paginator-counter {
        font-size: 0.65rem;
    }
    .paginator-page-title {
        font-size: 0.65rem;
        max-width: 150px;
    }
}