/**
 * Eluway LMS Styling Overrides
 *
 * This file overrides the default LMS plugin styles to match
 * the Lexagate/Eluway design system.
 *
 * Uses CSS variables from variables.css
 */

/* ==========================================================================
   1. COURSE CARDS (Archive/Grid)
   ========================================================================== */

/* Course card container */
.ew-lms-course-card,
.ew-lms-loop-course-container,
.ew-lms-card {
    background: var(--eluway-bg);
    border-radius: var(--eluway-radius-2xl);
    border: 1px solid var(--eluway-border);
    overflow: hidden;
    transition: transform var(--eluway-transition-base) var(--eluway-ease-default),
                box-shadow var(--eluway-transition-base) var(--eluway-ease-default);
    position: relative;
}

.ew-lms-course-card:hover,
.ew-lms-loop-course-container:hover,
.ew-lms-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--eluway-shadow-lg);
}

/* Card gradient top border on hover */
.ew-lms-course-card::before,
.ew-lms-loop-course-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--eluway-primary-500), var(--eluway-accent-500));
    opacity: 0;
    transition: opacity var(--eluway-transition-base) var(--eluway-ease-default);
}

.ew-lms-course-card:hover::before,
.ew-lms-loop-course-container:hover::before {
    opacity: 1;
}

/* Course thumbnail */
.ew-lms-course-thumbnail,
.ew-lms-ratio-sixteen-nine {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.ew-lms-course-thumbnail img,
.ew-lms-ratio-sixteen-nine img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--eluway-transition-slow) var(--eluway-ease-default);
}

.ew-lms-course-card:hover .ew-lms-course-thumbnail img,
.ew-lms-loop-course-container:hover .ew-lms-ratio-sixteen-nine img {
    transform: scale(1.05);
}

/* Course content area */
.ew-lms-course-content,
.ew-lms-card-body {
    padding: var(--eluway-space-5);
}

/* Course title */
.ew-lms-course-title,
.ew-lms-loop-title h3,
.ew-lms-loop-title a {
    font-family: var(--eluway-font-display);
    font-size: var(--eluway-text-lg);
    font-weight: var(--eluway-font-semibold);
    color: var(--eluway-text);
    line-height: var(--eluway-leading-snug);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--eluway-space-2);
    transition: color var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-course-card:hover .ew-lms-course-title,
.ew-lms-loop-course-container:hover .ew-lms-loop-title a {
    color: var(--eluway-primary-600);
}

/* Course meta (lessons, duration, etc.) */
.ew-lms-course-meta,
.ew-lms-loop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eluway-space-4);
    color: var(--eluway-text-muted);
    font-size: var(--eluway-text-sm);
    margin-top: var(--eluway-space-3);
}

.ew-lms-course-meta span,
.ew-lms-loop-meta span {
    display: flex;
    align-items: center;
    gap: var(--eluway-space-1);
}

.ew-lms-course-meta i,
.ew-lms-loop-meta i {
    font-size: 1em;
    color: var(--eluway-primary-500);
}

/* Price badge */
.ew-lms-price-badge,
.ew-lms-loop-price {
    position: absolute;
    top: var(--eluway-space-3);
    right: var(--eluway-space-3);
    background: linear-gradient(135deg, var(--eluway-primary-600), var(--eluway-accent-500));
    color: white;
    font-size: var(--eluway-text-sm);
    font-weight: var(--eluway-font-semibold);
    padding: var(--eluway-space-1) var(--eluway-space-3);
    border-radius: var(--eluway-radius-full);
    box-shadow: var(--eluway-shadow-md);
}

.ew-lms-price-badge.free,
.ew-lms-loop-price .ew-lms-badge-free {
    background: var(--eluway-success);
}

/* Progress bar */
.ew-lms-progress-bar,
.ew-lms-progress-circle-wrap {
    height: 6px;
    background: var(--eluway-surface-200);
    border-radius: var(--eluway-radius-full);
    overflow: hidden;
    margin-top: var(--eluway-space-3);
}

.ew-lms-progress-fill,
.ew-lms-progress-bar span {
    height: 100%;
    background: linear-gradient(to right, var(--eluway-primary-500), var(--eluway-accent-500));
    border-radius: var(--eluway-radius-full);
    transition: width var(--eluway-transition-slow) var(--eluway-ease-default);
}

