/* ========================================
   CURSOS LMS - PLAYER DE CURSO
   Layout moderno com vídeo + sidebar
   ======================================== */

/* Reset e Base */
.cursos-lms-player-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #fff;
    overflow: hidden;
}

/* Container Principal */
.cursos-lms-player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0f0f0f;
}

/* ========================================
   HEADER
   ======================================== */
.cursos-lms-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    height: 60px;
    z-index: 100;
}

.player-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #2a2a2a;
    border-color: #4a4a4a;
}

.course-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.player-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
}

.progress-circle {
    position: relative;
}

.btn-settings,
.btn-fullscreen {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-settings:hover,
.btn-fullscreen:hover {
    background: #2a2a2a;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.cursos-lms-player-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   VIDEO AREA (Esquerda)
   ======================================== */
.cursos-lms-player-video-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    overflow-y: auto;
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.no-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #666;
}

.no-video svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Lesson Header Section */
.lesson-header-section {
    padding: 24px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.lesson-title-main {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    flex: 1;
}

.lesson-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-complete-main {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #4CAF50;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-complete-main:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-complete-main.completed {
    background: #2a2a2a;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    cursor: default;
}

.btn-complete-main:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Navigation Buttons */
.lesson-navigation-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    margin-right: 4px;
}

.btn-nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav-icon:hover:not(:disabled) {
    background: #333;
    border-color: #4a4a4a;
    transform: scale(1.05);
}

.btn-nav-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Lesson Info Section */
.lesson-info-section {
    padding: 0;
    background: #1a1a1a;
}

.lesson-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #2a2a2a;
    padding: 0 24px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #4CAF50;
}

.tab-content {
    display: none;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

.lesson-description {
    color: #ccc;
    line-height: 1.8;
    font-size: 15px;
}

.lesson-description p {
    margin-bottom: 16px;
}

.lesson-description h1,
.lesson-description h2,
.lesson-description h3 {
    color: #fff;
    margin-top: 24px;
    margin-bottom: 12px;
}

.lesson-description ul,
.lesson-description ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.lesson-description a {
    color: #4CAF50;
    text-decoration: none;
}

.lesson-description a:hover {
    text-decoration: underline;
}

/* Resources Section */
.resources-section {
    margin-bottom: 32px;
}

.resources-section:last-child {
    margin-bottom: 0;
}

.resources-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #fff;
}

.resources-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #3a3a3a;
    transition: all 0.2s;
}

.resource-item:hover {
    background: #333;
    border-color: #4a4a4a;
}

