/* ============================================
   PREMIUM COURSE PLAYER
   Luxurious, Polished & Professional
   ============================================ */

:root {
    --primary-text: #0f172a;
    --secondary-text: #475569;
    --tertiary-text: #94a3b8;
    --primary-accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --bg-white: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --spacing-unit: 8px;
}

/* Base Container */
.yg-course-container {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    width: 100%;
    max-width: 1320px;
    margin: calc(var(--spacing-unit) * 5) auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    direction: rtl;
    box-sizing: border-box;
    background: transparent;
    position: relative;
    z-index: 1000;
}

.yg-course-container * {
    box-sizing: border-box;
}

/* Main Content Area */
.lessons-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    order: 2;
    position: relative;
    z-index: 1001;
}

.lesson-content {
    display: none;
}

.lesson-content.active {
    display: block;
    animation: contentFadeIn 0.25s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lesson Title - Ultra Premium Header */
.lesson-content h2 {
    position: relative;
    color: var(--primary-text);
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    padding: calc(var(--spacing-unit) * 5) calc(var(--spacing-unit) * 5);
    line-height: 1.4;
    letter-spacing: -0.6px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

/* Decorative Icon */
.lesson-content h2::before {
    content: '\f19d';
    font-family: 'Font Awesome 5 Free', 'dashicons';
    font-weight: 900;
    font-size: 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(37, 99, 235, 0.15);
    position: relative;
    z-index: 2;
}

/* Gradient Accent Bar */
.lesson-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #60a5fa 100%);
    border-radius: 2px 2px 0 0;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    overflow: hidden;
    margin: 0;
}

.video-container iframe,
.video-container .video-thumbnail,
.video-container .video-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container .video-embed iframe {
    width: 100%;
    height: 100%;
}

.video-thumbnail {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.video-thumbnail:hover img {
    opacity: 0.92;
}

.play-button {
    position: absolute;
    width: 64px;
    height: 64px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-text);
    font-size: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.play-button i {
    margin-right: -2px;
}

.video-thumbnail:hover .play-button {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Lesson Description */
.lesson-description {
    padding: calc(var(--spacing-unit) * 4);
    line-height: 1.7;
    color: var(--secondary-text);
    font-size: 15px;
}

.lesson-description p {
    margin: 0 0 calc(var(--spacing-unit) * 2);
}

.lesson-description p:last-child {
    margin-bottom: 0;
}

/* Files Section */
.files-section {
    background: var(--bg-subtle);
    padding: calc(var(--spacing-unit) * 4);
    border-top: 1px solid var(--border-light);
    margin: 0;
}

.files-section h3 {
    margin: 0 0 calc(var(--spacing-unit) * 2);
    font-size: 15px;
    color: var(--primary-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
}

.files-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
}

.files-section li {
    margin: 0;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2.5);
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--primary-text);
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.file-action-btn i {
    color: var(--secondary-text);
    font-size: 16px;
}

.file-action-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--primary-text);
}

.file-action-btn:hover i {
    color: var(--primary-accent);
}

/* Navigation Buttons */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    border-top: 1px solid var(--border-light);
    gap: calc(var(--spacing-unit) * 2);
}

.nav-left,
.nav-right {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
}

.nav-btn {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-unit);
    transition: all 0.15s ease;
    text-decoration: none;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--secondary-text);
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-btn.next {
    background: var(--primary-accent);
    color: var(--bg-white);
    border-color: var(--primary-accent);
}

.nav-btn.next:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Sidebar - Course Index */
.lessons-sidebar {
    width: 360px;
    flex-shrink: 0;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    height: fit-content;
    order: 1;
    position: sticky;
    top: calc(var(--spacing-unit) * 3);
    z-index: 1002;
    margin-left: auto;
}

/* Progress Header */
.overall-progress {
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--border-light);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.progress-info h3 {
    color: var(--primary-text);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.progress-percentage {
    color: var(--primary-accent);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-muted);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-accent);
    width: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lessons List */
.lessons-sidebar h3 {
    color: var(--tertiary-text);
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lessons-list {
    list-style: none;
    padding: 0 calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    margin: 0;
}

.lesson-list-item {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    background: transparent;
    border: 1px solid transparent;
}

.lesson-list-item:hover {
    background: var(--bg-subtle);
}

.lesson-list-item.active {
    background: var(--bg-muted);
    border-color: var(--primary-accent);
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    width: 100%;
    color: var(--primary-text);
    font-size: 14px;
    font-weight: 500;
}

.lesson-info i {
    color: var(--tertiary-text);
    font-size: 16px;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.lesson-info i.watched {
    color: var(--success);
}

.lesson-list-item:hover .lesson-info i {
    color: var(--secondary-text);
}

.lesson-list-item.active .lesson-info i {
    color: var(--primary-accent);
}

.lesson-duration {
    margin-right: auto;
    font-size: 12px;
    color: var(--tertiary-text);
    background: transparent;
    padding: 0;
    font-weight: 500;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .yg-course-container {
        flex-direction: column;
        gap: calc(var(--spacing-unit) * 3);
        margin: calc(var(--spacing-unit) * 3) auto;
        padding: 0 calc(var(--spacing-unit) * 2);
    }

    .lessons-sidebar {
        width: 100%;
        order: 1;
        position: static;
    }

    .lessons-content {
        order: 2;
    }

    .lesson-content h2 {
        font-size: 20px;
        padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
        gap: calc(var(--spacing-unit) * 1.5);
    }

    .lesson-content h2::before {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lesson-description,
    .files-section,
    .lesson-navigation {
        padding-left: calc(var(--spacing-unit) * 3);
        padding-right: calc(var(--spacing-unit) * 3);
    }
}

@media (max-width: 600px) {
    .yg-course-container {
        margin: calc(var(--spacing-unit) * 2) auto;
        padding: 0 calc(var(--spacing-unit) * 2);
    }

    .lesson-content h2 {
        font-size: 18px;
        padding: calc(var(--spacing-unit) * 3.5) calc(var(--spacing-unit) * 2.5);
        gap: calc(var(--spacing-unit) * 1.5);
    }

    .lesson-content h2::before {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 10px;
    }

    .lesson-description,
    .files-section {
        padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2.5);
    }

    .lesson-navigation {
        flex-direction: column;
        gap: calc(var(--spacing-unit) * 1.5);
        padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2.5);
    }

    .nav-left,
    .nav-right {
        width: 100%;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    }

    .overall-progress,
    .lessons-sidebar h3 {
        padding-left: calc(var(--spacing-unit) * 3);
        padding-right: calc(var(--spacing-unit) * 3);
    }

    .lessons-list {
        padding-left: calc(var(--spacing-unit) * 2);
        padding-right: calc(var(--spacing-unit) * 2);
    }
}