/* ==========================================================================
   2. SINGLE COURSE PAGE
   ========================================================================== */

/* Course hero section */
.ew-lms-course-hero,
.ew-lms-single-course-lead-info {
    background: linear-gradient(135deg,
        var(--eluway-gradient-1),
        var(--eluway-gradient-2),
        var(--eluway-gradient-3),
        var(--eluway-gradient-4),
        var(--eluway-gradient-5),
        var(--eluway-gradient-6)
    );
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    padding: var(--eluway-space-12) var(--eluway-space-4);
    text-align: center;
    position: relative;
}

.ew-lms-course-hero::after,
.ew-lms-single-course-lead-info::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.ew-lms-course-hero > *,
.ew-lms-single-course-lead-info > * {
    position: relative;
    z-index: 2;
}

.ew-lms-course-hero h1,
.ew-lms-single-course-lead-info h1 {
    color: white;
    font-family: var(--eluway-font-display);
    font-size: var(--eluway-text-4xl);
    font-weight: var(--eluway-font-bold);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--eluway-space-4);
}

@media (min-width: 768px) {
    .ew-lms-course-hero h1,
    .ew-lms-single-course-lead-info h1 {
        font-size: var(--eluway-text-5xl);
    }
}

/* Course tabs navigation */
.ew-lms-course-tabs,
.ew-lms-nav-tabs {
    display: flex;
    gap: var(--eluway-space-1);
    border-bottom: 1px solid var(--eluway-border);
    padding: 0 var(--eluway-space-4);
    background: var(--eluway-bg);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.ew-lms-course-tabs a,
.ew-lms-nav-tabs li a {
    padding: var(--eluway-space-4) var(--eluway-space-5);
    color: var(--eluway-text-secondary);
    font-weight: var(--eluway-font-medium);
    border-bottom: 2px solid transparent;
    transition: all var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-course-tabs a:hover,
.ew-lms-nav-tabs li a:hover {
    color: var(--eluway-primary-600);
}

.ew-lms-course-tabs a.active,
.ew-lms-nav-tabs li.active a {
    color: var(--eluway-primary-600);
    border-bottom-color: var(--eluway-primary-600);
    background: linear-gradient(to bottom, transparent 90%, var(--eluway-primary-100));
}

/* Curriculum/Lessons list */
.ew-lms-curriculum,
.ew-lms-topics-wrap {
    background: var(--eluway-bg);
    border-radius: var(--eluway-radius-xl);
    border: 1px solid var(--eluway-border);
    overflow: hidden;
}

.ew-lms-topic-header,
.ew-lms-topics-title {
    background: var(--eluway-bg-secondary);
    padding: var(--eluway-space-4) var(--eluway-space-5);
    font-weight: var(--eluway-font-semibold);
    border-bottom: 1px solid var(--eluway-border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ew-lms-lesson-item,
.ew-lms-lesson-wrap {
    padding: var(--eluway-space-4) var(--eluway-space-5);
    border-bottom: 1px solid var(--eluway-border-light);
    display: flex;
    align-items: center;
    gap: var(--eluway-space-3);
    transition: background var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-lesson-item:hover,
.ew-lms-lesson-wrap:hover {
    background: var(--eluway-bg-secondary);
}

.ew-lms-lesson-item:last-child,
.ew-lms-lesson-wrap:last-child {
    border-bottom: none;
}

.ew-lms-lesson-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--eluway-radius-full);
    background: var(--eluway-primary-100);
    color: var(--eluway-primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ew-lms-lesson-icon.completed {
    background: var(--eluway-success);
    color: white;
}

/* ==========================================================================
   3. LESSON VIEWER / FOCUS MODE
   ========================================================================== */

.ew-lms-lesson-viewer,
.ew-lms-lesson-content-wrap {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 60px);
}

@media (max-width: 1024px) {
    .ew-lms-lesson-viewer,
    .ew-lms-lesson-content-wrap {
        grid-template-columns: 1fr;
    }
}

/* Lesson sidebar */
.ew-lms-lesson-sidebar {
    background: var(--eluway-bg-secondary);
    border-right: 1px solid var(--eluway-border);
    overflow-y: auto;
    padding: var(--eluway-space-4);
}

/* Lesson main content */
.ew-lms-lesson-main {
    padding: var(--eluway-space-8);
    max-width: 900px;
    margin: 0 auto;
}

/* Video player container */
.ew-lms-video-player,
.ew-lms-lesson-video {
    aspect-ratio: 16 / 9;
    background: black;
    border-radius: var(--eluway-radius-xl);
    overflow: hidden;
    margin-bottom: var(--eluway-space-6);
}

/* Lesson navigation */
.ew-lms-lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--eluway-space-4);
    background: var(--eluway-bg);
    border-top: 1px solid var(--eluway-border);
    position: sticky;
    bottom: 0;
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

.ew-lms-btn,
.ew-lms-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eluway-space-2);
    padding: var(--eluway-space-3) var(--eluway-space-6);
    font-family: var(--eluway-font-sans);
    font-size: var(--eluway-text-sm);
    font-weight: var(--eluway-font-semibold);
    border-radius: var(--eluway-radius-xl);
    border: none;
    cursor: pointer;
    transition: all var(--eluway-transition-fast) var(--eluway-ease-default);
    text-decoration: none;
}

.ew-lms-btn-primary,
.ew-lms-button-primary {
    background: linear-gradient(135deg, var(--eluway-primary-600), var(--eluway-primary-700));
    color: white;
    box-shadow: var(--eluway-shadow-md);
}

.ew-lms-btn-primary:hover,
.ew-lms-button-primary:hover {
    background: linear-gradient(135deg, var(--eluway-primary-700), var(--eluway-primary-800));
    transform: translateY(-1px);
    box-shadow: var(--eluway-shadow-lg);
    color: white;
}

.ew-lms-btn-gradient {
    background: linear-gradient(135deg, var(--eluway-primary-600), var(--eluway-accent-500));
    color: white;
}

.ew-lms-btn-gradient:hover {
    background: linear-gradient(135deg, var(--eluway-primary-700), var(--eluway-accent-600));
    color: white;
}

.ew-lms-btn-outline {
    background: transparent;
    border: 2px solid var(--eluway-primary-600);
    color: var(--eluway-primary-600);
}

.ew-lms-btn-outline:hover {
    background: var(--eluway-primary-600);
    color: white;
}

/* Large button */
.ew-lms-btn-lg {
    padding: var(--eluway-space-4) var(--eluway-space-8);
    font-size: var(--eluway-text-base);
}

/* ==========================================================================
   5. DASHBOARD
   ========================================================================== */

.ew-lms-dashboard {
    padding: var(--eluway-space-6);
}

/* Stats cards */
.ew-lms-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--eluway-space-4);
    margin-bottom: var(--eluway-space-8);
}

