/* =====================================================
   CAPACITACIÓN FIBRA ÓPTICA - MACROTICS S.A.S
   Estilos principales
   ===================================================== */

/* Variables CSS */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --white: #1e293b;
    --light: #0f172a;
    --dark: #f1f5f9;
    --dark-light: #cbd5e1;
    --gray: #94a3b8;
    --gray-light: #475569;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 15px;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

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

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background-color: var(--light);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
}

/* Progress Bar */
.progress-container {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--light);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
    padding: 40px 0;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--gradient);
    color: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
}

/* Modules Overview */
.modules-overview h2 {
    margin-bottom: 30px;
    text-align: center;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.modules-list-header {
    margin-bottom: 28px;
}

.modules-list-header h1 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.modules-list-subtitle {
    color: var(--gray);
    font-size: 1rem;
}

.quiz-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.quiz-badge.passed {
    background: #d1fae5;
    color: #065f46;
}

.quiz-badge.failed {
    background: #fef3c7;
    color: #92400e;
}

.module-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.module-card.completed {
    border: 2px solid var(--success);
}

.module-card.completed::before {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: var(--success);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1;
}

.module-header {
    background: var(--gradient);
    color: var(--white);
    padding: 25px;
}

.module-number {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.module-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.module-body {
    padding: 20px 25px;
}

.module-description {
    color: var(--gray);
    margin-bottom: 15px;
}

.module-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--gray-light);
}

.module-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.module-progress-mini {
    margin-top: 15px;
}

.progress-mini-bar {
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-mini-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Module Content */
.module-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.module-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.module-title-large {
    font-size: 1.8rem;
    color: var(--dark);
}

.content-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.content-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light);
}

.content-section h3 {
    color: var(--dark);
    margin: 20px 0 15px;
}

.content-section p {
    margin-bottom: 15px;
    color: var(--dark-light);
}

.content-section ul,
.content-section ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
    color: var(--dark-light);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.data-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.data-table tr:hover {
    background: var(--light);
}

/* Info Boxes */
.info-box {
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.info-box.analogy {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid var(--primary);
}

.info-box.analogy::before {
    content: '💡 Analogía: ';
    font-weight: 600;
    color: var(--primary-dark);
}

.info-box.tip {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid var(--success);
}

.info-box.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--warning);
}

.info-box.important {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid var(--danger);
}

/* Diagrams */
.diagram {
    background: var(--light);
    padding: 25px;
    border-radius: var(--radius);
    margin: 20px 0;
    text-align: center;
    overflow-x: auto;
}

.diagram-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
}

.diagram-svg {
    max-width: 100%;
    height: auto;
}

/* Interactive Elements */
.interactive-element {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    border: 2px dashed var(--gray-light);
}

.interactive-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Module Navigation */
.module-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--light);
}

.module-navigation .btn {
    min-width: 150px;
}

/* Progress Section */
.progress-overview {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: center;
}

.progress-card {
    text-align: center;
    padding: 30px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.progress-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, var(--light) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 130px;
    height: 130px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
}

.progress-percent {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-stats {
    display: grid;
    gap: 20px;
}

.stat-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
}

/* Certificate */
.certificate-container {
    max-width: 800px;
    margin: 0 auto;
}

.certificate-locked {
    text-align: center;
    padding: 60px 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.certificate-locked h2 {
    margin-bottom: 15px;
    color: var(--dark);
}

.certificate-locked p {
    color: var(--gray);
    margin-bottom: 30px;
}

.certificate-requirements {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--light);
    border-radius: var(--radius);
}

.requirement.completed {
    background: #d1fae5;
}

.requirement.completed .req-icon {
    color: var(--success);
}

