/*
 Theme Name:  Hello Elementor Child
 Theme URI:   https://example.com/
 Description: Child theme for Hello Elementor – safe for customizations.
 Author:      Your Name
 Author URI:  https://example.com/
 Template:    hello-elementor
 Version:     1.1.0
 License:     GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: hello-elementor-child
*/

/**
 * Enhanced LearnDash Custom Styles with Preview Mode
 */

/* Reset */
.ld-custom-wrapper {
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ld-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section - Purple Gradient */
.ld-course-hero {
    background: #960141;
    color: white;
    padding: 60px 0;
    margin-bottom: 0;
    border-radius: 25px;
}

.ld-hero-title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.2 !important;
    color: white !important;
}

.ld-hero-description {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 800px;
}

.ld-hero-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.ld-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.ld-meta-icon {
    font-size: 1.3rem;
}

/* Progress Section */
.ld-progress-wrapper {
    background: white;
    padding: 40px 0;
    margin-bottom: 40px;
}

.ld-progress-box h3 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin: 0 0 20px 0 !important;
    color: #1a1a1a !important;
}

.ld-progress-bar-container {
    position: relative;
}

.ld-progress-bar {
    width: 100%;
    height: 50px;
    background: #e8e8e8;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
}

.ld-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c6fd6 0%, #9d7de3 100%);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.8s ease;
    min-width: 120px;
}

.ld-progress-label {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

/* Main Content Grid */
.ld-main-content {
    padding: 0 0 60px 0;
}

.ld-content-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 30px;
    align-items: start;
}

/* Left Sidebar - Curriculum */
.ld-curriculum-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.ld-curriculum-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 30px 25px !important;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    color: #1a1a1a !important;
}

.ld-curriculum-list {
    /* max-height: calc(100vh - 200px);
    overflow-y: auto; */
}

/* Scrollbar */
.ld-curriculum-list::-webkit-scrollbar {
    width: 6px;
}

.ld-curriculum-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.ld-curriculum-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Curriculum Item */
.ld-curriculum-item {
    padding: 20px 25px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.ld-curriculum-item:hover {
    background: #f8f8f8;
}

.ld-curriculum-item.active {
    background: linear-gradient(135deg, #7c6fd6 0%, #9d7de3 100%);
    color: white;
    border-left: 4px solid #6759c9;
}

.ld-curriculum-item.completed {
    background: linear-gradient(135deg, #7c6fd6 0%, #9d7de3 100%);
    color: white;
}

.ld-curriculum-item.completed:hover {
    background: linear-gradient(135deg, #6759c9 0%, #8c6ed1 100%);
}

/* Preview Mode Styles */
.ld-curriculum-item.ld-preview-item {
    background: white;
    color: #1a1a1a;
    opacity: 0.85;
}

.ld-curriculum-item.ld-preview-item:hover {
    background: #f8f8f8;
    opacity: 1;
}

.ld-curriculum-item.ld-preview-item.active {
    background: #f0f0f0;
    border-left: 4px solid #cbd5e0;
}

.ld-lesson-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #666;
}

.ld-curriculum-item.active .ld-lesson-label,
.ld-curriculum-item.completed .ld-lesson-label {
    color: rgba(255,255,255,0.85);
}

.ld-lesson-name {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.4 !important;
    color: #1a1a1a!important;
}

.ld-curriculum-item.active .ld-lesson-name,
.ld-curriculum-item.completed .ld-lesson-name {
    color: white !important;
}

.ld-lesson-duration {
    font-size: 0.85rem;
    color: #666;
}

.ld-curriculum-item.active .ld-lesson-duration,
.ld-curriculum-item.completed .ld-lesson-duration {
    color: rgba(255,255,255,0.85);
}

.ld-check-icon,
.ld-lock-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.ld-lock-icon {
    background: rgba(0,0,0,0.1);
    color: #666;
}

/* Right Content Area */
.ld-lesson-area {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

#ld-lesson-content {
    min-height: 600px;
}

.ld-lesson-container {
    padding: 0;
}

/* Lesson Thumbnail */
.ld-lesson-thumbnail {
    width: 100%;
    height: 450px;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ld-lesson-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ld-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #d8d8d8;
}

.ld-doc-icon {
    font-size: 6rem;
    opacity: 0.3;
}

/* Preview Overlay */
.ld-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ld-preview-message {
    text-align: center;
    color: white;
    padding: 40px;
}

.ld-lock-big {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    opacity: 0.9;
}

.ld-preview-message h3 {
    font-size: 2rem !important;
    margin: 0 0 15px 0 !important;
    color: white !important;
}

.ld-preview-message p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Lesson Header */
.ld-lesson-header {
    padding: 40px;
    border-bottom: 1px solid #e8e8e8;
}

.ld-lesson-header h2 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin: 0 0 15px 0 !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
}

.ld-lesson-excerpt {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.ld-lesson-excerpt em {
    color: #999;
    font-style: italic;
}

/* Action Buttons */
.ld-action-buttons {
    display: flex;
    gap: 15px;
    padding: 30px 40px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
}

.ld-complete-btn,
.ld-details-btn,
.ld-next-btn,
.ld-enroll-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.ld-complete-btn {
    background: linear-gradient(135deg, #7c6fd6 0%, #9d7de3 100%);
    color: white;
}

.ld-complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,111,214,0.4);
}

.ld-details-btn {
    background: white;
    color: #333;
    border: 2px solid #e8e8e8;
}

.ld-details-btn:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}

.ld-next-btn {
    background: white;
    color: white;
    border: 2px solid #7c6fd6;
}

.ld-next-btn:hover {
    background: #7c6fd6;
    color: white;
}

.ld-completed-badge {
    padding: 14px 28px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ld-enroll-btn {
    background: #960141;
    color: white!important;
}

.ld-enroll-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: white;
}

.ld-register-btn {
    background: #7c6fd6;
}

/* Preview Info Box */
.ld-preview-info {
    padding: 40px;
}

.ld-preview-box {
    background: #f0f4ff;
    border: 2px solid #7c6fd6;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.ld-preview-box h3 {
    font-size: 1.8rem !important;
    margin: 0 0 20px 0 !important;
    color: #1a1a1a !important;
}

.ld-preview-box p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 30px;
}