@media (min-width: 768px) {
    .ew-lms-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ew-lms-stat-card {
    background: var(--eluway-bg);
    border: 1px solid var(--eluway-border);
    border-radius: var(--eluway-radius-xl);
    padding: var(--eluway-space-5);
    text-align: center;
    transition: transform var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-stat-card:hover {
    transform: translateY(-2px);
}

.ew-lms-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--eluway-radius-xl);
    background: linear-gradient(135deg, var(--eluway-primary-100), var(--eluway-primary-200));
    color: var(--eluway-primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--eluway-space-3);
    font-size: var(--eluway-text-xl);
}

.ew-lms-stat-value {
    font-family: var(--eluway-font-display);
    font-size: var(--eluway-text-2xl);
    font-weight: var(--eluway-font-bold);
    color: var(--eluway-text);
    margin-bottom: var(--eluway-space-1);
}

.ew-lms-stat-label {
    font-size: var(--eluway-text-sm);
    color: var(--eluway-text-muted);
}

/* ==========================================================================
   6. FORMS
   ========================================================================== */

.ew-lms-form-control,
.ew-lms-form-input {
    width: 100%;
    padding: var(--eluway-space-3) var(--eluway-space-4);
    font-size: var(--eluway-text-base);
    border: 1px solid var(--eluway-border);
    border-radius: var(--eluway-radius-lg);
    background: var(--eluway-bg);
    color: var(--eluway-text);
    transition: border-color var(--eluway-transition-fast) var(--eluway-ease-default),
                box-shadow var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-form-control:focus,
.ew-lms-form-input:focus {
    outline: none;
    border-color: var(--eluway-primary-500);
    box-shadow: 0 0 0 3px var(--eluway-primary-100);
}

.ew-lms-form-label {
    display: block;
    font-size: var(--eluway-text-sm);
    font-weight: var(--eluway-font-medium);
    color: var(--eluway-text);
    margin-bottom: var(--eluway-space-2);
}

/* ==========================================================================
   7. QUIZ STYLES
   ========================================================================== */

.ew-lms-quiz-question {
    background: var(--eluway-bg);
    border: 1px solid var(--eluway-border);
    border-radius: var(--eluway-radius-xl);
    padding: var(--eluway-space-6);
    margin-bottom: var(--eluway-space-6);
}

.ew-lms-quiz-question h3 {
    font-size: var(--eluway-text-lg);
    margin-bottom: var(--eluway-space-4);
}

.ew-lms-quiz-option {
    display: flex;
    align-items: center;
    gap: var(--eluway-space-3);
    padding: var(--eluway-space-4);
    border: 2px solid var(--eluway-border);
    border-radius: var(--eluway-radius-lg);
    margin-bottom: var(--eluway-space-3);
    cursor: pointer;
    transition: all var(--eluway-transition-fast) var(--eluway-ease-default);
}

.ew-lms-quiz-option:hover {
    border-color: var(--eluway-primary-300);
    background: var(--eluway-primary-50);
}

.ew-lms-quiz-option.selected {
    border-color: var(--eluway-primary-600);
    background: var(--eluway-primary-50);
}

.ew-lms-quiz-option.correct {
    border-color: var(--eluway-success);
    background: rgba(34, 197, 94, 0.1);
}

.ew-lms-quiz-option.incorrect {
    border-color: var(--eluway-error);
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   8. BADGES & PILLS
   ========================================================================== */

.ew-lms-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--eluway-space-1) var(--eluway-space-3);
    font-size: var(--eluway-text-xs);
    font-weight: var(--eluway-font-semibold);
    border-radius: var(--eluway-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ew-lms-badge-primary {
    background: var(--eluway-primary-100);
    color: var(--eluway-primary-700);
}

.ew-lms-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--eluway-success-dark);
}

