/**
 * COMPONENTS CSS - PORTAL APIGEE X
 * =================================
 * Componentes reutilizables: cards, botones, modales, carruseles
 */

/* Cards de Video */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex: 0 0 300px;
    scroll-snap-align: start;
    position: relative;
}

.video-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.video-card.watched::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-green);
    border-radius: var(--radius-lg);
    z-index: 5;
    pointer-events: none;
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: #e2e8f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail>i {
    display: none;
    /* Ocultar solo el icono de fondo directo, no el del play-overlay */
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 1.5rem;
    /* Espacio para que no toque los bordes */
}

.video-type-badge {
    display: none;
    /* Ocultar badge de tipo de video */
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 64px;
    height: 64px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.85);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid white;
}

.play-icon i {
    padding-left: 3px;
    /* Centrar visualmente el triÃ¡ngulo */
}

.video-card:hover .play-icon {
    transform: scale(1);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 12px 32px rgba(0, 153, 216, 0.4);
}

.video-info {
    padding: 1.25rem;
}

.video-number {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

.video-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Checkbox */
.video-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    accent-color: var(--accent-green);
}

/* BotÃ³n de Favoritos */
.video-important-btn,
.video-important-btn-text {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-important-btn i,
.video-important-btn-text i {
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.video-important-btn:hover,
.video-important-btn-text:hover {
    background: var(--bg-main);
    transform: scale(1.15);
    border-color: var(--accent-orange);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.video-important-btn:hover i,
.video-important-btn-text:hover i {
    color: var(--accent-orange);
}

.video-important-btn.active,
.video-important-btn-text.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.video-important-btn.active i,
.video-important-btn-text.active i {
    color: white;
}

.video-important-btn.active i {
    color: white;
    transform: scale(1.2);
}

.video-important-btn.active:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}


/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 900px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s var(--ease-out);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 2rem;
    color: var(--text-secondary);
}

.video-container {
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-actions {
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
}

.btn-marcar-visto {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-marcar-visto:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-marcar-visto.visto {
    background: var(--accent-green);
}

.materiales-section,
.resumen-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.resumen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.resumen-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 800;
}

.resumen-badge {
    background: var(--primary-glow);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.05em;
}

/* Sistema de Bloques DidÃ¡cticos Premium */
.professional-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--text-secondary);
}

.summary-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.summary-block:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.block-header {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.block-header i {
    font-size: 1rem;
}

.block-content {
    padding: 1.25rem;
    background: var(--bg-main);
}

/* Colores por Tipo de Bloque */
.info-block {
    border-left: 4px solid var(--primary);
}

.info-block .block-header {
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary);
}

.success-block {
    border-left: 4px solid var(--accent-green);
}

.success-block .block-header {
    background: rgba(52, 168, 83, 0.1);
    color: var(--accent-green);
}

.warning-block {
    border-left: 4px solid var(--accent-orange);
}

.warning-block .block-header {
    background: rgba(251, 188, 4, 0.1);
    color: var(--accent-orange);
}

.process-block {
    border-left: 4px solid #9c27b0;
}

.process-block .block-header {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
}

.concept-block {
    border-left: 4px solid #ff5722;
}

.concept-block .block-header {
    background: rgba(255, 87, 34, 0.1);
    color: #ff5722;
}

.general-block {
    border-left: 4px solid var(--border);
}

.general-block .block-header {
    display: none;
}

.summary-paragraph {
    margin-bottom: 1rem;
    line-height: 1.7;
    text-align: justify;
}

.summary-list {
    margin: 1rem 0 1rem 1.2rem;
    list-style: none;
}

.summary-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.summary-list li::before {
    content: "â†’";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.success-block .summary-list li::before {
    content: "âœ“";
    color: var(--accent-green);
}

.warning-block .summary-list li::before {
    content: "âš ";
    color: var(--accent-orange);
}

/* Badge para SecciÃ³n */
.seccion-descripcion {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.5;
    max-width: 800px;
}

.video-count-badge {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.materiales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.material-link {
    padding: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    text-decoration: none;
}

.material-link:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.resumen-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Carruseles */
.carousel-wrapper {
    position: relative;
    margin: 0 -1rem;
    padding: 1rem;
}

.videos-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-main);
}

.videos-grid::-webkit-scrollbar {
    height: 8px;
}

.videos-grid::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 10px;
}

.videos-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.videos-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.carousel-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 153, 216, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: -24px;
}

.carousel-btn.next {
    right: -24px;
}

/* NavegaciÃ³n principal */
.main-nav-tabs {
    position: sticky;
    top: 20px;
    z-index: 1000;
    margin: 0 auto 2rem;
    max-width: 1400px;
    padding: 0 2rem;
}

.nav-container {
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

body.dark .nav-container {
    background: rgba(26, 31, 46, 0.8);
}

.main-nav-tab {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav-tab:hover {
    color: var(--primary);
    background: var(--bg-main);
}

.main-nav-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Barra de progreso */
#progressFill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* Footer Estilo JSB */
.footer {
    margin-top: 4rem;
    padding: 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-card);
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer strong {
    color: var(--text-primary);
}

/* Ajustes para modo oscuro en footer */
body.dark .footer {
    background: rgba(26, 31, 46, 0.5);
    border-top-color: rgba(255, 255, 255, 0.05);
}

.glosario-search {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Secciones de categorÃ­as */
.glossary-category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* Grid de tarjetas */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Tarjetas de tÃ©rminos */
.glossary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.glossary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.glossary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.glossary-card-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.glossary-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.glossary-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.glossary-card p:last-child {
    margin-bottom: 0;
}

.glossary-purpose {
    color: var(--text-muted);
    font-style: italic;
}

.glossary-card strong {
    color: var(--text-primary);
    font-weight: 600;
}/* Herramientas */
.grid-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.module {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.module:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.module-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}

.module h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.module p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.module a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.module a:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}
/* Objetivos de aprendizaje */
.objetivos-section {
    margin-top: 2rem;
}

.objetivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.objetivo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.objetivo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.objetivo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.objetivo-text {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.6;
}
/* ================================================================
   MEJORAS VISUALES PARA SECCIONES Y OBJETIVOS
   ================================================================ */

/* --- Título "Lo que aprenderás" --- */
.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--primary);
    font-size: 1.5rem;
}

/* --- Objetivos mejorados --- */
.objetivo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.objetivo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.objetivo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 153, 216, 0.25);
}

.objetivo-text {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.95rem;
}

/* --- Headers de Sección del Curso --- */
.seccion-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
}

.seccion-title {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}

.seccion-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 153, 216, 0.25);
}

.seccion-title h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.seccion-descripcion {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0.75rem 0 1rem;
    line-height: 1.6;
    max-width: 900px;
}

.video-count-badge {
    background: linear-gradient(135deg, rgba(0, 153, 216, 0.1) 0%, rgba(0, 153, 216, 0.05) 100%);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(0, 153, 216, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.video-count-badge i {
    font-size: 0.9rem;
}