/* Certificate Unlocked */
.certificate-unlocked {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.certificate-header {
    background: var(--gradient);
    color: var(--white);
    padding: 40px;
    text-align: center;
}

.certificate-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.certificate-header p {
    opacity: 0.9;
}

.certificate-body {
    padding: 40px;
    text-align: center;
}

.certificate-recipient {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.certificate-text {
    font-size: 1.1rem;
    color: var(--dark-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

.certificate-details {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.certificate-detail {
    text-align: center;
}

.certificate-detail-label {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.certificate-detail-value {
    font-weight: 600;
    color: var(--dark);
}

.certificate-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-small {
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--light);
}

.modal-header h2 {
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 5px;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid var(--light);
}

/* Quiz Styles */
.quiz-progress {
    margin-bottom: 25px;
}

.quiz-progress-bar {
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.quiz-question-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--dark);
}

.quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-option {
    padding: 15px 20px;
    background: var(--light);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--white);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: #dbeafe;
}

.quiz-option.correct {
    border-color: var(--success);
    background: #d1fae5;
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: #fee2e2;
}

.quiz-feedback {
    padding: 15px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.quiz-feedback.correct {
    background: #d1fae5;
    color: #065f46;
}

.quiz-feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

/* Results */
.results-body {
    text-align: center;
}

.results-score {
    margin-bottom: 20px;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.score-total {
    font-size: 2rem;
    color: var(--gray);
}

.results-actions {
    margin-top: 25px;
}

/* Footer */
.main-footer {
    background: var(--dark);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-contact {
    margin-top: 10px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
    }

    .main-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 10px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .progress-overview {
        grid-template-columns: 1fr;
    }

    .certificate-requirements {
        flex-direction: column;
        align-items: center;
    }

    .module-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .module-navigation .btn {
        width: 100%;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 15px;
    }

    .content-section {
        padding: 20px;
    }

    .module-header {
        padding: 20px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* ==========================================
   IMÁGENES DE LOS MÓDULOS E INFOGRAFÍAS
   ========================================== */

.module-image-container {
    margin: 30px auto;
    text-align: center;
    max-width: 100%;
}

.module-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    cursor: zoom-in;
    border: 3px solid var(--white);
}

[data-theme="dark"] .module-image {
    border-color: var(--dark-light);
}

.module-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.figure-caption {
    margin-top: 15px;
    font-size: 0.95rem;
    color: var(--gray);
    font-style: italic;
}

[data-theme="dark"] .figure-caption {
    color: var(--gray-light);
}

/* LightBox Modal (Image Viewer) */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--primary-light);
}

/* ==========================================
   SIMULADOR DRAG AND DROP - MAPA DE BARRIO
   ========================================== */

.simulator-content {
    max-width: 1200px;
    width: 98%;
    max-height: 95vh;
    overflow-y: auto;
}

.sim-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sim-score {
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.simulator-instructions {
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.simulator-feedback {
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
}

.simulator-feedback.success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

/* ---- MAPA ISOMÉTRICO FTTH ---- */
.map-scroll-container {
    width: 100%;
    overflow-x: auto;
    border: 3px solid #334155;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    background: #111827;
}

.city-map {
    position: relative;
    width: 1100px;
    height: 750px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Imagen isométrica de fondo */
.iso-map {
    background-image: url('img/isometric_map.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* Badge flotante ODN */
.odn-badge {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 10;
    background: linear-gradient(135deg, #0ea5e9, #7c3aed);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(14,165,233,0.5);
    letter-spacing: 0.03em;
    white-space: nowrap;
    pointer-events: none;
}

/* ---- LANDMARKS — posicionados sobre imagen isométrica ---- */
.map-landmark {
    position: absolute;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.landmark-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: rgba(15,23,42,0.85);
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}

.landmark-slots {
    display: flex;
    gap: 10px;
}

/* Posiciones ajustadas a la imagen isométrica de 1100×750px
   La ciudad tiene forma de diamante: 
   - Esquina izq (izquierda del mapa) = zona izq
   - Esquina sup (arriba) = fondo/Central
   - Esquina der = zona derecha casas
   - Esquina inf = frente/acometidas */
.landmark-central { top: 6%;  left: 28%; }   /* Parte alta izq — edificio Central */
.landmark-trunk   { top: 28%; left: 12%; }   /* Poste calle izquierda */
.landmark-splice  { top: 28%; left: 47%; }   /* Poste central intersección */
.landmark-dist    { top: 35%; left: 49%; }   /* Encima del tramo verde (Empalme→Dist.Acometida) */
.landmark-nap     { top: 28%; left: 68%; }   /* Poste calle derecha */
.landmark-drop    { top: 52%; left: 68%; }   /* Acometida bajando */
.landmark-home    { top: 65%; left: 80%; }   /* Casa cliente esquina inf-der */

/* ---- DROP SLOTS (casillas ?) ---- */
.map-slot {
    width: 72px;
    min-height: 65px;
    background: rgba(255,255,255,0.12);
    border: 2px dashed rgba(255,255,255,0.5);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

[data-theme="dark"] .map-slot {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.2);
}

.cable-slot {
    width: 62px;
    min-height: 55px;
}

.slot-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.map-slot.drag-over {
    background: rgba(37, 99, 235, 0.4);
    border-color: #60a5fa;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(37,99,235,0.5);
}

.map-slot.correct {
    border: 2px solid var(--success);
    background: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 12px rgba(34,197,94,0.4);
}

.map-slot.correct .slot-number { display: none; }

.map-slot.incorrect {
    border: 2px solid var(--danger);
    background: rgba(239, 68, 68, 0.3);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.map-slot .draggable-item {
    width: 100%;
    margin: 0;
    border: none;
    cursor: default;
    padding: 3px;
    background: transparent;
}

.map-slot .draggable-item img { height: 42px; }
.map-slot .draggable-item span { display: none; }

/* Fibra óptica SVG decorativa */
.fiber-path {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 4;
    pointer-events: none;
}

[data-theme="dark"] .city-map {
    background: #1b3320;
    border-color: #4a7c59;
}

/* ZONA ODN (Red Pasiva) */
.odn-zone {
    position: absolute;
    top: 5%;
    left: 40%;
    width: 48%;
    height: 85%;
    background: rgba(14, 165, 233, 0.08); /* Azul transparente */
    border: 3px dashed rgba(14, 165, 233, 0.5);
    border-radius: var(--radius-lg);
    z-index: 1; /* Debajo de los landmarks */
    pointer-events: none;
}

.odn-label-banner {
    position: absolute;
    top: 0;
    left: 20px;
    background: rgba(14, 165, 233, 0.9);
    color: white;
    padding: 6px 20px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

[data-theme="dark"] .odn-zone {
    background: rgba(14, 165, 233, 0.05);
}

/* MANZANAS BARRIALES (Blocks) */
.map-block {
    position: absolute;
    background: #aed581; /* Verde pasto claro */
    border-radius: 10px;
    z-index: 1;
    border: 2px solid #9ccc65;
    opacity: 0.6;
}

[data-theme="dark"] .map-block {
    background: #2e4d34;
    border-color: #385e3f;
}

.block-1 { top: 10%; left: 52%; width: 25%; height: 28%; } /* Arriba derecha */
.block-2 { top: 55%; left: 8%; width: 33%; height: 35%; } /* Abajo central */
.block-3 { top: 55%; left: 52%; width: 40%; height: 35%; } /* Abajo derecha (residencial) */
.block-4 { top: 10%; left: 80%; width: 15%; height: 28%; }

/* CALLES */
.street {
    position: absolute;
    background: #cfd8dc;
    z-index: 2; /* Sobre ODN, debajo the landmarks */
    display: flex;
    justify-content: center;
    align-items: center;
}

[data-theme="dark"] .street {
    background: #37474f;
}

.street-line {
    background: transparent;
}

.street-main {
    top: 42%;
    left: 0;
    width: 100%;
    height: 45px;
}
.street-main .street-line {
    display: none;
}

.street-secondary {
    top: 0;
    left: 45%;
    width: 40px;
    height: 100%;
}
.street-secondary .street-line {
    display: none;
}

.street-residential {
    top: 68%;
    left: 40%;
    width: 60%;
    height: 30px;
}
.street-residential .street-line {
    display: none;
}

/* EDIFICIOS DECORATIVOS (Edificios comerciales/oficinas) */
.map-building {
    position: absolute;
    background: #90a4ae;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    z-index: 3;
}

[data-theme="dark"] .map-building {
    background: #546e7a;
}

.bld-1 { top: 18%; left: 18%; width: 80px; height: 90px; }
.bld-2 { top: 25%; left: 32%; width: 60px; height: 70px; }

/* CASAS EN ZONA RESIDENCIAL */
.map-house {
    position: absolute;
    font-size: 2rem; /* Emojis grandes para casas */
    z-index: 3;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.2));
}

.house-1 { top: 56%; left: 55%; }
.house-2 { top: 58%; left: 63%; }
.house-3 { top: 54%; left: 70%; }
.house-4 { top: 58%; left: 78%; }
.house-5 { top: 55%; left: 88%; }
.house-6 { top: 80%; left: 52%; }
.house-7 { top: 82%; left: 60%; }
.house-8 { top: 78%; left: 68%; }
.house-9 { top: 83%; left: 76%; }

/* ÁRBOLES */
.map-tree {
    position: absolute;
    font-size: 1.6rem;
    z-index: 3;
    opacity: 0.85;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.tree-1 { top: 15%; left: 10%; }
.tree-2 { top: 38%; left: 15%; }
.tree-3 { top: 52%; left: 30%; font-size: 1.8rem; }
.tree-4 { top: 12%; left: 60%; }
.tree-5 { top: 28%; left: 55%; }
.tree-6 { top: 15%; left: 85%; }
.tree-7 { top: 82%; left: 20%; font-size: 1.9rem; }
.tree-8 { top: 85%; left: 90%; }

/* POSTES */
.map-pole {
    position: absolute;
    width: 6px;
    height: 40px;
    background: #5d4037;
    border-radius: 2px;
    z-index: 3;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.map-pole::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -7px;
    width: 20px;
    height: 4px;
    background: #3e2723;
    border-radius: 2px;
}

.pole-1 { top: 38%; left: 25%; }
.pole-2 { top: 38%; left: 55%; }
.pole-3 { top: 38%; left: 70%; }
.pole-4 { top: 64%; left: 48%; }
.pole-5 { top: 64%; left: 70%; }
.pole-6 { top: 64%; left: 92%; }

/* LÍNEA DE FIBRA DECORATIVA */
.fiber-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* ---- LANDMARKS (puntos del mapa donde arrastar) ---- */
.map-landmark {
    position: absolute;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.landmark-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.landmark-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #333;
    background: rgba(255,255,255,0.9);
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .landmark-label {
    background: rgba(30,41,59,0.9);
    color: #ccc;
}

.landmark-slots {
    display: flex;
    gap: 15px; /* Más separados */
}

/* POSICIONES DE LOS LANDMARKS ESPARCIDAS EN 1400px */
.landmark-central { top: 8%; left: 5%; }
.landmark-trunk   { top: 32%; left: 28%; }
.landmark-splice  { top: 22%; left: 45%; }
.landmark-dist    { top: 52%; left: 55%; }
.landmark-nap     { top: 32%; left: 70%; }
.landmark-drop    { top: 58%; left: 80%; }
.landmark-home    { top: 68%; left: 88%; }

/* DROP SLOTS del mapa (sin nombres, solo ?) */
.map-slot {
    width: 70px;
    min-height: 60px;
    font-size: 0.7rem;
    padding: 4px;
    background: rgba(255,255,255,0.7);
    border: 2px dashed rgba(0,0,0,0.25);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] .map-slot {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.2);
}

.cable-slot {
    width: 60px;
    min-height: 50px;
}

.slot-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray);
    pointer-events: none;
}

.map-slot.drag-over {
    background: rgba(37, 99, 235, 0.3);
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(37,99,235,0.4);
}

.map-slot.correct {
    border: 2px solid var(--success);
    background: rgba(34, 197, 94, 0.25);
}

.map-slot.correct .slot-number {
    display: none;
}

.map-slot.incorrect {
    border: 2px solid var(--danger);
    background: rgba(239, 68, 68, 0.25);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.map-slot .draggable-item {
    width: 100%;
    margin: 0;
    border: none;
    cursor: default;
    padding: 2px;
    background: transparent;
}

.map-slot .draggable-item img {
    height: 35px;
}

.map-slot .draggable-item span {
    display: none; /* Sin nombres dentro del mapa */
}

/* ---- INVENTARIO ---- */
.inventory-area {
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 15px;
}

[data-theme="dark"] .inventory-area {
    background: var(--darker);
}

.inventory-area h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 0.95rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.draggable-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px;
    text-align: center;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

[data-theme="dark"] .draggable-item {
    background: var(--dark-light);
    border-color: var(--border-dark);
}

.draggable-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.draggable-item img {
    max-width: 100%;
    height: 50px;
    object-fit: contain;
    margin-bottom: 4px;
    pointer-events: none;
}

.draggable-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    pointer-events: none;
}


/* Print Styles */
@media print {
    .main-header,
    .progress-container,
    .main-footer,
    .module-navigation,
    .btn {
        display: none !important;
    }

    .section {
        display: block !important;
    }

    .content-section {
        break-inside: avoid;
    }
}

/* ==========================================
   DEMO EN VIVO — TARJETAS DE DEMOSTRACIÓN
   ========================================== */
.demo-card {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    border-radius: 16px;
    padding: 20px 22px;
    margin: 24px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 8px 28px rgba(220, 38, 38, 0.28);
    border: 1px solid rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}
.demo-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 130px; height: 130px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}
.demo-card-emoji { font-size: 2.2rem; flex-shrink: 0; margin-top: 2px; }
.demo-card-inner { flex: 1; }
.demo-card-badge {
    display: inline-block;
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.demo-card h4 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 8px;
}
.demo-card p {
    color: rgba(255,255,255,0.88);
    font-size: 0.88rem;
    margin: 0 0 10px;
    line-height: 1.5;
}
.demo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}
.demo-tag {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 4px 13px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}
.demo-card-hint {
    background: rgba(0,0,0,0.22);
    border-radius: 9px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.93) !important;
    font-size: 0.84rem !important;
    font-style: italic;
    margin: 8px 0 0 !important;
    border-left: 3px solid rgba(255,255,255,0.4);
    line-height: 1.5;
}
.demo-observe {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}
.demo-observe strong { color: #fff; }

/* ==========================================
   SIGNAL JOURNEY — ANIMACIÓN DEL RECORRIDO
   ========================================== */
.signal-journey-wrapper { margin: 28px 0; }
.signal-journey-title {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.signal-journey {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    padding: 28px 18px 22px;
    position: relative;
    overflow: hidden;
    gap: 0;
}
/* Traveling light dot */
.signal-journey::before {
    content: '';
    position: absolute;
    top: 42px;
    left: 4%;
    width: 28px; height: 12px;
    background: radial-gradient(ellipse at 40% 50%, #fef08a 0%, #fbbf24 35%, #f97316 70%, transparent 100%);
    border-radius: 50%;
    animation: travelLight 8s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    filter: blur(0.5px);
}
@keyframes travelLight {
    0%          { left: 3%;  opacity: 0; }
    1%          { opacity: 1; }
    95%         { left: 90%; opacity: 1; }
    97%, 100%   { left: 90%; opacity: 0; }
}
.sj-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    min-width: 68px;
}
.sj-icon-box {
    width: 56px; height: 56px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    background: rgba(99,102,241,0.1);
    border: 2px solid rgba(99,102,241,0.22);
    transition: all 0.3s ease;
    cursor: default;
}
.sj-label {
    color: #cbd5e1;
    font-size: 0.67rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.2px;
}
.sj-sublabel {
    color: #475569;
    font-size: 0.58rem;
    text-align: center;
    margin-top: -3px;
}
.sj-wire {
    flex: 1;
    height: 4px;
    background: rgba(99,102,241,0.14);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    min-width: 10px;
    max-width: 66px;
}
.sj-wire::after {
    content: '';
    position: absolute;
    top: 0; left: -65%;
    width: 65%; height: 100%;
    background: linear-gradient(90deg, transparent, #fbbf24 45%, #f97316, transparent);
    border-radius: 2px;
    animation: wireFlow 8s linear infinite;
    opacity: 0;
}
@keyframes wireFlow {
    0%,5.5%,15%,100% { left: -65%; opacity: 0; }
    6%    { left: -65%; opacity: 1; }
    13.5% { left: 110%; opacity: 1; }
    14%   { left: 110%; opacity: 0; }
}
/* Sequential node glows */
@keyframes nodeGlow {
    0%,6%,100% {
        background: rgba(99,102,241,0.1);
        border-color: rgba(99,102,241,0.22);
        box-shadow: none;
        transform: scale(1);
    }
    1%,4% {
        background: rgba(251,191,36,0.28);
        border-color: #fbbf24;
        box-shadow: 0 0 22px rgba(251,191,36,0.55), 0 0 8px rgba(251,191,36,0.3);
        transform: scale(1.1);
    }
}
/* Wire delays (fire between node glows) */
.signal-journey > .sj-wire:nth-child(2)::after  { animation-delay: 0.7s; }
.signal-journey > .sj-wire:nth-child(4)::after  { animation-delay: 1.84s; }
.signal-journey > .sj-wire:nth-child(6)::after  { animation-delay: 2.98s; }
.signal-journey > .sj-wire:nth-child(8)::after  { animation-delay: 4.12s; }
.signal-journey > .sj-wire:nth-child(10)::after { animation-delay: 5.26s; }
.signal-journey > .sj-wire:nth-child(12)::after { animation-delay: 6.40s; }
/* Node glow delays */
.signal-journey > .sj-node:nth-child(1)  .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 0s; }
.signal-journey > .sj-node:nth-child(3)  .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 1.14s; }
.signal-journey > .sj-node:nth-child(5)  .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 2.28s; }
.signal-journey > .sj-node:nth-child(7)  .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 3.43s; }
.signal-journey > .sj-node:nth-child(9)  .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 4.57s; }
.signal-journey > .sj-node:nth-child(11) .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 5.71s; }
.signal-journey > .sj-node:nth-child(13) .sj-icon-box { animation: nodeGlow 8s ease-in-out infinite 6.85s; }
.sj-caption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin-top: 10px;
    font-style: italic;
}
/* Mobile: vertical layout */
@media (max-width: 620px) {
    .signal-journey { flex-direction: column; padding: 20px 22px; }
    .signal-journey::before { display: none; }
    .sj-wire {
        width: 4px; height: 24px;
        min-width: unset; max-width: unset;
    }
    .sj-node { flex-direction: row; gap: 12px; min-width: unset; }
    .sj-label, .sj-sublabel { text-align: left; }
}

/* ==========================================
   FUSION TIMER — TEMPORIZADOR DE LABORATORIO
   ========================================== */
.fusion-timer {
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 18px;
    padding: 22px 24px;
    margin: 24px 0 30px;
    box-shadow: 0 4px 20px rgba(37,99,235,0.1);
}
.ft-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.ft-left h4 {
    margin: 0 0 2px;
    color: var(--primary-dark);
    font-size: 1rem;
}
.ft-step-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.ft-display {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    line-height: 1;
    transition: color 0.4s;
}
.ft-display.warning { color: var(--warning); }
.ft-display.danger  { color: var(--danger); animation: blinkRed 0.6s ease-in-out infinite alternate; }
@keyframes blinkRed { from { opacity: 1; } to { opacity: 0.45; } }
.ft-bar {
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 18px;
}
.ft-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 1s linear, background 0.5s;
    width: 100%;
}
.ft-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #f97316); }
.ft-bar-fill.danger  { background: var(--danger); }
.ft-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
@media (max-width: 480px) { .ft-steps-grid { grid-template-columns: repeat(2, 1fr); } }
.ft-step-btn {
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    line-height: 1.3;
}
.ft-step-btn:hover { border-color: var(--primary-light); background: var(--light-blue); }
.ft-step-btn.active { background: var(--light-blue); border-color: var(--primary); color: var(--primary-dark); }
.ft-step-btn.done { background: #d1fae5; border-color: var(--success); color: #065f46; }
.ft-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.ft-tip {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--light-blue);
    border-radius: 9px;
    font-size: 0.82rem;
    color: var(--primary-dark);
    border-left: 3px solid var(--primary);
}
.ft-done-msg {
    display: none;
    text-align: center;
    padding: 16px;
    background: #d1fae5;
    border-radius: 12px;
    color: #065f46;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 12px;
}
.ft-done-msg.visible { display: block; }

/* Print Styles for Certificate */
@media print {
    /* Ocultar elementos principales de la página */
    body > header,
    body > footer,
    body > .progress-container,
    .theme-toggle,
    .menu-toggle {
        display: none !important;
    }

    /* En el contenido principal, ocultar todo menos el certificado */
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .main-content > section {
        display: none !important;
    }
    
    .main-content > #certificado {
        display: block !important;
    }

    /* Ocultar botones dentro del certificado */
    .certificate-actions {
        display: none !important;
    }

    /* Ajustar diseño del certificado para que encaje perfecto en 1 hoja */
    #certificado {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .certificate-unlocked {
        box-shadow: none !important;
        border: 2px solid var(--primary);
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid;
    }

    .certificate-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: var(--primary) !important;
        color: white !important;
    }
}