.ew-lms-badge-warning {
    background: rgba(234, 179, 8, 0.1);
    color: var(--eluway-warning-dark);
}

/* ==========================================================================
   9. ANIMATIONS
   ========================================================================== */

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ew-lms-fade-in-up {
    animation: fadeInUp var(--eluway-transition-base) var(--eluway-ease-default);
}

/* ==========================================================================
   10. RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 767px) {
    .ew-lms-course-hero h1,
    .ew-lms-single-course-lead-info h1 {
        font-size: var(--eluway-text-2xl);
    }

    .ew-lms-course-tabs,
    .ew-lms-nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ew-lms-course-tabs a,
    .ew-lms-nav-tabs li a {
        white-space: nowrap;
        padding: var(--eluway-space-3) var(--eluway-space-4);
    }
}

/* ==========================================================================
   11. DARK MODE SUPPORT
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ew-lms-course-card,
    .ew-lms-loop-course-container,
    .ew-lms-card {
        background: var(--eluway-surface-800);
        border-color: var(--eluway-surface-700);
    }

    .ew-lms-course-title,
    .ew-lms-loop-title a {
        color: var(--eluway-surface-100);
    }

    .ew-lms-stat-card,
    .ew-lms-quiz-question {
        background: var(--eluway-surface-800);
        border-color: var(--eluway-surface-700);
    }
}
/* ==========================================================================
   COURSES PAGE - Lexagate Style
   ========================================================================== */

/* Courses Page Container */
.ew-courses-page {
    min-height: 100vh;
    background: var(--eluway-surface-50, #f8fafc);
}

.ew-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section */
.ew-courses-hero {
    background: linear-gradient(135deg, #3e64de 0%, #5b7de8 50%, #7996f2 100%);
    position: relative;
    overflow: hidden;
}

.ew-courses-hero-noise {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: url(/wp-content/themes/eluway/assets/images/noise-texture.png);
    background-repeat: repeat;
}

.ew-courses-hero-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 0 3rem;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .ew-courses-hero-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 3rem 0;
    }
}

