/* **CSS Reset for Consistency Across Browsers** */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* **Root Variables for Easy Theming** */
:root {
    --primary-color: #2D3748; /* Dark Slate Grey */
    --secondary-color: #4A5568; /* Slate Grey */
    --accent-color: #3182CE; /* Blue */
    --text-color: #E2E8F0; /* Light Grey */
    --light-text-color: #A0AEC0; /* Grey */
    --background-color: #1A202C; /* Dark Blue Grey */
    --header-bg: linear-gradient(135deg, #2B6CB0, #2C5282); /* Blue Gradient */
    --spinner-border: #3182CE; /* Blue */
    --spinner-background: #CBD5E0; /* Light Grey */
    --shadow-color: rgba(0, 0, 0, 0.2);
    --font-family-primary: 'Inter', sans-serif;
    --font-family-secondary: 'Poppins', sans-serif;
    --transition-speed: 0.3s;
    --tab-active-bg: #4A5568; /* Slate Grey */
    --tab-hover-bg: #2C5282; /* Slightly Darker Slate Grey */
    --tab-border-radius: 15px;
    --tab-padding: 12px 20px;
    --tab-margin: 0;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family-primary);
    padding: 100px 20px 40px 20px;
    line-height: 1.6;
}

/* **Main Content Container** */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* **Video Section** */
.video-section {
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--shadow-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    margin-bottom: 30px;
    background-color: var(--secondary-color); /* Ensures background consistency */
}

.video-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--shadow-color);
}

.video-section video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
}

/* **Arrow Buttons Styling** */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(45, 55, 72, 0.7); /* Semi-transparent primary color */
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    z-index: 10;
}

@media (hover: hover) and (pointer: fine) {
    .nav-button {
        display: none;
    }

    .video-section:hover .nav-button {
        display: flex;
    }
}

.nav-button:hover {
    background-color: rgba(45, 55, 72, 0.9); /* Darker primary color on hover */
    transform: translateY(-50%) scale(1.1);
}

.prev-button {
    left: 10px;
}

.next-button {
    right: 10px;
}

.nav-button:disabled {
    background-color: rgba(45, 55, 72, 0.5); /* Lighter primary color when disabled */
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

/* **Playback Speed Controls** */
.playback-speed {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

.speed-button {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color var(--transition-speed) ease;
}

.speed-button:hover {
    background-color: var(--tab-hover-bg);
}

.speed-button.active {
    background-color: var(--accent-color);
    color: #ffffff;
}

/* **Lecture Title** */
.lecture-title {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
}

.lecture-title h2 {
    font-size: 1.2em;
    color: #ffffff;
}

/* **Enroll Button** */
.enroll-button-container {
    text-align: center;
    margin: 20px auto;
    width: 100%;
}

.enroll-button {
    padding: 15px 30px;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 15px;
    font-size: 1.2em; /* Reduced from 1.5em */
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
    font-weight: bold;
    width: 100%;
    display: block;
}

.enroll-button:hover {
    background-color: #2B6CB0; /* Darker blue on hover */
}

/* **Tabs Container** */
.tabs {
    display: flex;
    margin: 0;
    border-bottom: 1px solid var(--secondary-color);
    overflow: hidden;
    flex-wrap: nowrap;
}

.tab {
    flex: 1;
    padding: var(--tab-padding);
    margin: var(--tab-margin);
    cursor: pointer;
    background-color: transparent;
    color: var(--light-text-color);
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    font-family: var(--font-family-secondary);
    font-size: 1.1em;
    text-align: center;
    border: none;
    border-bottom: 2px solid transparent;
    position: relative;
    border-radius: var(--tab-border-radius);
}

.tab:hover {
    color: #ffffff;
    background-color: var(--tab-hover-bg);
}

.tab.active {
    color: #ffffff;
    border-bottom: 2px solid var(--accent-color);
    background-color: var(--tab-active-bg);
}

/* **Content Sections** */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-speed) ease;
    margin-top: 20px;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* **Course Information Section** */
.course-info {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 24px var(--shadow-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    margin-bottom: 40px;
    margin-top: 20px;
}

.course-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--shadow-color);
}

