/* MasterClass-inspired Course Player Styles */

:root {
    --mc-black: #000000;
    --mc-dark: #1a1a1a;
    --mc-gray: #2d2d2d;
    --mc-light-gray: #8a8a8a;
    --mc-white: #ffffff;
    --mc-red: #e50914;
    --mc-gold: #c9a961;
    --sidebar-width: 400px;
}

/* Course Player Container */
.course-player-container {
    display: flex;
    min-height: 100vh;
    background: var(--mc-black);
    color: var(--mc-white);
    position: relative;
}

/* Video Section - Left Side */
.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--mc-black);
}

.video-header {
    padding: 20px 30px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    position: absolute;
    width: 100%;
    z-index: 10;
}

.course-title {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--mc-light-gray);
}

.lesson-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.lesson-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--mc-light-gray);
    font-size: 0.9rem;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-wrapper iframe,
.video-wrapper video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 80vh;
}

/* Video Controls Bar */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.control-buttons {
    display: flex;
    gap: 15px;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.control-btn.primary {
    background: var(--mc-red);
    border-color: var(--mc-red);
}

.control-btn.primary:hover {
    background: #ff0a16;
}

.autoplay-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mc-light-gray);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #333;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--mc-red);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

/* Lesson Sidebar - Right Side */
.lesson-sidebar {
    width: var(--sidebar-width);
    background: var(--mc-dark);
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid #333;
}

.progress-section {
    margin-bottom: 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--mc-light-gray);
}

.progress-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--mc-red), var(--mc-gold));
    transition: width 0.5s ease;
}

.course-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--mc-light-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Lessons List */
.lessons-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.lessons-list::-webkit-scrollbar {
    width: 6px;
}

.lessons-list::-webkit-scrollbar-track {
    background: var(--mc-dark);
}

.lessons-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.lesson-item {
    display: flex;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.lesson-item:hover {
    background: rgba(255,255,255,0.05);
}

.lesson-item.active {
    background: rgba(229,9,20,0.2);
    border-left: 3px solid var(--mc-red);
}

.lesson-item.completed {
    opacity: 0.7;
}

.lesson-number {
    width: 35px;
    height: 35px;
    border: 2px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    font-weight: 600;
}

.lesson-item.active .lesson-number {
    border-color: var(--mc-red);
    color: var(--mc-red);
}

.lesson-item.completed .lesson-number {
    background: var(--mc-gold);
    border-color: var(--mc-gold);
    color: var(--mc-black);
}

.lesson-content {
    flex: 1;
}

.lesson-name {
    font-size: 0.95rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.lesson-duration {
    font-size: 0.8rem;
    color: var(--mc-light-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.playing-indicator {
    display: none;
    width: 24px;
    height: 24px;
    margin-left: auto;
}

.lesson-item.active .playing-indicator {
    display: block;
}

.playing-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 100%;
}

.bar {
    width: 4px;
    background: var(--mc-red);
    animation: soundWave 0.5s ease-in-out infinite;
}

.bar:nth-child(2) {
    animation-delay: 0.1s;
}

.bar:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes soundWave {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

/* CTA Section at Bottom */
.sidebar-cta {
    padding: 20px;
    background: var(--mc-gray);
    border-top: 1px solid #444;
}

.cta-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.cta-description {
    font-size: 0.85rem;
    color: var(--mc-light-gray);
    margin-bottom: 15px;
    line-height: 1.4;
}

.cta-button {
    width: 100%;
    padding: 14px;
    background: var(--mc-red);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #ff0a16;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229,9,20,0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .course-player-container {
        flex-direction: column;
    }
    
    .video-section {
        height: 40vh;
        min-height: 250px;
    }
    
    .video-wrapper {
        height: 40vh;
    }
    
    .video-wrapper iframe,
    .video-wrapper video {
        max-height: 40vh;
    }
    
    .lesson-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #333;
        flex: 1;
    }
    
    .video-header {
        position: relative;
        padding: 15px 20px;
    }
    
    .course-title {
        font-size: 0.9rem;
    }
    
    .lesson-title {
        font-size: 1.4rem;
    }
    
    .video-controls {
        padding: 15px;
    }
    
    .control-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .sidebar-header {
        padding: 20px;
    }
    
    /* Mobile Video Controls */
    .mobile-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--mc-dark);
        border-top: 1px solid #333;
        padding: 10px;
        display: none;
        z-index: 100;
    }
    
    @media (max-width: 768px) {
        .mobile-controls {
            display: flex;
            justify-content: space-around;
        }
    }
    
    .mobile-control {
        padding: 10px;
        background: transparent;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
    }
}

/* Loading Animation */
.lesson-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--mc-black);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top-color: var(--mc-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tooltip for locked content */
.tooltip {
    position: absolute;
    background: var(--mc-gray);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Responsive Typography */
@media (max-width: 480px) {
    .course-title { font-size: 0.8rem; }
    .lesson-title { font-size: 1.2rem; }
    .lesson-name { font-size: 0.85rem; }
    .stat-value { font-size: 1.2rem; }
}