.ew-courses-hero-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ew-courses-hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ew-courses-hero-text {
    display: flex;
    flex-direction: column;
}

.ew-courses-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .ew-courses-hero-title {
        font-size: 1.875rem;
    }
}

.ew-courses-hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

/* Recommended Course Card - Matches Lexagate exactly */
.ew-courses-recommended-card {
    display: none;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 0.75rem;
    padding-right: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
    max-width: 28rem;
}

@media (min-width: 768px) {
    .ew-courses-recommended-card {
        display: flex;
    }
}

.ew-courses-recommended-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ew-recommended-thumb {
    position: relative;
    width: 5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.ew-recommended-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ew-recommended-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.ew-recommended-content {
    flex: 1;
    min-width: 0;
}

.ew-recommended-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.125rem;
}

.ew-star-icon {
    width: 0.75rem;
    height: 0.75rem;
    color: #fbbf24;
    fill: #fbbf24;
}

.ew-recommended-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.ew-recommended-free {
    font-size: 0.75rem;
    color: #34d399;
    font-weight: 500;
    margin-left: 0.25rem;
}

.ew-recommended-title {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-recommended-arrow {
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ew-courses-recommended-card:hover .ew-recommended-arrow {
    color: white;
    transform: translateX(0.25rem);
}

/* Filter Bar */
.ew-courses-filter-bar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.ew-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.ew-filter-mobile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .ew-filter-mobile-btn {
        display: none;
    }
}

.ew-filter-mobile-btn:hover {
    background: #f9fafb;
}

.ew-filter-count {
    background: #3e64de;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 600;
}

.ew-filter-label {
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

@media (min-width: 768px) {
    .ew-filter-label {
        display: block;
    }
}

/* Filter Dropdown */
.ew-filter-dropdown {
    display: none;
    position: relative;
}

@media (min-width: 768px) {
    .ew-filter-dropdown {
        display: block;
    }
}

.ew-filter-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ew-filter-dropdown-btn:hover {
    background: #f9fafb;
}

.ew-filter-badge {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 600;
}

.ew-chevron {
    transition: transform 0.2s ease;
}

.ew-filter-dropdown.is-open .ew-chevron {
    transform: rotate(180deg);
}

.ew-filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 14rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    padding: 0.5rem;
}

.ew-filter-dropdown.is-open .ew-filter-dropdown-menu {
    display: block;
}

.ew-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ew-filter-checkbox:hover {
    background: #f3f4f6;
}

.ew-filter-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: #3e64de;
}

.ew-filter-checkbox span {
    font-size: 0.875rem;
    color: #374151;
}

.ew-filter-clear {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    color: #6b7280;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

@media (min-width: 768px) {
    .ew-filter-clear {
        display: flex;
    }
}

.ew-filter-clear:hover {
    color: #374151;
}

.ew-filter-search-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ew-filter-search-btn:hover {
    background: #f3f4f6;
}

/* Courses Grid */
.ew-courses-main {
    padding: 1.5rem 0 2rem;
}

@media (min-width: 768px) {
    .ew-courses-main {
        padding: 2rem 0;
    }
}

.ew-courses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .ew-courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ew-courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .ew-courses-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Load More Button */
.ew-courses-load-more {
    margin-top: 2rem;
    text-align: center;
}

.ew-load-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    justify-content: center;
}

.ew-load-more-btn:hover {
    background: #f9fafb;
    transform: scale(1.02);
}

.ew-load-more-btn:active {
    transform: scale(0.98);
}

/* Empty State */
.ew-courses-empty {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    padding: 3rem;
    text-align: center;
}

.ew-courses-empty-icon {
    width: 4rem;
    height: 4rem;
    background: #dbeafe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #3e64de;
}

.ew-courses-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.ew-courses-empty-text {
    color: #6b7280;
    margin: 0 0 1.5rem;
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
}

.ew-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ew-btn-outline {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.ew-btn-outline:hover {
    background: #f9fafb;
}

/* Search Modal */
.ew-search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.ew-search-modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.ew-search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ew-search-modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 32rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ew-search-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.ew-search-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.ew-search-modal-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9ca3af;
}

