/* ============================================
   Modern Lesson Template - Dark Theme
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.single-ahs-lesson {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
}

/* Hide WordPress Admin Bar for cleaner view */
body.single-ahs-lesson.admin-bar .lesson-header {
    top: 32px;
}

/* ============================================
   Main Container - Fullscreen Layout
   ============================================ */
.lesson-container-modern {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
}

/* ============================================
   Header Navigation - Fixed Top
   ============================================ */
.lesson-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    padding: 20px 0px;
    z-index: 100;
}

/* Header buttons container - 2 equal columns */
.lesson-header-left,
.lesson-header-right {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 30px;
}

.lesson-header-left {
    justify-content: flex-start;
}

.lesson-header-right {
    justify-content: flex-end;
}

/* Logo in absolute center */
.lesson-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    padding: 8px 16px;
    border-radius: 8px;
}

.header-logo svg {
    width: 32px;
    height: 32px;
}

.header-logo .logo-image {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.header-logo .brand-name {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4aa 0%, #4dd4ac 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lesson-header .nav-btn {
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lesson-header .nav-prev {
    background: #2a2a2a;
    color: #ffffff;
}

.lesson-header .nav-prev:hover {
    background: #3a3a3a;
    transform: translateX(-2px);
}

.lesson-header .nav-next,
.lesson-header .complete-lesson-btn {
    background: linear-gradient(135deg, #00d4aa 0%, #4dd4ac 100%);
    color: #0a0a0a;
    font-weight: 600;
}

.lesson-header .nav-next:hover,
.lesson-header .complete-lesson-btn:hover {
    background: linear-gradient(135deg, #00e5bb 0%, #5ee5bd 100%);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.lesson-header .nav-next.completed {
    background: #2a2a2a;
    color: var(--primary-color, #00d4aa);
}

/* ============================================
   Sidebar - Left Panel
   ============================================ */
.lesson-sidebar {
    width: 320px;
    background: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    padding-top: 20px; /* Add padding to avoid header overlap */
}

/* Custom Scrollbar */
.lesson-sidebar::-webkit-scrollbar {
    width: 6px;
}

.lesson-sidebar::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.lesson-sidebar::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.lesson-sidebar::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Sidebar Header - Course Info Only */


/* Back to Course Button */
.back-to-course-btn {
    display: block;
    margin: 50px 20px 20px;
    padding: 10px 16px;
    background: #2a2a2a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.back-to-course-btn:hover {
    background: #3a3a3a;
    color: var(--primary-color, #00d4aa);
}

/* Course Info */
.sidebar-course-info {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-course-info .course-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.sidebar-course-info .current-lesson-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

/* Progress Bar */
.lesson-progress-modern {
    margin-top: 16px;
}

.progress-bar-modern {
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill-modern {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa 0%, #4dd4ac 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text-modern {
    font-size: 12px;
    color: var(--primary-color, #00d4aa);
    margin-top: 8px;
    font-weight: 600;
}

/* Lesson Lists */
.sidebar-lessons {
    padding: 20px 0;
}

.sidebar-lessons .heading-lesson {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    padding: 0 20px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Category */
.lesson-category-modern {
    margin-bottom: 12px;
}

.category-header-modern {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #2a2a2a;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
}

.category-header-modern:hover {
    background: #3a3a3a;
    color: var(--primary-color, #00d4aa);
}

.category-header-modern .toggle-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.category-header-modern.open .toggle-icon {
    transform: rotate(90deg);
}

/* Lesson Items */
.lessons-modern {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 6px;
}

.lessons-modern.open {
    max-height: 2000px;
}

.lesson-item-modern {
    position: relative;
}

.lesson-item-modern a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #0a0a0a;
    margin-bottom: 3px;
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.lesson-item-modern a:hover {
    background: #1a1a1a;
    color: #fff;
    border-left-color: #00d4aa;
    transform: translateX(4px);
}

/* Lesson Icons */
.lesson-item-modern .lesson-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lesson-item-modern .lesson-icon svg {
    color: #666;
    stroke: currentColor;
}

/* Completed Lesson */
.lesson-item-modern.completed a {
    color: var(--primary-color, #00d4aa);
    background: rgba(0, 212, 170, 0.08);
}

.lesson-item-modern.completed .lesson-icon svg {
    color: var(--primary-color, #00d4aa);
}

/* Current Lesson */
.lesson-item-modern.current a {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.15) 0%, rgba(77, 212, 172, 0.1) 100%);
    color: #ffffff;
    border-left-color: #00d4aa;
    font-weight: 600;
}

.lesson-item-modern.current .lesson-icon svg {
    color: var(--primary-color, #00d4aa);
}

/* Action Buttons in Lesson Items */
.lesson-action-btn {
    margin-left: auto;
    padding: 6px 16px;
    background: var(--primary-color, #00d4aa);
    color: #0a0a0a;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lesson-action-btn:hover {
    background: #00e5bb;
}

.lesson-view-btn {
    background: #3a3a3a;
    color: #ffffff;
}

.lesson-view-btn:hover {
    background: #4a4a4a;
}

.lesson-current-btn {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.3) 0%, rgba(77, 212, 172, 0.3) 100%);
    color: var(--primary-color, #00d4aa);
}

.lesson-current-btn:hover {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.4) 0%, rgba(77, 212, 172, 0.4) 100%);
}

/* ============================================
   Main Content Area
   ============================================ */
.lesson-main-content {
    margin-left: 320px;
    margin-top: 60px;
    flex: 1;
    min-height: calc(80vh - 60px);
    background: #0a0a0a;
}

.lesson-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

/* Lesson Title */
.lesson-title-modern {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-title-modern::before {
    content: '';
    width: 4px;
    height: 32px;
    background: linear-gradient(180deg, #00d4aa 0%, #4dd4ac 100%);
    border-radius: 2px;
}

/* Video Player Area - Minimal Styling */
.video-player-area {
    margin-bottom: 32px;
}

/* Lesson Content */
.lesson-text-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 32px;
    color: #ccc;
    line-height: 1.8;
}

.lesson-text-content h1,
.lesson-text-content h2,
.lesson-text-content h3 {
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 12px;
}

.lesson-text-content p {
    margin-bottom: 16px;
}

.lesson-text-content a {
    color: var(--primary-color, #00d4aa);
    text-decoration: none;
}

.lesson-text-content a:hover {
    text-decoration: underline;
}

.lesson-text-content code {
    background: #2a2a2a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.lesson-text-content pre {
    background: #2a2a2a;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.lesson-text-content ul,
.lesson-text-content ol {
    color: #ccc;
    margin: 8px 0 16px 0;
    padding-left: 28px;
}

.lesson-text-content ul {
    list-style: none;
}

.lesson-text-content ul li {
    position: relative;
    padding-left: 8px;
    margin-bottom: 8px;
}

.lesson-text-content ul li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--primary-color, #00d4aa);
    border-radius: 50%;
}

.lesson-text-content ol {
    counter-reset: item;
    list-style: none;
}

.lesson-text-content ol li {
    position: relative;
    padding-left: 8px;
    margin-bottom: 8px;
    counter-increment: item;
}

.lesson-text-content ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: -24px;
    font-weight: 600;
    color: var(--primary-color, #00d4aa);
}

/* Gutenberg Blocks Support */
.lesson-text-content .wp-block-list {
    color: #ccc;
    margin: 8px 0 16px 0;
    padding-left: 28px;
}

.lesson-text-content ul.wp-block-list {
    list-style: none;
}

.lesson-text-content ul.wp-block-list li {
    position: relative;
    padding-left: 8px;
    margin-bottom: 8px;
}

.lesson-text-content ul.wp-block-list li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--primary-color, #00d4aa);
    border-radius: 50%;
}

.lesson-text-content ol.wp-block-list {
    counter-reset: item;
    list-style: none;
}

.lesson-text-content ol.wp-block-list li {
    position: relative;
    padding-left: 8px;
    margin-bottom: 8px;
    counter-increment: item;
}

.lesson-text-content ol.wp-block-list li::before {
    content: counter(item) ".";
    position: absolute;
    left: -24px;
    font-weight: 600;
    color: var(--primary-color, #00d4aa);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .lesson-sidebar {
        width: 280px;
    }
    
    .lesson-main-content {
        margin-left: 280px;
    }
    
    .lesson-content-wrapper {
        padding: 30px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 900px) {
    .lesson-sidebar {
        width: 260px;
    }
    
    .lesson-main-content {
        margin-left: 260px;
    }
    
    .lesson-header {
        padding: 0 20px;
        gap: 15px;
    }
    
    .header-logo .brand-name {
        display: none; /* Hide text, show only icon */
    }
    
    .lesson-title-modern {
        font-size: 24px;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) {
    body.single-ahs-lesson.admin-bar .lesson-header {
        top: 46px; /* Smaller admin bar on mobile */
    }
    
    .lesson-header {
        height: auto;
        flex-direction: column;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .lesson-header-left,
    .lesson-header-right {
        width: 100%;
        padding: 0;
        justify-content: center;
    }
    
    .lesson-header-center {
        position: relative;
        left: auto;
        transform: none;
        order: -1; /* Logo first on mobile */
    }
    
    .lesson-header .nav-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    /* Sidebar as hamburger menu on mobile */
    .lesson-sidebar {
        width: 280px;
        position: fixed;
        left: -280px; /* Hidden by default */
        top: 0;
        bottom: 0;
        max-height: 100vh;
        border-right: 1px solid #2a2a2a;
        border-top: none;
        transform: none;
        transition: left 0.3s ease;
        z-index: 999;
        padding-top: 80px; /* Space for close button */
    }
    
    .lesson-sidebar.open {
        left: 0; /* Slide in from left */
    }
    
    /* Hamburger menu button */
    .sidebar-toggle {
        display: flex !important; /* Override desktop hidden */
        position: fixed;
        top: 15px;
        left: 15px;
        background: var(--primary-color, #00d4aa);
        border: none;
        padding: 10px 12px;
        border-radius: 6px;
        color: #0a0a0a;
        font-size: 20px;
        font-weight: 600;
        cursor: pointer;
        z-index: 1000;
        width: 45px;
        height: 45px;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-toggle::before {
        content: '☰';
    }
    
    /* Close button inside sidebar */
    .sidebar-close-btn {
        display: block !important; /* Override desktop hidden */
        position: absolute;
        top: 15px;
        right: 15px;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 5px 10px;
        z-index: 1001;
    }
    
    /* Backdrop overlay */
    .sidebar-backdrop {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
    }
    
    .sidebar-backdrop.active {
        display: block !important; /* Show when active */
    }
    
    .lesson-main-content {
        margin-left: 0;
        margin-top: 220px; /* Reduced from 220px */
        padding-bottom: 20px;
    }
    
    .lesson-content-wrapper {
        padding: 20px 15px;
    }
    
    .lesson-title-modern {
        font-size: 20px;
    }
    
    .lesson-title-modern::before {
        height: 24px;
    }
    
    .sidebar-course-info {
        padding: 15px;
    }
    
    .sidebar-lessons {
        padding: 15px 0;
    }
    
    /* Hide course thumbnail on mobile */
    .sidebar-course-thumbnail {
        display: none;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .lesson-header {
        padding: 10px;
    }
    
    .lesson-header .nav-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .lesson-content-wrapper {
        padding: 15px 10px;
    }
    
    .lesson-title-modern {
        font-size: 18px;
    }
    
    .lesson-text-content {
        padding: 20px 15px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

/* Mobile menu elements - hidden on desktop */
.sidebar-toggle {
    display: none;
}

.sidebar-close-btn {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Access Denied Message */
.access-denied-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0a0a0a;
    color: #fff;
    text-align: center;
    padding: 40px;
}

.access-denied-modern .message {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
}

.access-denied-modern h2 {
    color: var(--primary-color, #00d4aa);
    margin-bottom: 16px;
}
