/* style.css - Estilos COMPLETOS y CORREGIDOS Curso PSM I Mastery */

:root {
    /* Colores principales */
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #17a2b8;
    --danger: #e74c3c;
    
    /* Nuevos colores Header */
    --header-bg: #0f172a;
    
    /* Sombras y bordes */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    
    /* Tipografía */
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* =========================================
   HEADER MODERNO (CORREGIDO)
   ========================================= */
header {
    background: var(--header-bg); /* Azul oscuro Slate 900 */
    padding: 20px 0 70px 0; /* Espacio extra abajo para el banner flotante */
    position: relative; /* Cambiado de sticky a relative para el diseño del banner */
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Logo mejorado */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: #3b82f6;
}

/* Barra de progreso en Header */
.progress-info {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-container {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    width: 100%; /* Asegura ancho completo del contenedor padre */
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.progress-text {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    text-align: right;
    font-weight: 500;
}

.header-actions .btn-outline {
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.header-actions .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
    transform: translateY(-2px);
}

/* Ajustes Responsive Header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .progress-info {
        width: 100%;
        align-items: center;
    }
    .progress-text {
        text-align: center;
    }
    header {
        padding-bottom: 80px; /* Más espacio en móvil para que el banner no tape nada */
    }
}

/* =========================================
   BANNER INGLÉS (DISEÑO FLOTANTE)
   ========================================= */
.english-banner {
    background: linear-gradient(135deg, #2c3e50 0%, #4a148c 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(74, 20, 140, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    
    /* MÁGICA DEL TRASLAPE */
    margin-top: -50px; /* Sube el banner sobre el header */
    margin-bottom: 40px;
    z-index: 10;
    width: 100%;
    transition: transform 0.3s ease;
}

.english-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(74, 20, 140, 0.4);
}

/* Decoración Banner */
.english-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.english-banner::after {
    content: '\f1ab'; /* FontAwesome Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -20px;
    left: 20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.03);
    transform: rotate(-15deg);
    z-index: 0;
    pointer-events: none;
}

.english-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.english-text {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.english-badge {
    display: inline-block;
    background: rgba(255, 235, 59, 0.2);
    color: #ffeb3b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 235, 59, 0.3);
}

.english-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.english-text h3 span {
    color: #ffeb3b;
    position: relative;
    display: inline-block;
}

.english-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 600px;
}

.english-btn {
    background: linear-gradient(to right, #ffeb3b, #fbc02d);
    color: #3e2723;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(251, 192, 45, 0.4);
    white-space: nowrap;
}

.english-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(251, 192, 45, 0.6);
    background: linear-gradient(to right, #fff176, #fdd835);
}

@media (max-width: 768px) {
    .english-banner-content {
        padding: 25px 20px;
        text-align: center;
        flex-direction: column;
    }
    .english-text {
        text-align: center;
    }
    .english-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   BOTONES FLOTANTES (WhatsApp & Top)
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse-green 2s infinite;
}

.whatsapp-btn i {
    font-size: 2rem;
    z-index: 2;
}

.whatsapp-tooltip {
    background: white;
    color: #0f172a;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-float:hover .whatsapp-btn {
    transform: scale(1.1);
    background: #20bd5a;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 768px) {
    .whatsapp-tooltip { display: none; }
}

/* Botón Back to Top */
.back-to-top {
    position: fixed;
    bottom: 110px; /* Arriba del WhatsApp */
    right: 35px;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
}

.back-to-top.visible {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.back-to-top-btn {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #43a047 0%, #1b5e20 100%);
}

/* =========================================
   RESTO DE ESTILOS DEL CURSO
   ========================================= */

/* Views Management */
.view-section {
    display: none;
    animation: fadeIn 0.5s ease;
    min-height: calc(100vh - 140px);
}

.view-section.active {
    display: block;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.9), rgba(44, 62, 80, 0.8)), 
                url('https://images.unsplash.com/photo-1552664730-d307ca884978?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    backdrop-filter: blur(5px);
    text-align: center;
    min-width: 120px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-item h3 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.stat-item p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Modules Container */
.modules-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modules-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modules-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.duration-badge {
    background: var(--secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.module-item {
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-item:hover {
    background: #f9f9f9;
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.module-item:last-child {
    border-bottom: none;
}

.module-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.module-info p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.module-info small {
    color: #888;
    font-size: 0.85rem;
}

.status-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    margin-left: auto;
    margin-bottom: 5px;
}

.status-icon.not-started { 
    background: #ddd; 
    color: #666;
}
.status-icon.in-progress { 
    background: var(--warning); 
}
.status-icon.completed { 
    background: var(--success); 
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.daily-plan, .resource-card, .exam-tips, .action-buttons {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.daily-plan h4, .resource-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-list {
    list-style: none;
}

.resource-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resource-list li:hover {
    background: #f8f9fa;
    padding-left: 10px;
    color: var(--secondary);
}

.resource-list li:last-child {
    border-bottom: none;
}

.resource-icon {
    color: var(--secondary);
    width: 20px;
    text-align: center;
}

.exam-tips {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
}

.exam-tips h5 {
    color: #d35400;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Module Page Styles */
.module-page-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.module-page-title h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.module-page-meta {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.module-page-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 992px) {
    .module-page-content {
        grid-template-columns: 1fr;
    }
}

.content-area {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-area h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

.content-area h3 {
    color: var(--secondary);
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.content-area h4 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.content-area p {
    margin-bottom: 1.2rem;
    color: #444;
}

.content-area ul, .content-area ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-area li {
    margin-bottom: 0.5rem;
    color: #444;
}

/* Box Styles for Content */
.important-box {
    background-color: #e8f4fc;
    border-left: 5px solid var(--secondary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
}

.case-study-box {
    background-color: #f1f9fe;
    border-left: 5px solid #2980b9;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.dynamic-practice-box {
    background-color: #fff8e1;
    border: 2px dashed var(--warning);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--radius);
}

.case-study-header, .dynamic-practice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.2rem;
}

.case-study-header {
    color: #2980b9;
}

.dynamic-practice-header {
    color: #d35400;
}

/* Module Sidebar */
.module-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.module-tool-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.module-tool-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-mini {
    width: 100%;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 3px;
    margin: 10px 0;
}

.progress-mini-bar {
    height: 6px;
    background: var(--success);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-mini-text {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-full { 
    width: 100%; 
}

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

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

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

.btn-primary:hover { 
    background: #2980b9; 
    transform: translateY(-2px);
}

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

.btn-success:hover { 
    background: #219653; 
    transform: translateY(-2px);
}

.btn-nav { 
    background: #ecf0f1; 
    color: var(--primary); 
}

.btn-nav:hover { 
    background: #bdc3c7; 
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.certification-badge {
    background: var(--secondary);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-weight: bold;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* =========================================
   MODALES MODERNOS (Centrado y Estilizado)
   ========================================= */

.modal {
    display: none; /* Controlado por JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(8px); /* Efecto de vidrio esmerilado en el fondo */
    z-index: 3000;
    /* CENTRADO PERFECTO */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px; /* Ancho ideal para lectura */
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden; /* Para que el header no se salga de los bordes */
    transform: scale(0.95);
    opacity: 0;
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPopIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header del Modal con Gradiente */
.modal-header-styled {
    background: linear-gradient(135deg, #2c3e50 0%, #4a148c 100%);
    padding: 25px 30px;
    color: white;
    position: relative;
}

.modal-header-styled h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    font-size: 1.2rem;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Cuerpo del Modal */
.modal-body-styled {
    padding: 30px;
}

.modal-intro {
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Lista de Características */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.feature-icon {
    background: #f0f9ff;
    color: #0284c7;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.feature-text h5 {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
}

.feature-text p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Caja de Contacto */
.contact-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.95rem;
}

.contact-row i {
    color: #25D366; /* WhatsApp Green */
    width: 20px;
    text-align: center;
}

.contact-row:last-child {
    margin-bottom: 0;
}

/* Acciones */
.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 10px;
    padding: 12px;
    transition: background 0.3s;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.btn-close-secondary {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
}

.btn-close-secondary:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Flashcards, Exam & Others */
/* --- ESTILOS 3D CORREGIDOS PARA FLASHCARDS --- */

.flashcard-container {
    perspective: 1000px;
    background: transparent;
    padding: 20px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flashcard {
    width: 100%;
    max-width: 600px;
    height: 350px; /* Altura fija */
    margin: 0 auto 2rem;
    cursor: pointer;
    background-color: transparent;
    position: relative;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 16px;
}

/* Estado girado */
.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

/* Estilos comunes para ambas caras */
.flashcard-front, .flashcard-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden; /* Oculta la cara trasera al girar */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    overflow-y: auto; /* Permite scroll si el texto es muy largo */
}

/* CARA FRONTAL */
.flashcard-front {
    background: linear-gradient(145deg, #2c3e50, #1a2530); /* Fondo sólido */
    color: white;
    transform: rotateY(0deg);
    /* ELIMINADO: z-index: 2; (Esto causaba el traslape) */
}

/* CARA TRASERA */
.flashcard-back {
    background: white; /* Fondo sólido blanco */
    color: #2c3e50;
    transform: rotateY(180deg);
    border: 1px solid #e0e0e0;
    /* ELIMINADO: z-index */
}

/* Tipografía y elementos internos */
.flashcard h3 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 15px;
    font-weight: 700;
}

.flashcard .hint {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flashcard-actions {
    margin-top: auto; /* Empuja los botones al final */
    width: 100%;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.flashcard-tags {
    margin-bottom: 15px;
}

/* Quiz Styles */
.quiz-option {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.quiz-option:hover { 
    background: #e9ecef; 
}

.quiz-option.selected { 
    background: #d1ecf1; 
    border-left: 4px solid var(--secondary); 
}

.quiz-option.correct { 
    background: #d4edda; 
    border-left: 4px solid var(--success); 
}

.quiz-option.incorrect { 
    background: #f8d7da; 
    border-left: 4px solid var(--danger); 
}

/* =========================================
   EXAMEN SIMULADO (Estilos Faltantes)
   ========================================= */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.exam-timer {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.exam-timer.warning {
    background: var(--danger);
    animation: pulse 1s infinite;
}

.question-counter {
    font-weight: bold;
    color: #666;
    margin-bottom: 1rem;
}

.exam-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.exam-question h3 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exam-option {
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-option:hover {
    background: #e9ecef;
    border-color: #ddd;
}

.exam-option.selected {
    background: #e3f2fd;
    border-color: var(--secondary);
    font-weight: 500;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Cuadrícula de preguntas (Navegación lateral o inferior) */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.question-grid-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.question-grid-item:hover {
    transform: scale(1.1);
    border-color: var(--secondary);
}

.question-grid-item.current {
    border: 2px solid var(--primary);
    font-weight: bold;
}

.question-grid-item.answered {
    background-color: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.question-grid-item.marked {
    background-color: var(--warning);
    color: white;
    border-color: var(--warning);
}

.exam-submit-section {
    margin-top: 2rem;
    text-align: center;
    padding: 1rem;
    background: #fff3cd;
    border-radius: var(--radius);
    border: 1px solid #ffeeba;
}

.exam-results {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

/* FIX: Forza el centrado y evita conflictos de display */
.modal[style*="display: block"], 
.modal[style*="display:block"] {
    display: flex !important;
}