.resource-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.resource-icon.pdf {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.resource-icon.doc,
.resource-icon.docx {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.resource-icon.xls,
.resource-icon.xlsx {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.resource-icon.zip,
.resource-icon.rar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.resource-icon.link {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resource-name {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.resource-name:hover {
    color: #4CAF50;
}

.resource-meta {
    font-size: 12px;
    color: #666;
}

.btn-download {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4CAF50;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-download:hover {
    background: #45a049;
    transform: scale(1.05);
}

.no-resources {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-resources svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-resources p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   SIDEBAR (Direita)
   ======================================== */
.cursos-lms-player-sidebar {
    width: 380px;
    background: #1a1a1a;
    border-left: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #fff;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #4CAF50;
}

.search-box svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

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

/* Scrollbar customizada */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

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

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

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Module Section */
.module-section {
    margin-bottom: 8px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.module-section:hover {
    border-color: #3a3a3a;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: #1a1a1a;
}

.module-header:hover {
    background: #222;
}

.module-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.module-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.module-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #fff;
    line-height: 1.4;
    padding-top: 2px;
}

.module-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.module-progress {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.chevron {
    transition: transform 0.3s ease;
    color: #999;
}

.module-section:not(.collapsed) .chevron {
    transform: rotate(180deg);
}

.module-lessons {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 8px 0 12px 0;
    background: #141414;
}

.module-section.collapsed .module-lessons {
    max-height: 0;
    padding: 0;
}

/* Lesson Item */
.lesson-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px 14px 56px;
    text-decoration: none;
    color: #ccc;
    transition: all 0.2s;
    position: relative;
    margin: 0 8px;
    border-radius: 6px;
}

.lesson-item:hover {
    background: #222;
    color: #fff;
}

.lesson-item.active {
    background: #2a2a2a;
    color: #fff;
}

.lesson-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #4CAF50;
    border-radius: 0 2px 2px 0;
}

.lesson-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-icon svg {
    width: 20px;
    height: 20px;
}

/* Ícone de documento para lições não concluídas */
.lesson-item:not(.completed) .lesson-icon svg {
    stroke: #666;
}

/* Checkmark verde para lições concluídas */
.lesson-item.completed .lesson-icon {
    background: transparent;
    border-radius: 50%;
}

.lesson-item.completed .lesson-icon svg {
    stroke: #4CAF50;
}

.lesson-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lesson-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.lesson-duration {
    font-size: 12px;
    color: #666;
}

/* Indicador de "Tocando agora" */
.playing-indicator {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: #4CAF50;
    font-weight: 600;
}

.playing-indicator::before {
    content: '▶';
    font-size: 8px;
}

.pulse {
    display: none;
}

/* Animação sutil para lição ativa */
.lesson-item.active {
    animation: subtle-glow 2s ease-in-out infinite;
}

@keyframes subtle-glow {
    0%, 100% {
        background: #2a2a2a;
    }
    50% {
        background: #2d2d2d;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .cursos-lms-player-sidebar {
        width: 320px;
    }
    
    .course-title {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .cursos-lms-player-main {
        flex-direction: column;
    }
    
    .cursos-lms-player-sidebar {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid #2a2a2a;
    }
    
    .lesson-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .lesson-title-main {
        font-size: 18px;
    }
    
    .lesson-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-complete-main {
        width: 100%;
        justify-content: center;
    }
    
    .lesson-navigation-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .nav-label {
        display: none;
    }
    
    .course-title {
        display: none;
    }
    
    .lesson-tabs {
        overflow-x: auto;
        padding: 0 16px;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
    }
    
    .tab-content {
        padding: 16px;
    }
    
    .resource-item {
        flex-wrap: wrap;
    }
}

/* ========================================
   LIGHT MODE OVERRIDE (padrao do sistema)
   ======================================== */
body.cursos-lms-player-body {
    background: #f5f6f8 !important;
    color: #111827 !important;
}

body.cursos-lms-player-body .cursos-lms-player-container,
body.cursos-lms-player-body .cursos-lms-player-main,
body.cursos-lms-player-body .cursos-lms-player-video-area {
    background: #f5f6f8 !important;
    color: #111827 !important;
}

body.cursos-lms-player-body .cursos-lms-player-header,
body.cursos-lms-player-body .lesson-header-section,
body.cursos-lms-player-body .lesson-info-section,
body.cursos-lms-player-body .cursos-lms-player-sidebar,
body.cursos-lms-player-body .sidebar-header,
body.cursos-lms-player-body .module-header,
body.cursos-lms-player-body .module-lessons,
body.cursos-lms-player-body .tab-content {
    background: #ffffff !important;
    color: #111827 !important;
}

body.cursos-lms-player-body .cursos-lms-player-header {
    border-bottom: 1px solid #e5e7eb !important;
}

body.cursos-lms-player-body .lesson-header-section,
body.cursos-lms-player-body .lesson-tabs,
body.cursos-lms-player-body .sidebar-header {
    border-bottom: 1px solid #e5e7eb !important;
}

body.cursos-lms-player-body .cursos-lms-player-sidebar {
    border-left: 1px solid #e5e7eb !important;
}

body.cursos-lms-player-body .btn-back,
body.cursos-lms-player-body .btn-nav-icon,
body.cursos-lms-player-body .search-box input,
body.cursos-lms-player-body .resource-item,
body.cursos-lms-player-body .lesson-navigation-buttons {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

body.cursos-lms-player-body .btn-back:hover,
body.cursos-lms-player-body .btn-nav-icon:hover:not(:disabled),
body.cursos-lms-player-body .resource-item:hover,
body.cursos-lms-player-body .module-header:hover,
body.cursos-lms-player-body .lesson-item:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

body.cursos-lms-player-body .btn-settings,
body.cursos-lms-player-body .btn-fullscreen,
body.cursos-lms-player-body .course-title,
body.cursos-lms-player-body .lesson-title-main,
body.cursos-lms-player-body .sidebar-header h3,
body.cursos-lms-player-body .module-title,
body.cursos-lms-player-body .resources-title,
body.cursos-lms-player-body .resource-name,
body.cursos-lms-player-body .tab-btn.active,
body.cursos-lms-player-body .lesson-item.active,
body.cursos-lms-player-body .lesson-title,
body.cursos-lms-player-body .module-number {
    color: #111827 !important;
}

body.cursos-lms-player-body .tab-btn {
    color: #6b7280 !important;
}

body.cursos-lms-player-body .tab-btn:hover {
    color: #111827 !important;
    background: #f3f4f6 !important;
}

body.cursos-lms-player-body .lesson-description,
body.cursos-lms-player-body .lesson-description h1,
body.cursos-lms-player-body .lesson-description h2,
body.cursos-lms-player-body .lesson-description h3,
body.cursos-lms-player-body .lesson-item,
body.cursos-lms-player-body .resource-meta,
body.cursos-lms-player-body .module-progress,
body.cursos-lms-player-body .lesson-duration,
body.cursos-lms-player-body .nav-label,
body.cursos-lms-player-body .search-box svg,
body.cursos-lms-player-body .chevron {
    color: #6b7280 !important;
}

body.cursos-lms-player-body .video-container {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

body.cursos-lms-player-body .lesson-item.active {
    background: #eef2ff !important;
    animation: none !important;
}

body.cursos-lms-player-body .playing-indicator {
    background: #ecfdf3 !important;
    color: #15803d !important;
}

body.cursos-lms-player-body .sidebar-content::-webkit-scrollbar-track {
    background: #f3f4f6 !important;
}

body.cursos-lms-player-body .sidebar-content::-webkit-scrollbar-thumb {
    background: #d1d5db !important;
}

body.cursos-lms-player-body .sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af !important;
}

@media (max-width: 768px) {
    body.cursos-lms-player-body .cursos-lms-player-sidebar {
        border-top: 1px solid #e5e7eb !important;
    }
}
