/* ========== IMPORTS Y RESET ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset y base con mejor compatibilidad */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Elimina el highlight azul en Safari */
}

:root {
    --primary-blue: #022d6d;
    --secondary-blue: #3498db;
    --light-blue: #5697d8;
    --accent-blue: #2980b9;
    --background-light: #f3f6f8;
    --background-dark: #e1e8ed;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --text-dark: #3b5e81;
    --text-light: #ffffff;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Nuevas variables para la top-bar */
    --topbar-bg: #ffffff;
    --topbar-border: #e5e7eb;
    --topbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --topbar-text: #1f2937;
    --topbar-gray: #f8fafc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-dark) 100%);
    color: var(--text-dark);
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
    padding-inline: 1.5rem; /* Espacio horizontal a izquierda y derecha */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Efecto de partículas sutil en el fondo */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* ========== TOP BAR ========== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(15px); /* Compatibilidad Safari */
    backdrop-filter: blur(15px);
    padding: 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    border-bottom: 1px solid rgba(2, 45, 109, 0.08);
    min-height: 35px;
    transition: all 0.2s ease;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(2, 45, 109, 0.08);
    box-shadow: 0 1px 6px rgba(2, 45, 109, 0.04);
    transition: all 0.2s ease;
}

.user-panel:hover {
    box-shadow: 0 2px 10px rgba(2, 45, 109, 0.08);
}

.user-avatar {
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    -webkit-user-select: none; /* Evita selección de texto en Safari */
    -moz-user-select: none;
    user-select: none;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-blue);
}

.user-role {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
}

.logout-btn {
    background: linear-gradient(135deg, #28a745, #218838); /* Verde intenso */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3); /* Sombra verde */
    -webkit-appearance: none;
    appearance: none;
    margin: 0 auto; /* Centrado horizontal */
}
.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 214, 126, 0.4); /* Verde más claro */
}


.coins-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #f97316;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.15s ease;
    font-size: 0.8rem;
    cursor: pointer;
}

.coins-container:hover {
    transform: translateY(-0.5px);
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.9);
    border-color: #ea580c;
    cursor: pointer;
}

.coins-icon {
    font-size: 1rem;
    filter: grayscale(0.3);
    cursor: pointer;
}

.coins-count {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #c49602;
    letter-spacing: 0.1px;
    cursor: pointer;
}

.coins-display {
    background: linear-gradient(135deg, #ffd700, #f8ed8d);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgb(32, 31, 23);
    margin: 1rem 0;
    cursor: pointer;
}


.coins-note {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 6px;
    border-left: 4px solid #f39c12;
    margin: 1rem 0;
    cursor: pointer;
}

/* ========== HEADER ========== */
/* ========== HEADER SUTIL Y ELEGANTE ========== */
header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--text-light);
    padding: 2rem 0 1.8rem;
    text-align: center;
    margin-top: 60px;
    position: relative;
    box-shadow: 
        0 4px 20px rgba(2, 45, 109, 0.15),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

/* Línea superior sutil */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
}

/* Efecto de profundidad muy sutil */
header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Título principal - elegante y limpio */
.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.8rem 0;
    color: white;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.main-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 1px;
}

/* Subtítulo refinado */
.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 1.2rem;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

/* Badge minimalista */
.header-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Efecto de brillo muy sutil al hacer hover */
.header-content:hover .main-title::after {
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

/* Animación sutil del gradiente */
header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    background-size: 200% 200%;
    animation: subtleShift 15s ease infinite;
}