.ld-preview-cta {
    margin-top: 30px;
}

/* Lesson Details Section */
.ld-lesson-details {
    padding: 40px;
}

.ld-videos-section,
.ld-content-section,
.ld-materials-section,
.ld-quiz-section {
    margin-bottom: 40px;
}

.ld-videos-section h3,
.ld-content-section h3,
.ld-materials-section h3,
.ld-quiz-section h3 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 0 25px 0 !important;
    color: #1a1a1a !important;
}

/* Videos Grid */
.ld-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.ld-video-item {
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.ld-video-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    color: #1a1a1a !important;
}

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

.ld-video-player iframe,
.ld-video-player video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    display: block;
}

/* Lesson Text Content */
.ld-lesson-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.ld-lesson-text h1,
.ld-lesson-text h2,
.ld-lesson-text h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.ld-lesson-text p {
    margin-bottom: 20px;
}

.ld-lesson-text ul,
.ld-lesson-text ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.ld-lesson-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Materials Section */
.ld-materials-content {
    background: #fff8e1;
    border-left: 4px solid #ffa726;
    padding: 25px;
    border-radius: 8px;
}

.ld-materials-content ul {
    margin: 0;
    padding-left: 20px;
}

.ld-materials-content li {
    margin-bottom: 10px;
    color: #5f4c00;
}

.ld-materials-content a {
    color: #f57c00;
    font-weight: 600;
    text-decoration: none;
}

.ld-materials-content a:hover {
    text-decoration: underline;
}

/* Quiz Section */
.ld-quiz-item {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #e8e8e8;
}

.ld-quiz-item h4 {
    font-size: 1.3rem !important;
    margin: 0 0 10px 0 !important;
    color: #1a1a1a !important;
}

.ld-quiz-item p {
    color: #666;
    margin-bottom: 20px;
}

.ld-quiz-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #ff9800;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ld-quiz-btn:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Loading State */
.ld-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.ld-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e8e8e8;
    border-top-color: #7c6fd6;
    border-radius: 50%;
    animation: ldSpin 1s linear infinite;
    margin-bottom: 20px;
}

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

.ld-loading-state p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Placeholder State */
.ld-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.ld-placeholder-icon {
    font-size: 5rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.ld-placeholder p {
    font-size: 1.2rem;
    color: #999;
    margin: 0;
}

/* Error State */
.ld-error-state {
    padding: 30px;
    background: #fee;
    border-left: 4px solid #f44336;
    border-radius: 8px;
    color: #c62828;
    font-weight: 600;
    margin: 40px;
}

/* Enrollment Section */
.ld-enrollment-section {
    padding: 60px 0;
}

.ld-enrollment-card {
    background: white;
    padding: 60px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.ld-enrollment-card h2 {
    font-size: 2rem !important;
    margin-bottom: 20px !important;
    color: #1a1a1a !important;
}

.ld-enrollment-content {
    margin-bottom: 30px;
    line-height: 1.8;
}

.ld-enrollment-cta {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ld-content-grid {
        grid-template-columns: 320px 1fr;
        gap: 20px;
    }
    
    .ld-videos-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .ld-content-grid {
        grid-template-columns: 1fr;
    }
    
    .ld-curriculum-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    .ld-curriculum-list {
        max-height: 400px;
        overflow: auto;
    }
}

@media (max-width: 768px) {
    .ld-course-hero {
        padding: 40px 0;
    }
    
    .ld-hero-title {
        font-size: 1.8rem !important;
    }
    
    .ld-hero-description {
        font-size: 1rem;
    }
    
    .ld-hero-meta {
        gap: 15px;
    }
    
    .ld-lesson-thumbnail {
        height: 300px;
    }
    
    .ld-lesson-header {
        padding: 25px;
    }
    
    .ld-lesson-header h2 {
        font-size: 1.5rem !important;
    }
    
    .ld-action-buttons,
    .ld-enrollment-cta {
        flex-direction: column;
        padding: 20px;
    }
    
    .ld-complete-btn,
    .ld-details-btn,
    .ld-next-btn,
    .ld-completed-badge,
    .ld-enroll-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .ld-lesson-details {
        padding: 25px;
    }
    
    .ld-videos-grid {
        grid-template-columns: 1fr;
    }
    
    .ld-enrollment-card {
        padding: 30px 20px;
    }
    
    .ld-preview-box {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .ld-hero-title {
        font-size: 1.5rem !important;
    }
    
    .ld-curriculum-title {
        font-size: 1.2rem !important;
        padding: 20px !important;
    }
    
    .ld-curriculum-item {
        padding: 15px 20px;
    }
    
    .ld-lock-big {
        font-size: 3rem;
    }
    
    .ld-preview-message h3 {
        font-size: 1.5rem !important;
    }
}
