/* 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%;
}

/* Layout con video y sidebar */
.video-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 150px);
    min-height: 500px;
}

.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex: 1;
    min-height: 400px;
}

.main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
    display: block;
}

/* ======================================
   SIDEBAR DE CONTENIDOS (LADO DERECHO)
   ====================================== */
.content-sidebar {
    width: 300px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.3s ease, margin 0.3s ease;
    position: relative;
}

.sidebar-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.sidebar-header i {
    color: #0f6cbf;
}

.lessons-count {
    margin-left: auto;
    background: #0f6cbf;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

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

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

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

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

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

.no-content i {
    font-size: 2rem;
    opacity: 0.5;
}

/* Items del sidebar */
.sidebar-chapter-item {
    display: flex;
    align-items: flex-start;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    gap: 12px;
}

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

.sidebar-chapter-item:hover {
    background: #f8f9fa;
}

.sidebar-chapter-item.active {
    background: #e3f2fd;
    border-left: 3px solid #0f6cbf;
}

.sidebar-chapter-item.completed .chapter-status {
    background: #28a745;
}

.sidebar-chapter-item.completed .chapter-status i {
    display: block;
}

.sidebar-chapter-item.completed .chapter-number-text {
    display: none;
}

.chapter-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.chapter-status i {
    display: none;
    font-size: 0.7rem;
}

.sidebar-chapter-item.active .chapter-status {
    background: #0f6cbf;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-title-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.sidebar-chapter-item.active .chapter-title-text {
    color: #0f6cbf;
    font-weight: 600;
}

.chapter-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chapter-meta.now-playing {
    color: #0f6cbf;
}

.chapter-meta i {
    font-size: 0.6rem;
}

.chapter-duration {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    flex-shrink: 0;
}

/* ======================================
   BARRA DE PROGRESO CON SEGMENTOS
   ====================================== */
.progress-wrapper {
    flex: 1;
    position: relative;
}

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

.chapter-segments {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
}

.chapter-segment {
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-right: 2px solid rgba(0, 0, 0, 0.5);
    transition: background 0.2s ease;
}

.chapter-segment:last-child {
    border-right: none;
}

.chapter-segment:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chapter-segment.active {
    background: rgba(15, 108, 191, 0.3);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0f6cbf;
    border-radius: 3px;
    transition: width 0.1s ease;
    z-index: 2;
    pointer-events: none;
}

/* Indicador circular (bolita) de progreso */
.progress-handle {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5), 0 0 0 2px #0f6cbf;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    z-index: 10;
}

.progress-handle:hover {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6), 0 0 0 3px #0f6cbf;
}

.progress-container:hover .progress-handle {
    transform: translateY(-50%) scale(1.1);
}

.progress-container:hover .progress-bar {
    height: 8px;
    top: -1px;
}

.progress-container:hover {
    height: 8px;
}

.progress-container:hover .chapter-segments {
    height: 8px;
}

/* Thumbnail Preview */
.thumbnail-preview {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateX(-50%);
    margin-bottom: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.thumbnail-preview.visible {
    opacity: 1;
    visibility: visible;
}

.thumbnail-preview img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    background: #333;
    display: block;
}

.thumbnail-time {
    text-align: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
}

.thumbnail-title {
    text-align: center;
    color: #aaa;
    font-size: 0.75rem;
    margin-top: 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================================
   QUICK CHECK OVERLAY
   ====================================== */
.quick-check-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quick-check-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.quick-check-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-check-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.quick-check-close:hover {
    background: #f1f3f4;
    color: #333;
}

.quick-check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.quick-check-label {
    color: #0f6cbf;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* Reading Indicator Animation */
.reading-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.read-question-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f3f4;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.read-question-btn:hover {
    background: #e9ecef;
    color: #0f6cbf;
}

.read-question-btn i {
    font-size: 0.9rem;
}

.reading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reading-indicator.active {
    opacity: 1;
}

.reading-waves {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.reading-waves span {
    width: 3px;
    height: 8px;
    background: #0f6cbf;
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.reading-waves span:nth-child(1) {
    animation-delay: 0s;
}

.reading-waves span:nth-child(2) {
    animation-delay: 0.1s;
}

.reading-waves span:nth-child(3) {
    animation-delay: 0.2s;
}

.reading-waves span:nth-child(4) {
    animation-delay: 0.3s;
}

.reading-waves span:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 18px;
    }
}

.reading-text {
    font-size: 0.75rem;
    color: #0f6cbf;
    font-weight: 500;
}

.quick-check-question {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 12px;
}

.quick-check-instruction {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Answer Options */
.quick-check-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-option:hover {
    background: #e3f2fd;
    border-color: #0f6cbf;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-right: 16px;
}

.text-icon {
    background: #e3f2fd;
    color: #0f6cbf;
}

.audio-icon {
    background: #fce4ec;
    color: #e91e63;
}

.option-label {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.option-arrow {
    color: #adb5bd;
    transition: transform 0.2s ease;
}

.answer-option:hover .option-arrow {
    transform: translateX(4px);
    color: #0f6cbf;
}

/* Text Input Container */
.text-input-container {
    display: none;
}

.text-input-container.visible {
    display: block;
}

.text-answer-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease;
}

.text-answer-input:focus {
    outline: none;
    border-color: #0f6cbf;
}

.text-input-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

/* Audio Recorder Container */
.audio-recorder-container {
    display: none;
}

.audio-recorder-container.visible {
    display: block;
}

.audio-visualizer {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
}

.audio-visualizer canvas {
    width: 100%;
    height: 80px;
    display: block;
}

.recording-time {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.audio-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.record-btn,
.stop-btn,
.play-preview-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.record-btn {
    background: #e91e63;
    color: white;
}

.record-btn:hover:not(:disabled) {
    background: #c2185b;
    transform: scale(1.05);
}

.record-btn.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 99, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(233, 30, 99, 0);
    }
}

.stop-btn {
    background: #f44336;
    color: white;
}

.stop-btn:hover:not(:disabled) {
    background: #d32f2f;
}

.play-preview-btn {
    background: #4caf50;
    color: white;
}

.play-preview-btn:hover:not(:disabled) {
    background: #388e3c;
}

.record-btn:disabled,
.stop-btn:disabled,
.play-preview-btn:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
}

.audio-recorder-actions {
    display: flex;
    justify-content: space-between;
}

/* Buttons */
.back-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #e9ecef;
}