@keyframes subtleShift {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

/* Responsive sutil */
@media screen and (max-width: 768px) {
    header {
        padding: 1.8rem 0 1.5rem;
        margin-top: 50px;
    }
    
    .main-title {
        font-size: 2.1rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 0 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .main-title {
        font-size: 1.9rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .header-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}










h1 {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.subtitle {
    font-weight: 400;
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Estilos para el botón de Iniciar Sesión */
.login-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #2980b9, #2471a3);
}

.login-btn:active {
    transform: translateY(1px);
}

/* Contenedor de ExcelCoins ---------------------------------------------- */


.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* User Info */
.user-info {
    display: none;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.3rem 1rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-info.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

.user-name {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 0.95rem;
}



/* Título Central */
.title-section {
    text-align: center;
    flex: 1;
    padding: 0 2rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #fff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 1px;
}

/* FIN Contenedor de ExcelCoins ---------------------------------------------- */

/* ========== CONTENEDOR PRINCIPAL ========== */
.main-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
    min-height: 100vh;
}

/* Estilos para el botón de cerrar sesión */
#logout-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

#logout-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

/* ========== MODALES ========== */
/* Estilos para el modal de login */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.close-modal:hover {
    color: #e74c3c;
}

.login-title {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.login-input-group {
    margin-bottom: 15px;
}

.login-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-links {
    text-align: center;
    margin-top: 15px;
}

.login-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.login-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

/* Estilos para el botón de mostrar solución */
.btn-help {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.btn-help:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    transform: translateY(-2px);
}

/* Estilos para el modal y botón de cerrar */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.close-modal-btn:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: scale(1.1);
}

.close-modal-btn:active {
    transform: scale(0.95);
}

/* Estilos para elementos clickeables de login */
.clickable {
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.clickable:hover {
    color: #0056b3;
    text-decoration: none;
}

.guest-message {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-required-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    color: #856404;
}

/* Añadir esto a tu CSS */
.btn-secondary {
    background-color: #489e2e;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}



/* ========== BARRA DE PROGRESO ========== */
/* Progress Container Más Grande */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 0;                    /* ← Sin padding interno */
    border-radius: 0;              /* ← Sin bordes redondeados */
    box-shadow: none;              /* ← Sin sombras externas */
    border: none;                  /* ← Sin borde */
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

/* Barra de progreso principal */
.progress-bar {
    height: 10px;
    background: rgba(224, 224, 224, 0.8);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    width: 0%;
    transition: width 1s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}



/* Step base */
.progress-steps > div:not(.progress-line) {
    width: calc((100% - 50px) / 51);
    height: calc((100% - 50px) / 51);
    min-width: 14px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 0.6rem;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    position: relative;
    z-index: 3;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    aspect-ratio: 1 / 1;
    line-height: 1;
}


/* Step restringido - BAJA PRIORIDAD */
.progress-steps > div.restricted {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    border-color: #f59e0b !important;
    cursor: not-allowed !important;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
    font-weight: 700;
}

/* Step completado - ALTA PRIORIDAD (debe ir DESPUÉS de .restricted) */
.progress-steps > div.completed {
    background: linear-gradient(135deg, var(--success-color), #27ae60) !important;
    color: white !important;
    border-color: var(--success-color) !important;
    box-shadow: 0 1px 2px rgba(46, 204, 113, 0.3);
    font-weight: 700;
}

/* Step activo/actual - MÁS ALTA PRIORIDAD */
.progress-steps > div.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue)) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 1px 3px rgba(2, 45, 109, 0.4);
    transform: scale(1.1);
    z-index: 5;
    font-weight: 700;
}

/* CORRECCIÓN ESPECÍFICA para locked + completed */
.progress-steps > div.completed.restricted {
    background: linear-gradient(135deg, var(--success-color), #27ae60) !important;
    color: white !important;
    border-color: var(--success-color) !important;

    /* Mantiene el estilo completed pero con cursor locked */
}

/* Efectos hover - Más sutiles para tamaño pequeño */
.progress-steps > div:not(.restricted):hover {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(2, 45, 109, 0.1);
    z-index: 4;
}

/* Efectos hover - respetar el estado completed */
.progress-steps > div.completed:hover {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.4),
                0 0 0 1px rgba(46, 204, 113, 0.2);
}

.progress-steps > div.completed.restricted:hover {
    transform: none; /* No transform para locked */
    box-shadow: 0 1px 2px rgba(46, 204, 113, 0.3);
}

.progress-steps > div.active:hover {
    transform: translateY(-1px) scale(1.15);
    box-shadow: 
        0 2px 6px rgba(2, 45, 109, 0.5),
        0 0 0 1px rgba(2, 45, 109, 0.3);
}

.progress-steps > div.restricted:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
}

/* Textos informativos - Más grandes */
.progress-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 0.5rem;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.exercise-counter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: center;
    opacity: 0.9;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 600;
}

/* Ejercicio 13 - Fin nivel básico */
.progress-steps > div:nth-child(15) {
    position: relative;
    color: orange;
}

.progress-steps > div:nth-child(15)::after {
    content: '🏆';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.5rem;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: trophyPulse 1s infinite;
}

/* Ejercicio 36 - Fin nivel intermedio */
.progress-steps > div:nth-child(38) {
    position: relative;
    color: orange;
}

.progress-steps > div:nth-child(38)::after {
    content: '🏆';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.5rem;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: trophyPulse 1s infinite;
}

/* Ejercicio 50 - Fin nivel avanzado (el original) */
.progress-steps > div:nth-child(52) {
    position: relative;
    color: orange;
}

.progress-steps > div:nth-child(52)::after {
    content: '🏆';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.5rem;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: trophyPulse 1s infinite;
}

@keyframes trophyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Tutorial - Estilo especial */
.progress-steps > div:first-child:not(.progress-line):not(.progress-line-fill) {
    font-size: 0.55rem;
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    color: white !important;
    border-color: #495057 !important;
}

/* Indicador visual de que caben todos */
.progress-steps::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(46, 204, 113, 0.3);
    border-radius: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-steps:hover::before {
    opacity: 1;
}


.progress-steps {
    display: flex;
    justify-content: flex-start;  
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    gap: 0.5px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(2, 45, 109, 0.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 30px;
}


/* ========== FIX DEFINITIVO PARA SCROLL HORIZONTAL ========== */
@media screen and (max-width: 768px) {
    .progress-steps {
        justify-content: flex-start !important;
        width: auto !important;
        min-width: min-content !important;
    }
    
    .progress-container {
        overflow: visible !important;
    }
}

/* Estilo para mensajes informativos */
.info {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1976d2;
}

/* ========== EJERCICIOS ========== */
/*Parte general del cuadro*/
.container {
    flex: 1;
    max-width: none;  
    width: 100%;    
    padding: 0 1.5rem;
}

.exercise-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: none;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition);
}

.exercise-container.active {
    display: block;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.exercise-header {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--accent-blue) 100%);
    color: var(--text-light);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.exercise-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.exercise-title {
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.exercise-level {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.exercise-content {
    display: flex;
    min-height: 500px;
}

.instructions-panel {
    flex: 0 0 40%;
    padding: 2rem;
    background: #fafafa;
    border-right: 1px solid #eaeaea;
    overflow-y: auto;
    position: relative;
}

.instructions-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--secondary-blue), var(--accent-blue));
}

.instructions-panel h2 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    position: relative;
    padding-left: 1rem;
}

.instructions-panel h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--accent-blue);
    border-radius: 2px;
}

.instructions-panel p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.instructions-panel code {
    background: #e8f4fd;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: var(--transition);
}

.instructions-panel code:hover {
    background: #d0e7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hint {
    background: #fff9e6;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.hint::before {
    content: '💡';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0.2;
}

