/**
 * Advanced EdTech LMS v2.0.0 — Adaptive Mobile-First + Desktop-Pro Design System
 * Automatically adjusts to Small Phones (320px+), Smartphones (375-430px),
 * Tablets/iPads (768-1024px), and Wide Desktops (1280-1920px+).
 */
:root {
    --aelms-primary: #2563eb;
    --aelms-primary-dark: #1d4ed8;
    --aelms-success: #16a34a;
    --aelms-danger: #dc2626;
    --aelms-warning: #d97706;
    --aelms-purple: #7c3aed;
    --aelms-bg: #f8fafc;
    --aelms-surface: #ffffff;
    --aelms-text: #0f172a;
    --aelms-muted: #64748b;
    --aelms-border: #e2e8f0;
    --aelms-radius: 14px;
}

.aelms-platform-shell[data-theme="dark"] {
    --aelms-bg: #0b1120;
    --aelms-surface: #1e293b;
    --aelms-text: #f8fafc;
    --aelms-muted: #94a3b8;
    --aelms-border: #334155;
}

.aelms-platform-shell {
    background: var(--aelms-bg);
    color: var(--aelms-text);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-radius: var(--aelms-radius);
    padding-bottom: 80px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.aelms-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--aelms-surface);
    border-bottom: 1px solid var(--aelms-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.aelms-DesktopNav {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.aelms-DesktopNav a {
    color: var(--aelms-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.aelms-badge-live {
    background: var(--aelms-danger);
    color: #fff;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    margin-right: 8px;
}

.aelms-main-container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: clamp(12px, 3vw, 28px);
}

.aelms-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Swipeable Filter Tabs for Paid & Free Courses */
.aelms-filter-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.aelms-filter-tabs::-webkit-scrollbar {
    display: none;
}

.aelms-filter-tab {
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--aelms-border);
    background: var(--aelms-surface);
    color: var(--aelms-text);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aelms-filter-tab.active {
    background: var(--aelms-primary);
    color: #ffffff;
    border-color: var(--aelms-primary);
}

.aelms-search-input {
    min-width: 260px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--aelms-border);
    background: var(--aelms-surface);
    color: var(--aelms-text);
    font-size: 14px;
}

/* Responsive Adaptive Grids */
.aelms-kpi-grid, .aelms-section-grid, .aelms-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(14px, 2.5vw, 22px);
    margin: 18px 0;
}

.aelms-card, .aelms-kpi-card, .aelms-course-card {
    background: var(--aelms-surface);
    border: 1px solid var(--aelms-border);
    border-radius: var(--aelms-radius);
    padding: clamp(16px, 2.5vw, 22px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.aelms-course-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.aelms-course-tag.tag-free {
    background: #dcfce7;
    color: #15803d;
}

.aelms-course-tag.tag-paid {
    background: #dbeafe;
    color: #1d4ed8;
}

.aelms-bonus-pill {
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 99px;
}

.aelms-companion-box {
    background: rgba(22, 163, 74, 0.08);
    border: 1px dashed #16a34a;
    color: var(--aelms-text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    margin: 10px 0;
}

.aelms-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--aelms-muted);
    margin: 10px 0;
}

.aelms-course-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    margin-top: 12px;
    border-top: 1px solid var(--aelms-border);
    flex-wrap: wrap;
}

.aelms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.aelms-btn-primary { background: var(--aelms-primary); color: #fff !important; }
.aelms-btn-success { background: var(--aelms-success); color: #fff !important; }
.aelms-btn-danger  { background: var(--aelms-danger); color: #fff !important; }
.aelms-btn-outline { background: transparent; border-color: var(--aelms-border); color: var(--aelms-text) !important; }
.aelms-btn-block   { width: 100%; margin-top: 8px; }

/* NTA / Testbook Competitive Exam Interface — Adaptive Desktop & Mobile */
.aelms-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--aelms-surface);
    padding: 14px 18px;
    border-radius: var(--aelms-radius);
    border: 1px solid var(--aelms-border);
    margin-bottom: 16px;
}

.aelms-exam-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.aelms-timer-box {
    background: #fef2f2;
    color: var(--aelms-danger);
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.aelms-exam-body {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 20px;
    align-items: start;
}

.aelms-question-stage, .aelms-palette-sidebar {
    background: var(--aelms-surface);
    border: 1px solid var(--aelms-border);
    border-radius: var(--aelms-radius);
    padding: clamp(14px, 2.5vw, 22px);
}

.aelms-exam-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--aelms-border);
}

.aelms-palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.aelms-palette-btn {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--aelms-border);
    font-weight: 700;
    cursor: pointer;
}

.aelms-palette-btn.answered, .dot.answered { background: var(--aelms-success); color: #fff; }
.aelms-palette-btn.not_answered, .dot.not_answered { background: var(--aelms-danger); color: #fff; }
.aelms-palette-btn.marked_review, .dot.marked_review { background: var(--aelms-purple); color: #fff; }
.aelms-palette-btn.not_visited, .dot.not_visited { background: #e2e8f0; color: #334155; }

/* WP Admin Mobile Responsiveness */
.aelms-admin-wrap table.widefat {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.aelms-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.aelms-mobile-bottom-nav {
    display: none;
}

/* Tablet & Mobile Adaptive Breakpoints */
@media (max-width: 991px) {
    .aelms-exam-body {
        grid-template-columns: 1fr;
    }
    .aelms-search-input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .aelms-DesktopNav {
        display: none;
    }
    .aelms-exam-action-bar .aelms-btn {
        flex: 1 1 calc(50% - 10px);
        font-size: 13px;
        padding: 10px 12px;
    }
    .aelms-mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: var(--aelms-surface);
        border-top: 1px solid var(--aelms-border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 999;
    }
    .aelms-mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--aelms-text);
        font-size: 11px;
        font-weight: 700;
    }
}


/* v3.0.0 Interactive Live Demo Hub Bar & Video Player Modal */
.aelms-demo-hub-bar {
    background: linear-gradient(90deg, #eff6ff 0%, #f5f3ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 22px;
}

.aelms-demo-hub-title {
    font-size: 13px;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.aelms-demo-pills-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.aelms-demo-pills-scroll::-webkit-scrollbar {
    display: none;
}

.aelms-demo-pill {
    white-space: nowrap;
    padding: 7px 13px;
    border-radius: 99px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aelms-demo-pill:hover, .aelms-demo-pill.active {
    background: #2563eb;
    color: #ffffff !important;
    border-color: #2563eb;
}

.aelms-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.aelms-modal-box {
    background: var(--aelms-surface);
    color: var(--aelms-text);
    border: 1px solid var(--aelms-border);
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    padding: 20px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.aelms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
