/* Estilo Moodle-like para Video Player MBA */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

/* Layout principal tipo Moodle */
.moodle-container {
    display: flex;
    min-height: 100vh;
}

/* Área principal del contenido */
.main-content {
    flex: 1;
    background: #ffffff;
}

/* Header superior tipo Moodle */
.moodle-header {
    background: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

.course-title {
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.breadcrumb {
    margin-top: 8px;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0f6cbf;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-link:hover {
    background-color: #e7f3ff;
    color: #0a5490;
    text-decoration: none;
}

.breadcrumb-link i {
    font-size: 0.75rem;
    opacity: 0.9;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.7rem;
    margin: 0 4px;
    opacity: 0.5;
    width: 16px;
    flex-shrink: 0;
}

.breadcrumb-separator i {
    font-size: 0.65rem;
}

.breadcrumb-item-active {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #495057;
    font-weight: 600;
    padding: 4px 8px;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
}

.breadcrumb-item-active i {
    font-size: 0.75rem;
    color: #6c757d;
    opacity: 0.8;
    flex-shrink: 0;
}

.breadcrumb-item-active span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Responsive breadcrumbs */
@media (max-width: 768px) {
    .breadcrumb-list {
        gap: 2px;
    }
    
    .breadcrumb-link span,
    .breadcrumb-item-active span {
        font-size: 0.8rem;
    }
    
    .breadcrumb-link {
        padding: 3px 6px;
    }
    
    .breadcrumb-item-active {
        padding: 3px 6px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
    }
    
    .videos-link-btn {
        width: 100%;
        justify-content: center;
    }
}

.videos-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0f6cbf;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.videos-link-btn:hover {
    background: #0d5aa7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 108, 191, 0.3);
}

.videos-link-btn[style*="background: #28a745"]:hover {
    background: #218838 !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.videos-link-btn i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    .header-right .videos-link-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Área del video principal */
.video-main-area {
    padding: 30px;
    width: 100%;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 25px;
    width: 100%;
    height: 70vh;
    min-height: 400px;
}

.main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Menú de contenido en la esquina superior izquierda */
.content-menu {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.content-menu-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-menu-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.content-menu-btn i:last-child {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.content-menu-btn.active i:last-child {
    transform: rotate(180deg);
}

.content-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 20;
}

.content-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #0f6cbf;
    border-radius: 3px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #0d5aa7;
}

.no-content {
    padding: 20px 16px;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.no-content i {
    font-size: 1.5rem;
    opacity: 0.6;
}

.chapter-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.9rem;
    color: #495057;
}

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

.chapter-dropdown-item:hover {
    background: #f8f9fa;
    color: #0f6cbf;
}

.chapter-dropdown-item.active {
    background: #e3f2fd;
    color: #0f6cbf;
    font-weight: 500;
}

.chapter-number {
    background: #0f6cbf;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.chapter-dropdown-item.active .chapter-number {
    background: #0d5aa7;
}

.chapter-title {
    flex: 1;
    line-height: 1.3;
}

/* Controles tipo Moodle */
.moodle-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-wrapper:hover .moodle-controls {
    opacity: 1;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.play-button {
    background: #0f6cbf;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button:hover {
    background: #0d5aa7;
    transform: scale(1.05);
}

.time-info {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #0f6cbf;
    border-radius: 3px;
    transition: width 0.1s ease;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
}

.volume-slider {
    width: 60px;
    height: 4px;
}

.pdf-download-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-download-button:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.pdf-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.settings-button, .fullscreen-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.settings-button:hover, .fullscreen-button:hover {
    color: #0f6cbf;
}

/* Información del video */
.video-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.video-description {
    color: #6c757d;
    line-height: 1.5;
    font-size: 0.95rem;
}


/* Mensaje de estado */
.video-status {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .moodle-container {
        flex-direction: column;
    }
    
    .content-index {
        width: 100%;
        position: static;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .video-main-area {
        padding: 15px;
    }
    
    .video-wrapper {
        height: 50vh;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .video-wrapper {
        height: 40vh;
        min-height: 250px;
    }
    
    .video-main-area {
        padding: 10px;
    }
}

@media (min-width: 1200px) {
    .video-wrapper {
        height: 80vh;
    }
}

@media (min-width: 1600px) {
    .video-wrapper {
        height: 85vh;
    }
}



/* Utilidades */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Estilos para modo pantalla completa */
.fullscreen-mode {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.fullscreen-mode body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.fullscreen-mode .moodle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    margin: 0;
    padding: 0;
}

.fullscreen-mode .main-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    margin: 0;
    padding: 0;
}

.fullscreen-mode .moodle-header {
    display: none;
}

.fullscreen-mode .video-main-area {
    flex: 1;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.fullscreen-mode .video-wrapper {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.fullscreen-mode .main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.fullscreen-mode .video-info {
    display: none;
}


/* Ajustar controles en fullscreen */
.fullscreen-mode .moodle-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.fullscreen-mode .video-wrapper:hover .moodle-controls {
    opacity: 1;
}

/* Ajustar menú de contenido en fullscreen */
.fullscreen-mode .content-menu {
    top: 20px;
    left: 20px;
    z-index: 15;
}

.fullscreen-mode .content-menu-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fullscreen-mode .content-menu-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}