/* Analytics Engineering LMS - Frontend Styles */
/* High specificity to override theme styles */

/* Hide Header and Footer on LMS Pages - Targeted approach */
/* Only hide on single lesson/quiz/homework pages, NOT on course overview */
body.single-ae_lesson > header:not(.ae-lms-single-hero),
body.single-ae_lesson > .site-header,
body.single-ae_lesson > #masthead,
body.single-ae_lesson .site-header,
body.single-ae_lesson #site-navigation,
body.single-ae_lesson .main-navigation,
body.single-ae_lesson .primary-navigation,
body.single-ae_lesson #header,
body.single-ae_lesson .page-header:not(.ae-lms-single-hero),
body.single-ae_quiz > header:not(.ae-lms-single-hero),
body.single-ae_quiz > .site-header,
body.single-ae_quiz > #masthead,
body.single-ae_quiz .site-header,
body.single-ae_quiz #site-navigation,
body.single-ae_quiz .main-navigation,
body.single-ae_quiz .primary-navigation,
body.single-ae_quiz #header,
body.single-ae_quiz .page-header:not(.ae-lms-single-hero),
body.single-ae_homework > header:not(.ae-lms-single-hero),
body.single-ae_homework > .site-header,
body.single-ae_homework > #masthead,
body.single-ae_homework .site-header,
body.single-ae_homework #site-navigation,
body.single-ae_homework .main-navigation,
body.single-ae_homework .primary-navigation,
body.single-ae_homework #header,
body.single-ae_homework .page-header:not(.ae-lms-single-hero) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.single-ae_lesson > footer,
body.single-ae_lesson > .site-footer,
body.single-ae_lesson > #colophon,
body.single-ae_lesson .site-footer,
body.single-ae_lesson #site-footer,
body.single-ae_lesson .site-info,
body.single-ae_lesson #footer,
body.single-ae_quiz > footer,
body.single-ae_quiz > .site-footer,
body.single-ae_quiz > #colophon,
body.single-ae_quiz .site-footer,
body.single-ae_quiz #site-footer,
body.single-ae_quiz .site-info,
body.single-ae_quiz #footer,
body.single-ae_homework > footer,
body.single-ae_homework > .site-footer,
body.single-ae_homework > #colophon,
body.single-ae_homework .site-footer,
body.single-ae_homework #site-footer,
body.single-ae_homework .site-info,
body.single-ae_homework #footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide Header and Footer on Practice Hub Page */
body.page .ae-practice-hub ~ header,
body.page .ae-practice-hub ~ .site-header,
body.page .ae-practice-hub ~ #masthead,
body:has(.ae-practice-hub) > header:not(.practice-hub-hero),
body:has(.ae-practice-hub) > .site-header,
body:has(.ae-practice-hub) > #masthead,
body:has(.ae-practice-hub) .site-header,
body:has(.ae-practice-hub) #site-navigation,
body:has(.ae-practice-hub) .main-navigation,
body:has(.ae-practice-hub) .primary-navigation,
body:has(.ae-practice-hub) #header,
body:has(.ae-practice-hub) .page-header:not(.practice-hub-hero) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body:has(.ae-practice-hub) > footer,
body:has(.ae-practice-hub) > .site-footer,
body:has(.ae-practice-hub) > #colophon,
body:has(.ae-practice-hub) .site-footer,
body:has(.ae-practice-hub) #site-footer,
body:has(.ae-practice-hub) .site-info,
body:has(.ae-practice-hub) #footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure our LMS elements stay visible */
.ae-lms-course-overview,
.ae-lms-single-hero,
.ae-lms-top-bar,
.ae-lms-sidebar,
.ae-lms-single-content,
.ae-lms-modules-section,
.ae-lms-profile-section,
.ae-lms-certificate-section,
.ae-practice-hub,
.practice-hub-hero {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
}

/* Reset and Container */
.ae-lms-page * {
    box-sizing: border-box;
}

.ae-lms-page {
    max-width: 100% !important;
    width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background: #f8fafc !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main LMS Container - Fixed Layout */
.ae-lms-container {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
}

/* Top Banner - Fixed Position */
.ae-lms-top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 70px;
}

.ae-lms-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
}

.ae-lms-banner-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ae-lms-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #667eea;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
}

.ae-lms-logo:hover {
    color: #764ba2;
}

.ae-lms-logo img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 6px;
}

.ae-lms-banner-center {
    flex: 1;
    text-align: center;
}

.ae-lms-page-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.ae-lms-banner-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ae-lms-user-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7fafc;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.ae-lms-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
    font-weight: 500;
    font-size: 12px;
}

.ae-lms-stat-value {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.ae-lms-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ae-lms-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid #e2e8f0;
}

.ae-lms-user-name {
    color: #2d3748;
    font-weight: 500;
    font-size: 13px;
}