.hint h3 {
    color: var(--warning-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.exercise-area {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.excel-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

table.excel-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
    min-width: 600px;
}

.excel-table th, .excel-table td {
    border: 1px solid #ccc;
    height: 40px;
    padding: 8px;
    text-align: center;
    font-size: 0.95rem;
    vertical-align: middle;
    font-family: 'Calibri', 'Arial', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 80px;
    max-width: 200px; 
    transition: var(--transition);
    background-color: rgb(0, 33, 54);
}

.excel-table th:hover {
    background-color: #2471a3;
}

/* Celdas de interior */
.excel-table td {   
    background-color: #fff;
}

.excel-table td[contenteditable="true"] {
    cursor: text;
    outline-offset: -2px;
}

.excel-table td[contenteditable="true"]:focus {
    background-color: #d0e7ff;
    outline: 2px solid var(--secondary-blue);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.formula-cell {
    background-color: #e8f4fd;
    font-style: italic;
    position: relative;
}
    
.result-cell {
    background-color: #f0f8f0;
    font-weight: 500;
    position: relative;
}

.result-cell::before {
    content: '=';
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.7rem;
    color: var(--success-color);
    font-weight: bold;
}

/* ========== LOGIN ========== */
/* Estilos para el login */
.login-hidden {
    display: none !important;
}

.user-visible {
    display: flex !important;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0 1rem;
}

.btn {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 5%;
    width: 2px;
    height: 2px;
    background: rgba(255, 250, 250, 0.692);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.reset-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    height: auto;
    min-height: 32px;
}

.btn-xs {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    min-height: 32px;
}

.btn-primary {
    background: #0d5cf0;
    color: white;
    box-shadow: 0 4px 15px rgba(7, 70, 112, 0.932);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #21618c 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-help {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-help:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    background: #cccccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== FORMULARIOS ========== */
/* Estilos para el formulario de registro multipaso */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active-step {
    display: block;
}

.step-title {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.form-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 8px;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.validation-message {
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.validation-message.valid {
    color: #27ae60;
    display: block;
}

.validation-message.invalid {
    color: #e74c3c;
    display: block;
}

.password-requirements {
    margin-top: 8px;
}

.requirement {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.requirement.met {
    color: #27ae60;
}

.requirement.unmet {
    color: #e74c3c;
}

.strength-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
    position: relative;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: all 0.3s ease;
    background: #e74c3c;
}

.strength-fill.very-weak { width: 20%; background: #e74c3c; }
.strength-fill.weak { width: 40%; background: #e67e22; }
.strength-fill.medium { width: 60%; background: #f1c40f; }
.strength-fill.strong { width: 80%; background: #2ecc71; }
.strength-fill.very-strong { width: 100%; background: #27ae60; }

.preferences-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.preference-group {
    margin-bottom: 16px;
}

.preference-group:last-child {
    margin-bottom: 0;
}

.preference-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.preference-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preference-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.preference-option:hover {
    background: #e9ecef;
}

.preference-option input[type="radio"],
.preference-option input[type="checkbox"] {
    margin-right: 8px;
}

.option-text {
    font-size: 0.9rem;
    color: #2c3e50;
}

.terms-section {
    margin-bottom: 20px;
}

.form-navigation {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-navigation .btn {
    flex: 1;
}

/* Estrella dorada para ejercicios especiales */
.exercise-number.special-gold::after {
    content: '⭐';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    animation: starPulse 2s infinite;
}

/* Modal de términos y privacidad */
.terms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.terms-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.terms-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

.terms-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    -webkit-appearance: none;
    appearance: none;
}

.terms-body {
    line-height: 1.6;
    color: #2c3e50;
}

.terms-body h3 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.terms-body p {
    margin-bottom: 12px;
}

.terms-body ul {
    margin: 12px 0;
    padding-left: 20px;
}

.terms-body li {
    margin-bottom: 6px;
}

/* Estados de carga y éxito */
.register-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 12px;
}

.success-message {
    color: #6c757d;
    margin-bottom: 24px;
    line-height: 1.5;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.exercise-counter {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.exercise-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2rem 0;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.exercise-number {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1rem;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Efecto de borde luminoso sutil */
.exercise-number::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(52, 152, 219, 0.1), 
        rgba(41, 128, 185, 0.05), 
        rgba(52, 152, 219, 0.1));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Efecto hover avanzado */
.exercise-number:hover {
    transform: translateY(-8px) rotateX(15deg) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(52, 152, 219, 0.3);
}

.exercise-number:hover::before {
    opacity: 1;
}

/* Estado: Completado */
.exercise-number.completed {
    background: linear-gradient(135deg, var(--success-color) 0%, #27ae60 100%);
    color: white;
    border-color: rgba(46, 204, 113, 0.3);
    box-shadow: 
        0 6px 25px rgba(46, 204, 113, 0.3),
        0 3px 12px rgba(46, 204, 113, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.exercise-number.completed::after {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    color: var(--success-color);
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Estado: Actual (Current) */
.exercise-number.current {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--accent-blue) 100%);
    color: white;
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 
        0 0 0 4px rgba(52, 152, 219, 0.1),
        0 15px 35px rgba(52, 152, 219, 0.3),
        0 6px 20px rgba(52, 152, 219, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-6px) scale(1.08);
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 
            0 0 0 4px rgba(52, 152, 219, 0.1),
            0 15px 35px rgba(52, 152, 219, 0.3),
            0 6px 20px rgba(52, 152, 219, 0.2);
    }
    100% {
        box-shadow: 
            0 0 0 6px rgba(52, 152, 219, 0.15),
            0 20px 45px rgba(52, 152, 219, 0.4),
            0 8px 25px rgba(52, 152, 219, 0.3);
    }
}

/* Efecto de partículas para el estado actual */
.exercise-number.current::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, 
        rgba(255, 255, 255, 0.3) 0%, 
        transparent 70%);
    transform: translate(-50%, -50%);
    animation: particle-rotate 4s linear infinite;
    opacity: 0.6;
}

@keyframes particle-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Estado: Bloqueado/No disponible */
.exercise-number.locked {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #adb5bd;
    border-color: #dee2e6;
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
    transform: none;
}

.exercise-number.locked::after {
    content: '🔒';
    position: absolute;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Efecto de carga para próximos ejercicios */
.exercise-number:not(.completed):not(.current):not(.locked):hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
}

/* Efecto de transición suave para cambios de estado */
.exercise-number {
    transition: 
        transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        background 0.4s ease,
        box-shadow 0.4s ease,
        border-color 0.3s ease;
}

/* Mejora visual del contenedor principal */
.progress-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.9) 100%);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--secondary-blue), 
        var(--success-color), 
        var(--secondary-blue));
    background-size: 200% 100%;
    animation: shimmer-line 3s ease-in-out infinite;
}

@keyframes shimmer-line {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue), var(--primary-blue));
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
    border-left: 4px solid var(--success-color);
    animation: slideIn 0.3s ease;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
    border-left: 4px solid #dc3545;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.formula-input {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    gap: 10px;
    width: 100%;
}

.formula-input label {
    font-weight: 500;
    margin-bottom: 5px;
}

.formula-input input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.formula-input input:focus {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.formula-input button {
    padding: 0.8rem 1.2rem;
    align-self: flex-start;
}

.reset-container {
    position: fixed;
    top: 20px;
    right: 10px;
    z-index: 100;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.reset-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.help-container {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.solution-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid var(--secondary-blue);
    display: none;
    animation: slideIn 0.3s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.solution-container code {
    background: #e8f4fd;
    padding: 0.5rem;
    border-radius: 4px;
    display: block;
    margin-top: 0.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.solution-container h3 {
    color: var(--accent-blue);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-modern {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1a4a8f 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: headerShine 6s infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* ========== MULTIPLE CHOICE ========== */
.multiple-choice-container {
    max-width: 600px;
    margin: 0 auto;
}

.question {
    margin-bottom: 2rem;
    text-align: center;
}

.question h3 {
    color: var(--accent-blue);
    font-size: 1.3rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.option:hover {
    background: #e9ecef;
    border-color: var(--secondary-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.option input[type="radio"] {
    display: none;
}

.option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.option-letter {
    font-weight: bold;
    color: var(--accent-blue);
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
}

.option-text {
    flex: 1;
    font-size: 1rem;
}

.option.selected {
    background: #d4edda;
    border-color: #28a745;
}

.option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.choice-actions {
    text-align: center;
    margin-top: 2rem;
}

/* ========== TUTORIALES ========== */
.tutorial-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eaeaea;
}

.tutorial-section h3 {
    color: var(--accent-blue);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.tutorial-section ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.tutorial-section li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.tutorial-demo {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.tutorial-demo h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    text-align: center;
}

.demo-section {
    margin-bottom: 1.5rem;
}

.demo-section h4 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.demo-explanation {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
}

.interface-demo {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.interface-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-blue);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.interface-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.interface-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 30px;
    text-align: center;
    color: var(--secondary-blue);
}

.interface-text {
    font-weight: 500;
    color: #2c3e50;
}

.tutorial-actions {
    margin-top: 2rem;
    text-align: center;
}

/* ========== SISTEMA DE LOGIN ========== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* O si prefieres, fuerza la ocultación con CSS */
.login-modal[style*="display: none"] {
    display: none !important;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    opacity: 0;
    animation: modalAppear 0.3s ease forwards;
    max-height: 90vh;
    overflow-y: auto;
}

.login-container::-webkit-scrollbar {
    width: 6px;
}

.login-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

@keyframes modalAppear {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.login-title {
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    display: inline-block;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.login-input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.login-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.login-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.login-input:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-btn {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.8rem;
}

.login-links {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.login-link:hover {
    text-decoration: underline;
    color: var(--primary-blue);
}

.login-message {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 6px;
    display: none;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.login-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.login-form {
    display: block;
}

/* Asegurar que los inputs tengan el estilo correcto */
input.login-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
}

/* ========== ACORDEONES ========== */
details {
  background-color: #f9f9fc;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 10px 0;
  padding: 12px 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Título del acordeón */
summary {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  padding-right: 24px;
  list-style: none;
}

/* Ícono de flecha animada */
summary::after {
  content: "▶";
  position: absolute;
  right: 0;
  transition: transform 0.3s ease;
}

/* Flecha rotada cuando está abierto */
details[open] summary::after {
  transform: rotate(90deg);
}

/* Contenido interno */
details p {
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #333;
}

/* Hover visual */
summary:hover {
  color: #0077cc;
}

/* ========== BADGES Y SECCIONES ESPECIALES ========== */
/* Badge de logro desbloqueado */
.achievement-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    animation: bounce 0.5s ease;
}

.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.welcome-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.concept-box {
    background: #e8f4fd;
    border: 1px solid #3498db;
    border-radius: 8px;
    padding: 1rem;
}

.structure-item, .nav-item, .help-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.structure-icon, .nav-icon, .help-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.formula-example {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.3rem;
    border-left: 5px solid #e74c3c;
}

.formula-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.formula-code {
    background: #2c3e50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.formula-explanation {
    color: #7f8c8d;
    font-size: 0.9rem;
}


.formula-practice {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.formula-input-demo {
    margin: 1rem 0;
}

.formula-input-demo label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.formula-explanation-demo {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.interface-overview {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
}

.interface-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.interface-element {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.element-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.element-info {
    display: flex;
    flex-direction: column;
}

.element-info strong {
    color: #2c3e50;
}

.element-info span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.login-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-login-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
}

.close-login-modal:hover {
    color: #333;
}

.login-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.login-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.login-form {
    padding: 30px;
    display: block;
}

.login-form.hidden-form {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links a {
    color: #3498db;
    text-decoration: none;
    display: block;
    margin: 8px 0;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-message {
    padding: 15px;
    margin: 20px 30px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.login-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Scrollbar personalizado para el modal */
.login-modal-content::-webkit-scrollbar {
    width: 6px;
}

.login-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.login-modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.login-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.completion-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid #c3e6cb;
}

.exercise-structure, .navigation-guide, .help-system {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.structure-item, .nav-item, .help-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.structure-icon, .nav-icon, .help-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.formula-examples {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.formula-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tip-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

/* Estilos para la sección de ejemplos prácticos */
.tutorial-demo {
    margin-top: 2rem;
}

.demo-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.demo-section h4 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.formula-practice {
    margin-top: 1.5rem;
}

.formula-instruction {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.formula-input-demo {
    margin: 1rem 0;
}

.formula-input-demo label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input:focus {
    border-color: #3498db;
    outline: none;
}

.formula-explanation-demo {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    border-left: 4px solid #27ae60;
}

.formula-explanation-demo code {
    background: #2c3e50;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.interface-overview {
    background: white;
    border-radius: 10px;
    padding: 1rem;
}

.interface-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.interface-element {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

.interface-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.element-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.element-info {
    display: flex;
    flex-direction: column;
}

.element-info strong {
    color: #2c3e50;
}

.element-info span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Estilos para las tablas de Excel */
.excel-table-container {
    margin: 1rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.excel-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 300px;
}

.excel-table th, .excel-table td {
    border: 1px solid #bdc3c7;
    padding: 0.75rem;
    text-align: center;
}

.excel-table thead th {
    background: #34495e;
    color: white;
    font-weight: bold;
}

.excel-table tbody th {
    background: #ecf0f1;
    font-weight: bold;
}

/* Estilos para el tutorial parte 1 */
.highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.progress-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.structure-item, .nav-item, .help-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.structure-icon, .nav-icon, .help-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.formula-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.formula-code {
    background: #2c3e50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.final-tip {
    background: linear-gradient(135deg, #037015 0%, #3e67c2 100%);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    color: #ffffff;
}

.final-tip h3 {
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.final-tip p {
    color: #f0f0f0;
    margin-bottom: 0;
}

.tutorial-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.tutorial-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tutorial-placeholder h3 {
    color: #495057;
    margin-bottom: 1rem;
}

.tutorial-placeholder p {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.btn-secondary:hover:not(:disabled) {
    background: #005da5;
    transform: translateY(-1px);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    -webkit-appearance: none;
    appearance: none;
}

.close-modal:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* ========== PUBLICIDAD ========== */
.ad-container {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.ad-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.ad-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.ad-description {
    font-size: 1rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.ad-cta {
    display: inline-block;
    background: #FFD700;
    color: #333;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.ad-cta:hover {
    background: #FFC400;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.ad-indicators {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.ad-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-indicator.active {
    background: white;
    transform: scale(1.2);
}

.ad-hidden {
    display: none;
}

/* ========== CERTIFICADOS ========== */
/* ========== CERTIFICADOS ========== */
/* ========== CERTIFICADOS ========== */
/* ========== CERTIFICADOS ========== */
/* ========== CERTIFICADOS ========== */
.certificate-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto; /* Habilita scroll vertical */
}

.certificate {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    overflow-y: auto; /* Scroll interno */
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin: 20px auto; /* Espacio para scroll */
}

/* Personalizar la barra de scroll del certificado */
.certificate::-webkit-scrollbar {
    width: 8px; /* Ancho de la barra */
}

.certificate::-webkit-scrollbar-track {
    background: #f1f1f1; /* Color del track */
    border-radius: 10px;
    margin: 10px 0;
}

.certificate::-webkit-scrollbar-thumb {
    background: #c1c1c1; /* Color del thumb */
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.certificate::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; /* Color al hacer hover */
}

/* Personalizar barra de scroll del contenedor principal */
.certificate-container::-webkit-scrollbar {
    width: 8px;
}

.certificate-container::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.1);
    border-radius: 10px;
}

.certificate-container::-webkit-scrollbar-thumb {
    background: rgba(193, 193, 193, 0.5);
    border-radius: 10px;
}

.certificate-container::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 168, 168, 0.7);
}

.certificate-pdf .certificate {
    width: 297mm !important; /* Ancho A4 */
    height: 210mm !important; /* Alto A4 */
    background: white;
    border-radius: 0 !important; /* Sin bordes redondeados para impresión */
    padding: 15mm 20mm !important; /* Padding más conservador */
    box-shadow: none !important; /* Sin sombras para impresión */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Cambiado de space-between */
    box-sizing: border-box !important;
    font-family: Arial, sans-serif !important;
    line-height: 1.4 !important; /* Reducido drásticamente */
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.certificate-pdf * {
    white-space: normal !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important; /* Reducido de 4 a 1.4 */
    margin-bottom: 4mm !important; /* Reducido de 8mm a 4mm */
    font-family: Arial, sans-serif !important;
    box-sizing: border-box !important;
}

/* Elementos específicos con márgenes controlados */
.certificate-pdf .certificate-title {
    font-size: 32px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin-bottom: 8mm !important;
    text-align: center !important;
    line-height: 1.2 !important;
    page-break-after: avoid !important;
}

.certificate-pdf .certificate-subtitle {
    font-size: 18px !important;
    color: #7f8c8d !important;
    margin-bottom: 6mm !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.certificate-pdf .student-name {
    font-size: 28px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin: 6mm 0 !important; /* Reducido */
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 3mm !important; /* Reducido */
}

.certificate-pdf .certificate-description {
    font-size: 16px !important;
    color: #5a6c7d !important;
    line-height: 1.5 !important;
    margin: 6mm 0 !important; /* Reducido */
    text-align: center !important;
}

.certificate-pdf .certificate-stats {
    display: flex !important;
    justify-content: space-around !important;
    margin: 8mm 0 !important; /* Reducido */
    padding: 4mm !important; /* Reducido */
}

.certificate-pdf .stat-item {
    text-align: center !important;
    padding: 0 2mm !important;
    margin-bottom: 0 !important; /* Eliminar margen adicional */
}

.certificate-pdf .stat-number {
    font-size: 24px !important; /* Reducido */
    font-weight: bold !important;
    color: #2c3e50 !important;
    display: block !important;
    margin-bottom: 1mm !important; /* Reducido */
    line-height: 1.2 !important;
}

.certificate-pdf .stat-label {
    font-size: 12px !important;
    color: #7f8c8d !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    margin-bottom: 0 !important; /* Eliminar margen adicional */
}

.certificate-pdf .certificate-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-top: 8mm !important; /* Reducido */
    padding-top: 4mm !important; /* Reducido */
    border-top: 2px solid #ecf0f1 !important;
}

.certificate-pdf .instructor-info,
.certificate-pdf .date-info {
    text-align: center !important;
    padding: 0 3mm !important; /* Reducido */
    margin-bottom: 0 !important; /* Eliminar margen adicional */
}

/* Reglas específicas para impresión */
@media print {
    .certificate-pdf .certificate {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 10mm 15mm !important;
        border: none !important;
    }
    
    .certificate-pdf * {
        margin-bottom: 3mm !important; /* Aún más reducido para impresión */
    }
    
    /* Evitar que se corte entre páginas */
    .certificate-pdf .certificate {
        page-break-before: always !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
    }
}

/* Clase para contenido que debe mantenerse junto */
.keep-together {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* Asegurar que no haya desbordamiento */
.certificate-pdf {
    max-width: 297mm !important;
    max-height: 210mm !important;
    overflow: hidden !important;
}

.certificate-pdf .certificate-title {
    font-size: 32px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin-bottom: 10mm !important;
    text-align: center !important;
    line-height: 1.2 !important;
    letter-spacing: 1px !important;
}

.certificate-pdf .certificate-subtitle {
    font-size: 20px !important;
    color: #7f8c8d !important;
    margin-bottom: 8mm !important;
    text-align: center !important;
    line-height: 1.3 !important;
}

.certificate-pdf .student-name {
    font-size: 36px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin: 8mm 0 !important;
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 4mm !important;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.certificate-pdf .certificate-description {
    font-size: 18px !important;
    color: #5a6c7d !important;
    line-height: 1.6 !important;
    margin: 8mm 0 !important;
    text-align: center !important;
    padding: 0 5mm !important;
    word-spacing: 2px !important;
    letter-spacing: 0.5px !important;
}

.certificate-pdf .certificate-stats {
    display: flex !important;
    justify-content: space-around !important;
    margin: 10mm 0 !important;
    padding: 6mm !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    border: 1px solid #e9ecef !important;
}

.certificate-pdf .stat-item {
    text-align: center !important;
    padding: 0 2mm !important;
}

.certificate-pdf .stat-number {
    font-size: 28px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    display: block !important;
    margin-bottom: 2mm !important;
    line-height: 1.2 !important;
}

.certificate-pdf .stat-label {
    font-size: 14px !important;
    color: #7f8c8d !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

.certificate-pdf .certificate-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-top: 10mm !important;
    padding-top: 6mm !important;
    border-top: 3px solid #ecf0f1 !important;
}

.certificate-pdf .instructor-info,
.certificate-pdf .date-info {
    text-align: center !important;
    padding: 0 5mm !important;
}

.certificate-pdf .instructor-name,
.certificate-pdf .certificate-date {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin-top: 2mm !important;
    line-height: 1.3 !important;
}

.certificate-pdf .instructor-title,
.certificate-pdf .date-title {
    font-size: 14px !important;
    color: #7f8c8d !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Estructura horizontal para PDF */
.certificate-pdf .certificate-content {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 25px;
    align-items: center;
}

.certificate-pdf .certificate-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-right: 15px;
    border-right: 2px solid rgba(255,255,255,0.3);
}

.certificate-pdf .certificate-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 15px;
}

/* Escalar elementos para PDF A4 Horizontal */
.certificate-pdf .certificate-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.certificate-pdf .certificate-header {
    text-align: center;
    margin-bottom: 8mm;
}

.certificate-pdf .certificate-title {
    font-size: 28px !important;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5mm;
}

.certificate-pdf .certificate-subtitle {
    font-size: 18px !important;
    color: #7f8c8d;
    margin-bottom: 8mm;
}

.certificate-pdf .student-name {
    font-size: 28px;
    padding: 20px 30px;
    margin: 25px 0;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
}
/* Cuerpo del certificado PDF */
.certificate-pdf .certificate-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.certificate-pdf .certificate-description {
    font-size: 14px;
    line-height: 1.5;
    margin: 20px 0;
    opacity: 0.9;
}

.certificate-pdf .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.certificate-pdf .stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.certificate-pdf .stat-number {
    font-size: 20px;
    font-weight: bold;
    display: block;
}

.certificate-pdf .stat-label {
    font-size: 12px;
    opacity: 0.8;
    display: block;
}

.certificate-pdf .signature-section {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.certificate-pdf .signature-left,
.certificate-pdf .signature-right {
    text-align: center;
}

.certificate-pdf .signature-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.certificate-pdf .signature-role,
.certificate-pdf .signature-date {
    font-size: 12px;
    opacity: 0.8;
}

.certificate-pdf .certificate-id-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.certificate-pdf .certificate-id {
    font-size: 11px;
    opacity: 0.7;
}

/* Ocultar botones en PDF */
.certificate-pdf .certificate-actions {
    display: none !important;
}

/* Fondos para ambos */
.certificate-basico {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.certificate-intermedio {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.certificate-avanzado {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
}




/* ========== BOTONES DE CERTIFICADOS ========== */
/* Botones para el popup */
.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 160px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.close-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 160px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px;
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #ff6b81 0%, #ff4757 100%);
}

/* Botones de certificados en ejercicios */
.btn-certificate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-width: 160px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    margin: 10px 5px;
}

.btn-certificate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Contenedor para alinear botones */
.certificate-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Variantes de colores para botones de certificados */
.btn-certificate-basico {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

.btn-certificate-basico:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%) !important;
}

.btn-certificate-intermedio {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
}

.btn-certificate-intermedio:hover {
    background: linear-gradient(135deg, #1976D2 0%, #2196F3 100%) !important;
}

.btn-certificate-avanzado {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
}

.btn-certificate-avanzado:hover {
    background: linear-gradient(135deg, #F57C00 0%, #FF9800 100%) !important;
}

/* Responsive para botones */
@media screen and (max-width: 768px) {
    .download-btn,
    .close-btn,
    .btn-certificate {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 140px;
        margin: 8px;
    }
    
    .certificate-actions {
        gap: 15px;
        margin-top: 25px;
    }
}

@media screen and (max-width: 480px) {
    .download-btn,
    .close-btn,
    .btn-certificate {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 120px;
        margin: 5px;
    }
    
    .certificate-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* Elementos decorativos */
.decorative-circle {
    position: absolute;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
}

.decorative-circle:nth-child(1) {
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    animation-delay: 0s;
}

.decorative-circle:nth-child(2) {
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.certificate-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.certificate-title {
    font-size: 36px;
    margin-bottom: 5px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.certificate-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.student-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.3);
}

.certificate-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.signature-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.signature-left, .signature-right {
    text-align: left;
}

.signature-right {
    text-align: right;
}

.signature-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.signature-role, .signature-date {
    opacity: 0.8;
    font-size: 14px;
}

.certificate-id {
    font-size: 12px;
    opacity: 0.8;
}











.btn-certificate-basico {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

.btn-certificate-intermedio {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
}

.btn-certificate-avanzado {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
}

/* Animaciones */
@keyframes popupIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.certificate-container[style*="display: block"] {
    animation: popupIn 0.3s ease-out;
}

/* Scroll personalizado para popup */
.certificate-container::-webkit-scrollbar {
    width: 8px;
}

.certificate-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.certificate-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.certificate-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Media Queries para mejor responsividad */
@media screen and (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .exercise-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .instructions-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
    
    .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
        min-width: 12px;
        max-width: 16px;
        font-size: 0.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .top-bar {
        padding: 0.3rem 0.5rem;
        min-height: 30px;
    }
    
    .user-panel {
        padding: 0.3rem 0.8rem;
        gap: 0.5rem;
    }
    
    .exercise-number {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Correcciones específicas para Safari */
@supports (-webkit-touch-callout: none) {
    .top-bar {
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
    }
    
    .progress-container {
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
    }
    
    .exercise-numbers {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* Mejoras de rendimiento para animaciones */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.certificate-basico {
    border: 15px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

.certificate-intermedio {
    border: 15px solid #2196F3;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.certificate-avanzado {
    border: 15px solid #FF9800;
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
}

.decorative-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.decorative-circle:nth-child(1) {
    width: 200px;
    height: 200px;
    background: #4CAF50;
    top: -50px;
    left: -50px;
}

.decorative-circle:nth-child(2) {
    width: 150px;
    height: 150px;
    background: #2196F3;
    bottom: -30px;
    right: -30px;
}

.certificate-title {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
    display: flex;
    justify-content: center; /* horizontal */

}

.certificate-subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.student-name {
    text-align: center;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    border-bottom: 3px solid #3498db;
    display: inline-block;
    display: flex;
    justify-content: center; /* horizontal */
}

.certificate-description {
    text-align: center;
    color: #34495e;
    font-size: 1.1rem;
    line-height: 1.6;
    justify-content: center; /* horizontal */
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 100px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
}

.signature-section {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid #bdc3c7;
}

.signature-left, .signature-right {
    text-align: center;
}

.signature-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    text-align: center;
}

.signature-role, .signature-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.certificate-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}



/* ========== RESPONSIVE ========== */
/* RESPONSE */
/* RESPONSE */
/* ===== RESPONSIVE SOLO PARA TABLETS Y CELULARES ===== */
/* ===== RESPONSIVE COMPLETO - PROGRESS STEPS FIX ===== */

/* Para tablets (hasta 1024px) */
@media screen and (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .exercise-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .instructions-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info.active {
        position: static;
        margin-top: 1rem;
    }
}

/* Para móviles medianos (hasta 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .top-bar {
        padding: 0.4rem 0.8rem;
        min-height: 50px;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    
    .user-panel {
        padding: 0.5rem 0.8rem;
        gap: 0.6rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .user-role {
        font-size: 0.65rem;
    }
    
    .logout-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .coins-container {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    header {
        margin-top: 50px;
        padding: 1rem 0;
    }
    
    .exercise-container {
        border-radius: 12px;
    }
    
    .instructions-panel,
    .exercise-area {
        padding: 1rem;
    }
    
    .instructions-panel h2 {
        font-size: 1.1rem;
    }
    
    .hint {
        padding: 0.8rem;
    }
    
    .formula-input {
        margin-top: 1rem;
    }
    
    .formula-input input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .solution-container {
        padding: 1rem;
    }
    
    /* PROGRESS STEPS FIX PARA MÓVILES */
    .progress-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 0.5rem;
        margin: 1rem 0;
    }
    
    .progress-steps {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0.8rem 0.5rem;
        width: 100%;
        min-width: min-content;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 3px;
        background: rgba(248, 250, 252, 0.6);
        border-radius: 12px;
        border: 1px solid rgba(2, 45, 109, 0.1);
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-blue) transparent;
        justify-content: flex-start;
        padding-bottom: 10px;
    }
    
    .progress-steps::-webkit-scrollbar {
        height: 4px;
    }
    
    .progress-steps::-webkit-scrollbar-thumb {
        background: var(--primary-blue);
        border-radius: 2px;
    }
    
    .progress-steps::-webkit-scrollbar-track {
        background: rgba(2, 45, 109, 0.1);
        border-radius: 3px;
        margin: 0 5px;
    }
    
    
    .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
        width: 35px;
        height: 35px;
        min-width: 35px;
        max-width: 35px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        font-size: 0.75rem;
        background: #f8f9fa;
        color: #6c757d;
        border: 1px solid #dee2e6;
        position: relative;
        z-index: 3;
        transition: all 0.2s ease;
        flex-shrink: 0;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
        aspect-ratio: 1 / 1;
        line-height: 1;
    }
    
    .progress-steps > div.completed {
        background: linear-gradient(135deg, var(--success-color), #27ae60) !important;
        color: white !important;
        border-color: var(--success-color) !important;
    }
    
    .progress-steps > div.active {
        background: linear-gradient(135deg, var(--primary-blue), var(--light-blue)) !important;
        color: white !important;
        border-color: var(--primary-blue) !important;
        transform: scale(1.1);
    }
    
    .progress-steps > div.restricted {
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        color: white !important;
        border-color: #f59e0b !important;
    }
    
    .progress-text {
        font-size: 0.9rem;
    }
    
    .exercise-counter {
        font-size: 0.8rem;
    }
    
    /* Tablas responsivas */
    .excel-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
    
    .excel-table {
        min-width: 500px;
        font-size: 0.85rem;
    }
    
    .excel-table th,
    .excel-table td {
        padding: 0.5rem;
        height: 35px;
        min-width: 60px;
    }
    
    /* Certificados en móvil */
    .certificate {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .certificate-title {
        font-size: 1.8rem;
    }
    
    .student-name {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .signature-section {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Mejoras para formularios en móvil */
    .form-group input,
    .login-input,
    .formula-input input {
        font-size: 16px;
        min-height: 44px;
    }
    
    .multiple-choice-container .option {
        min-height: 44px;
        padding: 0.8rem;
    }
}

/* Para móviles pequeños (hasta 480px) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .top-bar {
        padding: 0.3rem 0.6rem;
        min-height: 45px;
    }
    
    .user-panel {
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
    }
    
    .user-details {
        display: none;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    header {
        margin-top: 50px;
        padding: 1rem 0;
    }
    
    .exercise-container {
        border-radius: 12px;
    }
    
    .instructions-panel,
    .exercise-area {
        padding: 1rem;
    }
    
    .instructions-panel h2 {
        font-size: 1.1rem;
    }
    
    .hint {
        padding: 0.8rem;
    }
    
    .formula-input {
        margin-top: 1rem;
    }
    
    .formula-input input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .solution-container {
        padding: 1rem;
    }
    
    /* PROGRESS STEPS FIX PARA MÓVILES PEQUEÑOS */
    .progress-container {
        padding: 0.3rem;
        margin: 0.5rem 0;
    }

    
    .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
        width: 30px;
        height: 30px;
        min-width: 30px;
        max-width: 30px;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    
    .progress-steps::-webkit-scrollbar {
        height: 4px;
    }
    
    /* Exercise numbers más pequeños */
    .exercise-numbers {
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .exercise-number {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        border-radius: 12px;
    }
    
    /* Modal de login mejorado para móvil */
    .login-modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .login-header {
        padding: 1rem 1.5rem 0.5rem;
    }
    
    .login-form {
        padding: 1.5rem;
    }
    
    /* Certificados en móviles pequeños */
    .certificate {
        padding: 1rem;
    }
    
    .certificate-title {
        font-size: 1.5rem;
    }
    
    .certificate-subtitle {
        font-size: 0.9rem;
    }
    
    .student-name {
        font-size: 1.3rem;
        padding: 0.8rem;
    }
    
    .certificate-description {
        font-size: 0.9rem;
    }
}

/* Móviles muy pequeños (hasta 360px) */
@media screen and (max-width: 360px) {
    .main-title {
        font-size: 1.3rem;
    }
    
    .exercise-title {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.7rem 1rem;
    }
    
    /* PROGRESS STEPS FIX PARA MÓVILES MUY PEQUEÑOS */
    .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 0.65rem;
        border-radius: 5px;
    }
    
    
}

/* ===== ORIENTACIÓN HORIZONTAL ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .top-bar {
        padding: 0.2rem 0.8rem;
        min-height: 40px;
    }
    
    .exercise-content {
        min-height: 300px;
    }
    
    .instructions-panel {
        max-height: 250px;
    }
    
    .progress-container {
        padding: 0.5rem;
    }
    
    
    .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
        width: 25px;
        height: 25px;
        min-width: 25px;
        max-width: 25px;
        font-size: 0.6rem;
    }
    
    .login-modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===== MEJORAS ESPECÍFICAS PARA iOS ===== */
@supports (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        body {
            -webkit-font-smoothing: antialiased;
            -webkit-text-size-adjust: 100%;
        }
        
        .top-bar {
            position: -webkit-sticky;
            position: sticky;
            padding-top: env(safe-area-inset-top);
            background: rgba(255, 255, 255, 0.98);
            -webkit-backdrop-filter: blur(15px);
        }
        
        .exercise-numbers {
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
        }
        
        /* Mejor scroll en iOS */
        .excel-table-container,
        .instructions-panel,
        .certificate{
            -webkit-overflow-scrolling: touch;
        }
        
        
        /* Prevenir zoom en inputs */
        input,
        select,
        textarea {
            font-size: 16px;
        }
        
        .btn,
        .logout-btn,
        .login-btn {
            -webkit-appearance: none;
            border-radius: 8px;
            cursor: pointer;
        }
    }
}

/* ===== MEJORAS ESPECÍFICAS PARA ANDROID ===== */
@supports not (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        .top-bar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
        }
        
        .exercise-number,
        .btn,
        .progress-steps > div:not(.progress-line):not(.progress-line-fill) {
            transform: translateZ(0);
            backface-visibility: hidden;
            perspective: 1000px;
        }
    }
}

/* ===== PIXELES DE SEGURIDAD PARA NOTCH ===== */
@supports (padding: max(0px)) {
    @media screen and (max-width: 768px) {
        .top-bar {
            padding-left: max(0.8rem, env(safe-area-inset-left));
            padding-right: max(0.8rem, env(safe-area-inset-right));
            padding-top: max(0.4rem, env(safe-area-inset-top));
        }
        
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* ===== MEJORAS DE RENDIMIENTO ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== OPTIMIZACIONES FINALES ===== */
img,
video {
    max-width: 100%;
    height: auto;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

@media screen and (max-width: 768px) {
    p, li, .instructions-panel code {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* ===== FIX URGENTE PARA PROGRESS STEPS - SE APLICA SOLO EN MÓVILES ===== */
@media screen and (max-width: 768px) {
    .progress-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .progress-steps {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0.8rem 0.5rem;
        width: auto; /* CAMBIA 100% por auto */
        min-width: min-content;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 3px;
        background: rgba(248, 250, 252, 0.6);
        border-radius: 12px;
        border: 1px solid rgba(2, 45, 109, 0.1);
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-blue) transparent;
        justify-content: flex-start;
        padding-bottom: 10px;
    }
    
    .progress-steps > div {
        flex-shrink: 0 !important;
        min-width: 35px !important;
    }
}

/* ========== FIX RÁPIDO PARA BOTÓN VERIFICAR ========== */
@media screen and (max-width: 768px) {
    .navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        display: flex;
        gap: 10px;
    }
    
    .exercise-area {
        padding-bottom: 100px;
    }
}


.certificate-pdf {
    transform: rotate(0deg);
    display: none;
    width: 297mm !important;
    height: 210mm !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 !important;
    padding: 15mm !important;
    box-sizing: border-box;
    position: relative;
    overflow: visible !important;
    font-family: Arial, sans-serif !important;
    gap: 10mm;
    overflow: hidden; 
}


/* Estilos específicos para PDF */
@media print {
    .certificate-pdf {
        width: 297mm;
        height: 210mm;
        background: white;
        padding: 20mm;
        display: block;
    }
        
    .certificate-actions {
        display: none !important;
    }
    
    .certificate {
        box-shadow: none !important;
        margin: 0 !important;
        border: 20px solid #2c3e50 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .certificate {
        padding: 20px;
        margin: 10px;
    }
    
    .certificate-title {
        font-size: 2rem;
    }
    
    .student-name {
        font-size: 1.6rem;
    }
    
    .stats-grid {
        gap: 15px;
    }
    
    .signature-section {
        flex-direction: column;
        gap: 20px;
    }
}


/* ========== SOLUCIÓN DEFINITIVA PARA SCROLL HORIZONTAL ========== */
@media screen and (max-width: 768px) {
    .progress-container {
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.5rem !important;
    }
    
    .progress-steps {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content !important;
        min-width: 100% !important;
        justify-content: flex-start !important;
        overflow-x: visible !important;
        overflow-y: hidden !important;
        gap: 3px !important;
        padding: 0.8rem 0.5rem !important;
    }
    
    .progress-steps > div:not(.progress-line) {
        flex-shrink: 0 !important;
        width: 35px !important;
        height: 35px !important;
        min-width: 35px !important;
        max-width: 35px !important;
    }
    
    /* Scrollbar styling */
    .progress-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .progress-container::-webkit-scrollbar-track {
        background: rgba(2, 45, 109, 0.1);
        border-radius: 3px;
        margin: 0 10px;
    }
    
    .progress-container::-webkit-scrollbar-thumb {
        background: var(--primary-blue);
        border-radius: 3px;
    }
}