/* =====================================================
   PERFIL Y CAMBIO DE CONTRASEÑA
   ===================================================== */

.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--light);
}

.profile-card-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-card-header h2 {
    font-size: 1.15rem;
    color: var(--dark);
    margin: 0 0 2px 0;
}

.profile-card-header p {
    font-size: 0.85rem;
    color: var(--gray);
    margin: 0;
}

.profile-field {
    margin-bottom: 18px;
}

.profile-field label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.profile-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-light);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.profile-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.toggle-pw-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray);
    padding: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toggle-pw-btn:hover { opacity: 1; }

.pw-strength-bar {
    height: 4px;
    background: var(--light);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.pw-strength-label {
    font-size: 0.78rem;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

.profile-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 14px;
    font-weight: 500;
}

.profile-msg.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.profile-msg.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* =====================================================
   RESUMEN DE RESPUESTAS DEL QUIZ
   ===================================================== */

.modal-medium { max-width: 680px; }

.answers-summary {
    margin-top: 24px;
    text-align: left;
}

.answers-summary h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light);
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.answers-list::-webkit-scrollbar { width: 5px; }
.answers-list::-webkit-scrollbar-track { background: var(--light); border-radius: 4px; }
.answers-list::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 4px; }

.answer-item {
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 4px solid transparent;
    background: var(--light);
    font-size: 0.88rem;
}