.course-info h1 {
    font-family: var(--font-family-secondary);
    font-size: 2em; /* Reduced from 2.8em */
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.2;
}

.course-subtitle {
    font-family: var(--font-family-secondary);
    font-size: 1.2em; /* Reduced from 1.8em */
    margin-bottom: 25px;
    color: #A0AEC0; /* Updated to light text color */
    line-height: 1.2;
}

.course-description p {
    color: var(--light-text-color);
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8; /* Increased line spacing */
}

/* **Course Content Sections** */
.course-content .section {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px var(--shadow-color);
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.course-content .section:hover {
    background-color: var(--tab-hover-bg);
    box-shadow: 0 10px 28px var(--shadow-color);
}

.course-content .section-header {
    font-weight: 600;
    font-size: 1em; /* Reduced from 1.5em */
    color: #ffffff;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
}

.course-content .section-header .toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1em;
    color: var(--light-text-color);
}

.course-content .lesson {
    display: flex;
    align-items: center;
    font-size: 0.9em; /* Reduced from 1em */
    color: var(--light-text-color);
    margin-left: 20px;
    padding: 15px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #4A5568; /* Updated border color to match secondary color */
    transition: color var(--transition-speed) ease, transform 0.2s ease;
    cursor: pointer;
}

.course-content .lesson:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.course-content .lesson:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.play-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    background-color: var(--secondary-color);
    transition: background-color var(--transition-speed) ease;
}

.play-button::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 10px solid #ffffff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.active-play-button {
    background-color: var(--accent-color);
}

.inactive-play-button {
    background-color: #b3b3b3;
}

/* **Active Lesson Styling** */
.lesson.active-lesson {
    color: var(--accent-color);
    font-weight: 600;
}