.ew-search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.125rem;
    color: #111827;
    background: transparent;
}

.ew-search-modal-input::placeholder {
    color: #9ca3af;
/* ==========================================================================
   SINGLE COURSE PAGE - Lexagate Style
   ========================================================================== */

/* Global SVG Reset - Prevent SVGs from expanding */
.ew-course-detail-page svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Page Container */
.ew-course-detail-page {
    min-height: 100vh;
    background: var(--eluway-surface-50, #f8fafc);
}

/* Container */
.ew-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .ew-container {
        padding: 0 2rem;
    }
}

/* Hero Section */
.ew-course-hero {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.ew-course-detail-page .ew-course-hero-inner {
    display: flex !important;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 1024px) {
    .ew-course-detail-page .ew-course-hero-inner {
        flex-direction: row !important;
        align-items: stretch;
        gap: 2rem;
        padding: 2rem 0;
    }
}

/* Left: Thumbnail */
.ew-course-hero-left {
    position: relative;
}

@media (min-width: 1024px) {
    .ew-course-hero-left {
        width: 40%;
        flex-shrink: 0;
    }
}

/* Breadcrumbs */
.ew-course-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.ew-course-breadcrumbs a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.ew-course-breadcrumbs a:hover {
    color: #3e64de;
}

.ew-breadcrumb-icon {
    width: 0.75rem;
    height: 0.75rem;
}

.ew-breadcrumb-chevron {
    width: 0.75rem;
    height: 0.75rem;
}

/* Thumbnail */
.ew-course-thumbnail {
    aspect-ratio: 16/9;
    border-radius: 1rem;
    overflow: hidden;
    background: #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.ew-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ew-course-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.ew-course-thumbnail-placeholder svg {
    width: 4rem;
    height: 4rem;
}

/* Right: Course Info */
.ew-course-hero-right {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .ew-course-hero-right {
        flex: 1;
    }
}

.ew-course-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .ew-course-title {
        font-size: 1.75rem;
    }
}

/* Instructor Row */
.ew-course-instructor-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ew-course-instructor-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    overflow: hidden;
}

.ew-course-instructor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ew-course-instructor-name {
    font-weight: 500;
    color: #374151;
}

.ew-course-meta-sep {
    color: #9ca3af;
}

.ew-course-meta-icon {
    width: 0.75rem;
    height: 0.75rem;
}

/* Tab Toggle */
.ew-course-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ew-course-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: #f3f4f6;
    color: #6b7280;
}

.ew-course-tab:hover {
    background: #e5e7eb;
}

.ew-course-tab.active {
    background: #3e64de;
    color: white;
}

.ew-course-tab svg {
    width: 1rem;
    height: 1rem;
}

/* Tab Content */
.ew-course-tab-content {
    flex: 1;
    overflow-y: auto;
}

.ew-course-tab-panel {
    display: none;
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.ew-course-tab-panel.active {
    display: block;
}

.ew-course-tab-panel p {
    margin: 0;
}

/* Objectives Grid */
.ew-objectives-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .ew-objectives-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ew-objective-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.ew-objective-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.ew-objective-icon svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #059669;
}