.answer-item.correct {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.answer-item.incorrect {
    border-left-color: var(--danger);
    background: #fff5f5;
}

.answer-item-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.answer-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.answer-question {
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
}

.answer-detail {
    padding-left: 26px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--gray);
    font-size: 0.83rem;
}

.answer-detail .your-answer { color: var(--danger); }
.answer-detail .correct-answer { color: var(--success); font-weight: 500; }
.answer-detail .explanation-text {
    margin-top: 5px;
    color: var(--dark-light);
    font-style: italic;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 5px;
}

/* =====================================================
   PANEL DE ADMINISTRADOR
   ===================================================== */

.admin-section { padding: 30px 0; }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.admin-stat-card.green { border-top-color: var(--success); }
.admin-stat-card.orange { border-top-color: var(--warning); }
.admin-stat-card.red { border-top-color: var(--danger); }

.admin-stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.admin-stat-card.green .admin-stat-value { color: var(--success); }
.admin-stat-card.orange .admin-stat-value { color: var(--warning); }
.admin-stat-card.red .admin-stat-value { color: var(--danger); }

.admin-stat-label {
    font-size: 0.82rem;
    color: var(--gray);
    margin-top: 6px;
    font-weight: 500;
}

.admin-table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--light);
}

.admin-table-header h2 { font-size: 1.1rem; color: var(--dark); }