.ae-lms-logout-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.ae-lms-logout-btn:hover {
    background: #c53030;
}

/* Sidebar - Fixed Position */
.ae-lms-sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 280px;
    height: calc(100vh - 70px);
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    z-index: 999;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.ae-lms-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.ae-lms-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 4px 0;
}

.ae-lms-sidebar-subtitle {
    font-size: 12px;
    color: #718096;
    margin: 0;
}

.ae-lms-nav {
    padding: 10px 0;
}

.ae-lms-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ae-lms-nav-item {
    margin: 0;
}

.ae-lms-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.ae-lms-nav-link:hover {
    background: #f7fafc;
    color: #667eea;
    border-left-color: #667eea;
}

.ae-lms-nav-link.active {
    background: #edf2f7;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.ae-lms-nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.ae-lms-nav-text {
    flex: 1;
}

/* Main Content Area - Proper Spacing */
.ae-lms-main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
    background: #f8fafc;
}

.ae-lms-content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* Dashboard Styles */
.ae-lms-dashboard {
    background: transparent;
}

.ae-lms-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.ae-lms-dashboard-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px 0;
}

.ae-lms-dashboard-subtitle {
    font-size: 16px;
    color: #718096;
    margin: 0;
}

.ae-lms-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ae-lms-dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.ae-lms-dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ae-lms-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.ae-lms-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.ae-lms-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.ae-lms-card-content {
    color: #4a5568;
    line-height: 1.6;
}

.ae-lms-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.ae-lms-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.ae-lms-progress-text {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    text-align: center;
    margin-top: 6px;
}

/* Buttons */
.ae-lms-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.ae-lms-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ae-lms-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.ae-lms-btn-secondary {
    background: #ffffff;
    color: #667eea;
    border: 1px solid #667eea;
}

.ae-lms-btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Modules Grid */
.ae-lms-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ae-lms-module-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.ae-lms-module-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ae-lms-module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ae-lms-module-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.ae-lms-module-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.ae-lms-module-description {
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
}

.ae-lms-module-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ae-lms-module-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #667eea;
    font-weight: 500;
}

.ae-lms-module-meta-value {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 6px;
    color: #667eea;
    font-weight: 600;
}

.ae-lms-module-actions {
    margin-top: 15px;
}

/* Practice Hub Styles */
.ae-lms-practice-hub {
    background: transparent;
}

.ae-lms-practice-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ae-lms-practice-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ae-lms-practice-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ae-lms-practice-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* Projects Styles */
.ae-lms-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ae-lms-project-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.ae-lms-project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Profile Styles */
.ae-lms-profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.ae-lms-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ae-lms-profile-name {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 6px 0;
}

.ae-lms-profile-title {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* Mobile Menu Toggle */
.ae-lms-mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ae-lms-mobile-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: #667eea;
    margin: 3px auto;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.ae-lms-mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.ae-lms-mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.ae-lms-mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Sidebar Overlay for Mobile */
.ae-lms-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ae-lms-sidebar-overlay.active {
    opacity: 1;
}

/* Login Required */
.ae-lms-login-required {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    max-width: 400px;
    margin: 50px auto;
}

.ae-lms-login-required h2 {
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.ae-lms-login-required p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Error and Success States */
.ae-lms-error {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    text-align: center;
    margin: 20px 0;
}

.ae-lms-success {
    background: #c6f6d5;
    color: #2f855a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
    text-align: center;
    margin: 20px 0;
}

/* Loading States */
.ae-lms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #718096;
}

.ae-lms-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ae-lms-mobile-menu-toggle {
        display: block;
    }
    
    .ae-lms-sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
    }
    
    .ae-lms-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .ae-lms-main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .ae-lms-banner-container {
        padding: 0 15px;
    }
    
    .ae-lms-banner-left {
        gap: 10px;
    }
    
    .ae-lms-page-title {
        font-size: 16px;
    }
    
    .ae-lms-user-stats {
        display: none;
    }
    
    .ae-lms-user-name {
        display: none;
    }
    
    .ae-lms-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ae-lms-modules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ae-lms-projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ae-lms-dashboard-title {
        font-size: 24px;
    }
    
    .ae-lms-dashboard-subtitle {
        font-size: 14px;
    }
    
    .ae-lms-dashboard-card,
    .ae-lms-module-card,
    .ae-lms-project-card {
        padding: 15px;
    }
    
    .ae-lms-practice-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .ae-lms-practice-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ae-lms-main-content {
        padding: 15px 10px;
    }
    
    .ae-lms-banner-container {
        padding: 0 10px;
    }
    
    .ae-lms-dashboard-card,
    .ae-lms-module-card,
    .ae-lms-project-card {
        padding: 12px;
    }
    
    .ae-lms-dashboard-title {
        font-size: 20px;
    }
    
    .ae-lms-dashboard-subtitle {
        font-size: 13px;
    }
    
    .ae-lms-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}