.ew-objective-item span {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

.ew-no-objectives {
    color: #9ca3af;
    font-style: italic;
}

/* Main Content */
.ew-course-main {
    padding: 2rem 0;
}

.ew-course-detail-page .ew-course-layout {
    display: grid !important;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .ew-course-detail-page .ew-course-layout {
        grid-template-columns: 1fr 22rem !important;
        gap: 2rem;
    }
}

/* Content Card */
.ew-content-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.ew-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ew-content-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.ew-content-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Preview Notice */
.ew-preview-notice {
    background: #eff6ff;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ew-preview-notice svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #3e64de;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.ew-preview-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d4ed8;
    margin: 0 0 0.25rem;
}

.ew-preview-text {
    font-size: 0.75rem;
    color: #3b82f6;
    margin: 0;
}

/* Modules List */
.ew-modules-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Module */
.ew-module-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ew-module-number {
    width: 2rem;
    height: 2rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ew-module-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ew-module-info p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

/* Lessons List */
.ew-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 2.75rem;
}

.ew-lesson {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.ew-lesson-accessible {
    cursor: pointer;
}

.ew-lesson-accessible:hover {
    background: #f3f4f6;
}

.ew-lesson-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.ew-lesson-completed {
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.5);
}

.ew-lesson-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ew-lesson-icon.completed {
    background: #d1fae5;
}

.ew-lesson-icon.completed svg {
    width: 1rem;
    height: 1rem;
    color: #059669;
}

.ew-lesson-icon.accessible {
    background: #eff6ff;
}

.ew-lesson-icon.accessible svg {
    width: 1rem;
    height: 1rem;
    color: #3e64de;
}

.ew-lesson-icon.locked {
    background: #e5e7eb;
}

.ew-lesson-icon.locked svg {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.ew-lesson-content {
    flex: 1;
    min-width: 0;
}

.ew-lesson-content h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-lesson-locked .ew-lesson-content h4 {
    color: #6b7280;
}

.ew-lesson-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ew-preview-badge {
    padding: 0.125rem 0.5rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.ew-lesson-duration {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Sidebar */
.ew-course-sidebar {
    order: -1;
}

@media (min-width: 1024px) {
    .ew-course-sidebar {
        order: 0;
    }
}

.ew-sidebar-sticky {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .ew-sidebar-sticky {
        position: sticky;
        top: 6rem;
    }
}

/* Progress Card */
.ew-progress-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.ew-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ew-progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.ew-progress-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3e64de;
}

.ew-progress-bar {
    width: 100%;
    height: 0.75rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.ew-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #c026d3, #db2777);
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.ew-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(90deg, #7c3aed, #c026d3, #db2777, #c026d3, #7c3aed);
    background-size: 200% 100%;
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s;
    animation: gradient-shift 3s ease infinite;
    box-shadow: 0 0 20px rgba(192, 38, 211, 0.4);
}

.ew-continue-btn:hover {
    box-shadow: 0 0 30px rgba(192, 38, 211, 0.6);
    color: white;
}

.ew-continue-btn svg {
    width: 1rem;
    height: 1rem;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Purchase Card */
.ew-purchase-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.ew-price-section {
    text-align: center;
    margin-bottom: 1rem;
}

.ew-price-free {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
}

.ew-price {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
}

.ew-enroll-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ew-enroll-free {
    background: #059669;
    color: white;
}

.ew-enroll-free:hover {
    background: #047857;
    color: white;
}

.ew-card-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1rem 0;
}

.ew-card-actions {
    display: flex;
    gap: 0.5rem;
}

.ew-share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: #f3f4f6;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.ew-share-btn:hover {
    background: #e5e7eb;
}

.ew-share-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Features Card */
.ew-features-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.ew-features-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem;
}

.ew-features-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ew-features-card li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.ew-features-card li svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #3e64de;
    flex-shrink: 0;
}

/* Mobile CTA */
.ew-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: block;
}

@media (min-width: 1024px) {
    .ew-mobile-cta {
        display: none;
    }
}

.ew-mobile-cta-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ew-mobile-price {
    flex-shrink: 0;
}

.ew-mobile-price .ew-price-free {
    font-size: 1.25rem;
}

.ew-mobile-price .ew-price {
    font-size: 1.25rem;
}

.ew-mobile-form {
    flex: 1;
}

.ew-mobile-enroll-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #059669;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.ew-mobile-enroll-btn:hover {
    background: #047857;
    color: white;
}

.ew-mobile-buy-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #f59e0b;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ew-mobile-buy-btn:hover {
    background: #d97706;
}

.ew-mobile-buy-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ew-mobile-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(90deg, #7c3aed, #c026d3, #db2777, #c026d3, #7c3aed);
    background-size: 200% 100%;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 9999px;
    text-decoration: none;
    animation: gradient-shift 3s ease infinite;
}

.ew-mobile-continue-btn svg {
    width: 1rem;
    height: 1rem;
}

.ew-mobile-cta-spacer {
    height: 6rem;
    display: block;
}

@media (min-width: 1024px) {
    .ew-mobile-cta-spacer {
        display: none;
    }
}

/* Tutor Add to Cart Override */
.ew-purchase-card .tutor-course-single-btn-group {
    margin: 0;
}

.ew-purchase-card .tutor-btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.ew-purchase-card .tutor-btn-primary:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