.admin-table-wrapper { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    background: var(--light);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--light);
    color: var(--dark);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.admin-badge.complete { background: #d1fae5; color: #065f46; }
.admin-badge.partial  { background: #fef3c7; color: #92400e; }
.admin-badge.none     { background: var(--light); color: var(--gray); }

.module-mini-bar {
    display: flex;
    gap: 3px;
    align-items: center;
}

.module-mini-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--light);
    border: 1px solid var(--gray-light);
    title: "Módulo";
    cursor: default;
    font-size: 0;
}

.module-mini-dot.done { background: var(--success); border-color: var(--success); }
.module-mini-dot.partial { background: var(--warning); border-color: var(--warning); }

.admin-loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-size: 1rem;
}

.admin-refresh-btn {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.admin-refresh-btn:hover { background: var(--primary); color: white; }

@media (max-width: 768px) {
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   GLOSARIO FLOTANTE
   ===================================================== */

.glossary-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glossary-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37,99,235,0.5);
}

.glossary-fab-tooltip {
    position: fixed;
    bottom: 36px;
    right: 90px;
    background: var(--dark);
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.glossary-fab:hover + .glossary-fab-tooltip,
.glossary-fab-tooltip.visible { opacity: 1; }

.glossary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 901;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.glossary-overlay.open { opacity: 1; pointer-events: all; }

.glossary-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 902;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glossary-panel.open { transform: translateX(0); }

.glossary-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--light);
    background: var(--gradient);
    color: white;
    flex-shrink: 0;
}

.glossary-panel-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.glossary-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.glossary-close-btn:hover { background: rgba(255,255,255,0.35); }

.glossary-search-wrapper {
    padding: 14px 16px;
    border-bottom: 1px solid var(--light);
    flex-shrink: 0;
}

.glossary-search-input {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid var(--light);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--dark);
    background: var(--light);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.glossary-search-input:focus { border-color: var(--primary); background: white; }

.glossary-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.glossary-body::-webkit-scrollbar { width: 5px; }
.glossary-body::-webkit-scrollbar-track { background: var(--light); }
.glossary-body::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 4px; }

.glossary-term-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.glossary-term-item:hover { background: #f0f7ff; }
.glossary-term-item.active { background: #dbeafe; border-left: 3px solid var(--primary); }

.glossary-term-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.glossary-term-short {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 2px;
}

.glossary-detail-panel {
    padding: 16px 20px;
    background: #f0f7ff;
    border-top: 1px solid #dbeafe;
    flex-shrink: 0;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.glossary-detail-panel.visible { display: block; }

.glossary-detail-term {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.glossary-detail-def {
    font-size: 0.88rem;
    color: var(--dark-light);
    line-height: 1.6;
}

.glossary-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .glossary-panel { width: 100vw; }
}
