/* Player SCORM Styles - Solo posición y layout */

.scorm-player {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Local Storage Indicator */
.local-storage-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

.indicator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.indicator-content svg {
    flex-shrink: 0;
}

.indicator-content span {
    flex: 1;
    text-align: center;
}

.indicator-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

/* Ajustar contenido cuando hay indicador */
.local-storage-indicator + .scorm-player {
    margin-top: 40px;
}

.local-storage-indicator ~ .content-area {
    padding-top: 120px;
}

.local-storage-indicator ~ .nav-bar {
    top: 40px;
}

.local-storage-indicator ~ .progress-bar {
    top: 40px;
}

/* Loading */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Player Interface */
.player-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Section */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    position: relative;
    z-index: 100;
    /* Detalles visuales opcionales */
    border: 1px solid rgba(255,255,255,.3);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);

    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

/* Header Chip */
.header-chip {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 50%;
    z-index: 100;
    position: relative;
}

.header-info {
    display: flex;
    flex-direction: column;
    justify-content:center;
    gap: 4px;
    background-color: white;
    padding: calc(var(--grid-step) / 2) calc(var(--grid-step) * 2);
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
    margin-left: -35px;
    box-shadow: var(--shadow-lg);
}
.header-chip .progress__text{
    background-color: white;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
}

.header-info #resource-title {
    margin: 0;
}
.header-info #module-name {
    margin: 0;
}

/* Action Zone */

.action-zone {
    position: fixed;
    right: 24px;
    z-index: 101;
}



.action-zone .mol-btn-primary.icon_button:hover {
    transform: translateY(-1px);
}

.action-zone .mol-btn-primary.icon_button:active {
    transform: translateY(0);
}

.action-zone .mol-btn-primary.icon_button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Content Area */
.content-area {
    position: absolute;
    top: 0;
    flex: 1;
    z-index: 0;
    overflow: hidden;
}

/* Iframe Content */
#content-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: block;
    transition: opacity 0.3s ease;
}

#content-iframe.loading {
    opacity: 0.5;
}

#content-iframe.loaded {
    opacity: 1;
}

/* Loading overlay for iframe */
.iframe-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.iframe-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.iframe-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Resource Container Styles */
.resource-container {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}

.resource-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid;
}

.resource-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.resource-subtitle {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 400;
}

.resource-content {
    padding: 32px;
    min-height: 400px;
}

.resource-footer {
    padding: 24px 32px;
    border-top: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-progress {
    font-size: 0.875rem;
}

.progress-text {
    font-weight: 500;
}

.resource-actions {
    display: flex;
    gap: 12px;
}

/* Resource Type Specific Styles */
.resource-lamina {
    border-left: 4px solid;
}

.resource-video {
    border-left: 4px solid;
}

.resource-actividad {
    border-left: 4px solid;
}

.resource-lectura {
    border-left: 4px solid;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: 450px;
    border: none;
    display: block;
}

/* PDF Container */
.pdf-container {
    width: 100%;
    height: 600px;
    border: 1px solid;
    border-radius: 8px;
    overflow: hidden;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Slide Styles (Legacy) */
.slide {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
    padding: 32px;
}

.slide.active {
    display: block;
}

.slide-header {
    margin-bottom: 24px;
    text-align: center;
}

.slide-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.slide-subtitle {
    font-size: 1.125rem;
    margin: 0;
}

.slide-body {
    margin-bottom: 32px;
}

.slide-text {
    font-size: 1.125rem;
    line-height: 1.7;
}

.slide-footer {
    border-top: 1px solid;
    padding-top: 24px;
}

/* Navigation Bar */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    border-bottom: 1px solid;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 101;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}






.action-zone__buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-circular {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid;
}

.btn-circular:hover {
    transform: translateY(-1px);
}

.btn-circular:active {
    transform: translateY(0);
}

.btn-circular svg {
    width: 16px;
    height: 16px;
    transition: all 0.2s ease;
}

/* Estados específicos de botones */
.btn-volume.muted svg {
    opacity: 0.5;
}

.btn-volume.muted::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 20px;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Index Lightbox */
.index-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.index-content {
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.index-header {
    padding: 24px;
    border-bottom: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.index-list {
    padding: 0;
}

.index-item {
    padding: 16px 24px;
    border-bottom: 1px solid;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.index-item-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.index-item-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 48px;
}

.index-item-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.index-item-type {
    font-size: 1.25rem;
    line-height: 1;
}

.index-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.index-item-title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
}

.index-item-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.index-item-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.index-item-status {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-height: 750px) {
    .player-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 24px;
    }
}

/* Responsive Index */
@media (max-width: 768px) {
    .index-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .index-header {
        padding: 16px;
    }
    
    .index-header h2 {
        font-size: 1.25rem;
    }
    
    .index-item {
        padding: 12px 16px;
    }
    
    .index-item-content {
        gap: 12px;
    }
    
    .index-item-header {
        min-width: 40px;
    }
    
    .index-item-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .index-item-type {
        font-size: 1rem;
    }
    
    .index-item-title {
        font-size: 0.8rem;
    }
    
    .index-item-subtitle {
        font-size: 0.7rem;
    }
    
    .index-item-footer {
        min-width: 28px;
    }
    
    .index-item-status {
        font-size: 0.875rem;
    }
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.toast-hiding {
    animation: slideOut 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Modal Container */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Error States */
.resource-container.error .resource-content {
    text-align: center;
}

.resource-container.error .resource-content h1 {
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .content-area {
        padding: 0;
    }
    .player-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        border-bottom: 1px solid;
        z-index: 100;
        height: 100px;
        background-color: white;
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
    }
    .header-chip {
        display: flex;
        align-items: center;
        width: calc(100% - 60px);
        z-index: 100;
        position: relative;
        top: 0;
        left: 0;
        flex-direction: column-reverse;
        gap: 0;
    }
    .header-info{
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: var(--spacing-md);
        border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
        margin-left: 0;
        box-shadow: none;
        width: 100%;
    }
    #header-progress{
        width: 100%;
    }
    .action-zone {
        top: 8px;
        right: 8px;
    }
    
    .btn-circular {
        width: 36px;
        height: 36px;
    }
    
    .btn-circular svg {
        width: 14px;
        height: 14px;
    }
    
    .resource-container {
        margin: 0 8px;
    }
    
    .resource-header {
        padding: 24px 24px 16px;
    }
    
    .resource-content {
        padding: 24px;
    }
    
    .resource-footer {
        padding: 16px 24px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .resource-title {
        font-size: 1.5rem;
    }
    
    .video-container iframe,
    .video-container video {
        height: 250px;
    }
    
    .pdf-container {
        height: 400px;
    }
    
    .slide {
        padding: 24px;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    .nav-bar {
        padding: 12px 16px;
    }
    
    .nav-title {
        font-size: 1.125rem;
    }
    
    .index-content {
        width: 95%;
    }
}

/* Estilos específicos para el botón anterior */
#previous-button {
    background: white !important;
    border: 1px solid var(--color-border, #e2e8f0) !important;
    color: var(--color-text-primary, #1e293b) !important;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1)) !important;
}

#previous-button:hover {
    background: var(--color-light, #f8fafc) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1)) !important;
}

#previous-button.disabled {

    cursor: not-allowed !important;
    visibility: hidden !important;
}

#previous-button.disabled:hover {
    transform: none !important;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1)) !important;
}