.submit-btn {
    background: #0f6cbf;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: #0d5aa7;
}

.submit-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.skip-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px;
    width: 100%;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.skip-btn:hover {
    color: #495057;
}

/* ======================================
   CONTROLES DE VIDEO
   ====================================== */
.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;
    flex-shrink: 0;
}

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

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

.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-top: 20px;
}

.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: 1024px) {
    .video-layout {
        flex-direction: column;
        height: auto;
    }

    .content-sidebar {
        width: 100%;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .moodle-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
    }

    .video-main-area {
        padding: 15px;
    }

    .video-wrapper {
        min-height: 300px;
    }

    .quick-check-modal {
        padding: 24px;
    }

    .quick-check-question {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .video-wrapper {
        min-height: 250px;
    }

    .video-main-area {
        padding: 10px;
    }

    .controls-row {
        gap: 8px;
    }

    .time-info {
        font-size: 0.75rem;
    }
}

/* 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;
}

/* ======================================
   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;
    width: 100%;
    height: 100%;
}

.fullscreen-mode .video-layout {
    flex: 1;
    gap: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
}

.fullscreen-mode .video-section {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: flex 0.3s ease;
}

/* En fullscreen, el video se ajusta al espacio disponible dejando hueco para sidebar */
.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: contain;
    object-position: center;
}

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

/* Sidebar en fullscreen con animación de colapso */
.fullscreen-mode .content-sidebar {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    z-index: 10;
    background: rgba(20, 20, 20, 0.98);
    border-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: width 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.fullscreen-mode .content-sidebar.collapsed {
    width: 0;
    border-left: none;
}

.fullscreen-mode .content-sidebar.collapsed .sidebar-content,
.fullscreen-mode .content-sidebar.collapsed .sidebar-header>*:not(.sidebar-toggle-btn) {
    opacity: 0;
    visibility: hidden;
}

/* Botón de toggle del sidebar */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #6c757d;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.sidebar-toggle-btn i {
    transition: transform 0.3s ease;
}

/* Estado colapsado en modo normal */
.content-sidebar.collapsed {
    width: 0;
    padding: 0;
    border: none;
    overflow: visible;
    /* Para mostrar el botón fuera */
}

.content-sidebar.collapsed .sidebar-content,
.content-sidebar.collapsed .sidebar-header>*:not(.sidebar-toggle-btn) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.content-sidebar.collapsed .sidebar-header {
    background: transparent;
    border: none;
    padding: 0;
    height: 0;
}

.content-sidebar.collapsed .sidebar-toggle-btn {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 40px;
    height: 48px;
    border-radius: 8px 0 0 8px;
    background: #ffffff;
    box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    border-right: none;
    z-index: 100;
}

.content-sidebar.collapsed .sidebar-toggle-btn:hover {
    background: #f8f9fa;
    width: 44px;
    left: -44px;
}

.content-sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.fullscreen-mode .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-mode .content-sidebar.collapsed .sidebar-toggle-btn {
    position: absolute;
    left: -44px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    border-radius: 8px 0 0 8px;
    background: rgba(15, 108, 191, 0.9);
    z-index: 100;
    opacity: 1;
    visibility: visible;
}

.fullscreen-mode .content-sidebar.collapsed .sidebar-toggle-btn:hover {
    background: rgba(15, 108, 191, 1);
    left: -48px;
    width: 44px;
}

.fullscreen-mode .content-sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.fullscreen-mode .sidebar-header {
    background: rgba(30, 30, 30, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 16px;
}

.fullscreen-mode .sidebar-chapter-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
}

.fullscreen-mode .sidebar-chapter-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.fullscreen-mode .sidebar-chapter-item.active {
    background: rgba(15, 108, 191, 0.2);
    border-left-color: #0f6cbf;
}

.fullscreen-mode .chapter-title-text {
    color: #e0e0e0;
}

.fullscreen-mode .sidebar-chapter-item.active .chapter-title-text {
    color: #64b5f6;
}

.fullscreen-mode .chapter-meta,
.fullscreen-mode .chapter-duration {
    color: #888;
}

.fullscreen-mode .no-content {
    color: #888;
}

/* 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;
}