/* **Reviews Section** */
.reviews {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 6px 20px var(--shadow-color);
    margin-bottom: 30px;
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.reviews:hover {
    background-color: var(--tab-hover-bg);
    box-shadow: 0 10px 28px var(--shadow-color);
}

.review {
    margin-bottom: 20px;
}

.review:last-child {
    margin-bottom: 0;
}

.review-stars {
    color: #FFD700; /* Gold color for stars */
    margin-bottom: 5px;
}

.review-text {
    color: var(--light-text-color);
    font-size: 1em;
    text-align: justify;
}

/* **Instructor Tab Content** */
.instructor-section {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 6px 20px var(--shadow-color);
    margin-bottom: 30px;
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.instructor-section:hover {
    background-color: var(--tab-hover-bg);
    box-shadow: 0 10px 28px var(--shadow-color);
}

.instructor-section h2 {
    font-family: var(--font-family-secondary);
    font-size: 2em;
    margin-bottom: 20px;
    color: #ffffff;
}

.instructor-bio {
    color: var(--light-text-color);
    font-size: 1.1em;
    text-align: justify;
    margin-bottom: 15px;
}

/* **Expand All Sections Button** */
.expand-all-button {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.expand-all-button:hover {
    background-color: var(--tab-hover-bg);
}

.section-content {
    display: none;
}

/* **Responsive Design** */
@media screen and (max-width: 992px) {
    .course-info h1 {
        font-size: 2.4em;
        text-align: center;
    }

    .course-price {
        font-size: 1.5em;
        text-align: center;
    }
}

@media screen and (max-width: 768px) {
    .video-section {
        margin-bottom: 30px;
    }

    .course-info {
        padding: 25px;
    }

    .course-info h1 {
        font-size: 2em;
    }

    .course-content {
        margin-top: 40px;
    }

    .section-title {
        font-size: 1.2em;
    }

    .section-header {
        font-size: 1.1em;
    }

    .lesson {
        font-size: 0.85em; /* Adjusted for mobile */
        margin-left: 15px;
        padding: 12px 0;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        width: 100%;
        text-align: center;
        border-radius: 0;
        border-bottom: 1px solid var(--secondary-color);
    }

    .tab.active {
        border-bottom: 2px solid var(--accent-color);
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 120px 10px 40px 10px;
    }

    .container {
        padding: 0 10px;
    }

    .video-section {
        margin-bottom: 20px;
    }

    .course-info {
        padding: 15px;
    }

    .course-info h1 {
        font-size: 1.8em;
        text-align: center;
    }

    .instructor-info {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }

    .instructor-details {
        align-items: center;
    }

    .instructor-name {
        font-size: 1em;
    }

    .course-price {
        font-size: 1.2em;
        text-align: center;
    }

    .section-title {
        font-size: 0.9em;
    }

    .section-header {
        font-size: 0.9em;
    }

    .lesson {
        font-size: 0.8em; /* Adjusted for mobile */
        margin-left: 10px;
        padding: 10px 0;
    }

    .tab {
        padding: 10px 0;
        font-size: 1em;
    }

    .tab.active {
        border-bottom: 2px solid var(--accent-color);
    }

    .expand-all-button {
        margin-bottom: 10px;
    }
}

/* **Modals** */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid var(--primary-color);
    width: 80%; /* Could be more or less, depending on screen size */
    border-radius: 10px;
    color: var(--text-color);
}

.close-button {
    color: var(--light-text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content form {
    display: flex;
    flex-direction: column;
}

.modal-content label {
    margin: 10px 0 5px;
}

.modal-content input[type="text"],
.modal-content input[type="number"] {
    padding: 8px;
    font-size: 1em;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.modal-content button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.modal-content button:hover {
    background-color: #2B6CB0; /* Darker blue on hover */
}

/* **Editor Buttons** */

/* Style for the rectangular button with rounded corners */
.rectangular-button {
    margin-bottom: 10px;
    margin-left: 20px;
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.rectangular-button:hover {
    background-color: var(--tab-hover-bg);
}

/* Container for lesson action buttons */
.lesson-buttons {
    display: flex;
    align-items: center;
    margin-top: 5px; /* Space between lesson title and buttons */
    flex-wrap: wrap; /* Allow buttons to wrap if space is limited */
}

/* Ensure all action buttons have consistent styles */
.lesson-buttons .rectangular-button {
    margin-right: 10px; /* Space between buttons */
    margin-bottom: 5px; /* Space for wrapping to next line */
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.lesson-buttons .rectangular-button:hover {
    background-color: var(--tab-hover-bg);
}

/* Optional: Specific styles for different buttons if needed */
.lesson-buttons .edit-lesson-button {
    /* Additional styles for Edit button if required */
}

.lesson-buttons .delete-lesson-button {
    /* Additional styles for Delete button if required */
}

.lesson-buttons .article-button {
    /* Additional styles for Article button if required */
}

/* Locked lesson styles */
.locked-lesson {
    opacity: 0.6;
    pointer-events: none;
}

.lock-icon {
    width: 20px;
    height: 20px;
    background-image: url('path_to_lock_icon.png'); /* Replace with actual lock icon path */
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 10px;
}

/* Success message styling */
.success-message {
    background-color: #D4EDDA; /* Soft Green */
    color: #155724; /* Dark Green */
    padding: 15px;
    border: 1px solid #C3E6CB;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.success-message i {
    margin-right: 10px;
}

/* Error message styling */
.error-message {
    background-color: #F8D7DA; /* Soft Red */
    color: #721C24; /* Dark Red */
    padding: 15px;
    border: 1px solid #F5C6CB;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.error-message i {
    margin-right: 10px;
}

/* Play Button Styles */
.play-button {
    width: 20px;
    height: 20px;
    background-image: url('path_to_play_icon.png'); /* Replace with actual play icon path */
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 10px;
}

.locked-play-button {
    filter: grayscale(100%);
    opacity: 0.1;
}

.inactive-play-button {
    /* Styles for inactive play button */
}

/* Locked Article Button */
.locked-article {
    background-color: #4A5568; /* Secondary color */
    color: #A0AEC0; /* Light Text Color */
    cursor: not-allowed;
    opacity: 0.6;
}