/* Estilos para el modal del índice */
.index-modal .index-content {
    padding: var(--spacing-lg);
    max-height: 70vh;
    overflow-y: auto;
}

.index-modal .index-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.index-modal .index-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--border-radius-lg);
    background: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.index-modal .index-item:hover {
    border-color: var(--colorA-primary, #8e6bfe);
    box-shadow: 0 2px 8px rgba(142, 107, 254, 0.1);
    transform: translateY(-1px);
}

.index-modal .index-item.current {
    border-color: var(--colorA-primary, #8e6bfe);
    background: var(--colorA-primary-light, #f3f0ff);
}

.index-modal .index-item.current .current-indicator {
    background: var(--colorA-primary, #8e6bfe);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.index-modal .index-item.viewed {
    border-color: var(--color-success, #10b981);
    background: var(--color-success-light, #f0fdf4);
}

.index-modal .index-item.completed {
    border-color: var(--color-success, #10b981);
    background: var(--color-success-light, #f0fdf4);
}

.index-modal .index-item.completed .completion-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--color-success, #10b981);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.index-modal .index-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--color-background, #f8fafc);
}

.index-modal .index-item.locked:hover {
    transform: none;
    box-shadow: none;
}

.index-modal .index-item.locked .locked-indicator {
    background: var(--color-text-secondary, #64748b);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.index-modal .index-item-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
}

.index-modal .index-item-icon {
    font-size: 1.5rem;
    min-width: 32px;
    text-align: center;
}

.index-modal .index-item-text {
    flex: 1;
}

.index-modal .index-item-text h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary, #1e293b);
}

.index-modal .index-item-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary, #64748b);
    text-transform: capitalize;
}

.index-modal .index-item-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.index-modal .index-item-status .status-icon {
    font-size: 1rem;
}

.index-modal .index-item-status .status-text {
    color: var(--color-text-secondary, #64748b);
}

/* Responsive */
@media (max-width: 768px) {
    .index-modal .index-content {
        padding: var(--spacing-md);
        max-height: 60vh;
    }
    
    .index-modal .index-item {
        padding: var(--spacing-sm);
    }
    
    .index-modal .index-item-content {
        gap: var(--spacing-sm);
    }
    
    .index-modal .index-item-icon {
        font-size: 1.25rem;
        min-width: 24px;
    }
    
    .index-modal .index-item-text h4 {
        font-size: 0.875rem;
    }
    
    .index-modal .index-item-text p {
        font-size: 0.75rem;
    }
}
