/* Module Styles - Aprende Web 2025 */

/* Header & Progress */
.module-header,
.header {
    background: var(--surface-color);
    padding: 1rem 0;
    position: sticky;
    top: 70px;
    z-index: 90;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.module-progress-header {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
}

/* 1. Lesson Intro */
.lesson-intro {
    text-align: center;
    margin-bottom: 4rem;
    padding: 4rem 1rem;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.intro-visual {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lesson-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 2. Lesson Steps General */
.lesson-step {
    margin-bottom: 5rem;
    border-left: 3px solid rgba(59, 130, 246, 0.2);
    padding-left: 2rem;
    position: relative;
}

.lesson-step h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}

.lesson-step p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* 3. Learning Goals */
.learning-goals {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.learning-goals li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* 4. Theory & Analogy */
.theory-box {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
}

.analogy {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-color);
}

.analogy h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1rem;
}

/* 5. Code Examples */
.code-example-card {
    background: #0f172a;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.code-example-card h3 {
    background: rgba(255,255,255,0.05);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.code-example-card > p {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.95rem;
}

.code-window {
    padding: 1.5rem;
    overflow-x: auto;
}

.explanation {
    padding: 1rem 1.5rem;
    background: rgba(245, 158, 11, 0.05);
    color: #fbbf24;
    font-size: 0.9rem !important;
    border-top: 1px solid rgba(245, 158, 11, 0.1);
}

/* 6. Practice Guide */
.practice-guide {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.steps-list {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.steps-list li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

/* 7. Quiz Styles */
.loader {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loader::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.quiz-error {
    color: var(--error-color);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    text-align: center;
}

.question-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.question-card h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 1rem;
    text-align: left;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success-color);
    color: white;
}

.quiz-option.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error-color);
    color: white;
    opacity: 0.7;
}

.answered .quiz-option {
    cursor: default;
    pointer-events: none;
}

.feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.feedback.hidden { display: none; }

.feedback-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.feedback-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 8. Summary List */
.summary-list li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* 9. Challenges */
.challenge-card {
    background: linear-gradient(to bottom right, #1e293b, #0f172a);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.challenge-card h3 {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.challenge-interaction {
    margin-top: 1.5rem;
}

.toggle-solution {
    margin-bottom: 1rem;
}

.solution-code, .solution-content {
    background: #000;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    border: 1px solid var(--primary-dark);
}

.solution-code.hidden, .solution-content.hidden {
    display: none;
}

/* Navigation */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 5rem;
    margin-bottom: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-step {
        padding-left: 0;
        border-left: none;
        border-top: 3px solid rgba(59, 130, 246, 0.2);
        padding-top: 2rem;
    }
}

/* Slide System */
.slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.slide#slide-1 {
    display: block;
}

.slide-header {
    text-align: center;
    margin-bottom: 2rem;
}

.slide-number {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
}

.slide-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 300px;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    flex: 1;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.slide-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Modal for Auth */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

#auth-form input, #auth-form select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.cert-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
}

.field-error {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

input.error, select.error {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

input:focus.error {
    border-color: var(--error-color);
    outline: none;
}

/* === Integrado de lesson.css (template legacy) === */

/* Lesson Container (template) */
.lesson-container {
    padding: 3rem 0;
}

/* Lesson Sections (template - paralelo a .lesson-step) */
.lesson-section {
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.lesson-section:last-child {
    border-bottom: none;
}

.lesson-section .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

/* Content Box (template) */
.content-box {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
}

.content-box ul {
    list-style: none;
    padding: 0;
    margin-left: 1.5rem;
}

.content-box li {
    margin-bottom: 1rem;
    position: relative;
}

.content-box li::before {
    content: '\1F3AF';
    position: absolute;
    left: -1.5rem;
    font-size: 1rem;
}

/* Analogy Box (template - paralelo a .analogy) */
.analogy-box {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(59, 130, 246, 0.08);
    border: 2px solid rgba(59, 130, 246, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
}

.analogy-icon {
    font-size: 2rem;
}

.analogy-content h4 {
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

/* Step-by-Step (template - paralelo a .steps-list) */
.step-by-step .step {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-color);
}

.step-by-step .step:last-child {
    border-bottom: none;
}

.step-by-step h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.step-by-step pre {
    background: #1e293b;
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

/* Quiz container (template - paralelo a .question-card) */
#quiz-container .question {
    margin-bottom: 2rem;
}

#quiz-container .question-text {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

#quiz-container .options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

#quiz-container .option {
    display: block;
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

#quiz-container .option:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

#quiz-container .option.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success-color);
    color: white;
}

#quiz-container .option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error-color);
    color: white;
}

#quiz-container .explanation {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.05);
}

#quiz-container .explanation .analogy-box {
    background: rgba(255, 255, 255, 0.03);
}

.feedback-icon {
    margin-left: 1rem;
    font-size: 1.25rem;
}

.option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question.answered .option:not(.correct):not(.incorrect) {
    opacity: 0.6;
}

/* Tip box */
.tip {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.95rem;
}
