/**
 * Student Dashboard - Documentation Style Layout
 * Clean, simple, both sides scroll together
 *
 * @package MathsExamLMS
 * @since 6.4.0
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --sidebar-width: 280px;
    --sidebar-bg: #f1f5f9;
    --content-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   BASE LAYOUT - Documentation Style
   ======================================== */
.mmlms-dashboard-wrapper {
    font-family: var(--font-sans);
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    background: var(--content-bg);
}

/* ========================================
   SIDEBAR - Scrolls with content
   ======================================== */
.mmlms-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    position: sticky;
    top: 48px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Brand Header */
.mmlms-sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mmlms-sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.mmlms-sidebar-brand-text h1 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin: 0;
}

.mmlms-sidebar-brand-text span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Navigation */
.mmlms-sidebar-nav {
    padding: 16px 0;
}

.mmlms-sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.mmlms-sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.mmlms-sidebar-link.active {
    color: var(--primary);
    background: #ffffff;
    border-left-color: var(--primary);
}

.mmlms-sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   CONTENT AREA - White background
   ======================================== */
.mmlms-content-area {
    flex: 1;
    background: var(--content-bg);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: 100%;
}

.mmlms-content-inner {
    max-width: 100%;
    padding: 40px 48px;
}

/* ========================================
   VIEW HEADER
   ======================================== */
.mmlms-view-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.mmlms-view-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.mmlms-view-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mmlms-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ========================================
   FULL WIDTH CONTAINER SUPPORT
   ======================================== */
/* When theme container is full width, stretch content */
.entry-content .mmlms-dashboard-wrapper,
.wp-block-post-content .mmlms-dashboard-wrapper,
.content-area .mmlms-dashboard-wrapper,
.site-content .mmlms-dashboard-wrapper,
#main .mmlms-dashboard-wrapper,
main .mmlms-dashboard-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Ensure content stretches to fill available space */
.mmlms-content-area {
    width: calc(100% - var(--sidebar-width));
    max-width: none;
    flex: 1 1 auto;
}

/* Remove max-width constraints for full-width layouts */
.mmlms-content-inner {
    max-width: none;
    width: 100%;
}

/* ========================================
   MOBILE STYLES
   ======================================== */
.mmlms-mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mmlms-mobile-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.mmlms-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 1023px) {
    .mmlms-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mmlms-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .mmlms-sidebar.open {
        transform: translateX(0);
    }
    
    .mmlms-mobile-overlay.active {
        display: block;
    }
    
    .mmlms-content-area {
        width: 100%;
        max-width: 100%;
    }
    
    .mmlms-content-inner {
        padding: 80px 20px 20px;
        max-width: none;
    }
    
    .mmlms-view-title {
        font-size: 24px;
    }
}

@media (max-width: 640px) {
    .mmlms-view-title {
        font-size: 22px;
    }
    
    .mmlms-content-inner {
        padding: 70px 16px 16px;
    }
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */
.mmlms-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.mmlms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mmlms-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   BUTTONS
   ======================================== */
.mmlms-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.mmlms-btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.mmlms-btn-primary:hover {
    background: var(--primary-dark);
}

.mmlms-btn-secondary {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.mmlms-btn-secondary:hover {
    background: var(--border-color);
}

.mmlms-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.mmlms-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mmlms-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ========================================
   EMPTY STATES
   ======================================== */
.mmlms-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.mmlms-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mmlms-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mmlms-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========================================
   STATS GRID
   ======================================== */
.mmlms-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.mmlms-stat-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.mmlms-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.mmlms-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .mmlms-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .mmlms-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.mmlms-progress-bar {
    height: 6px;
    background: var(--sidebar-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.mmlms-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mmlms-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   BADGES
   ======================================== */
.mmlms-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.mmlms-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.mmlms-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.mmlms-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ========================================
   TABS
   ======================================== */
.mmlms-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--sidebar-bg);
    border-radius: 8px;
    width: fit-content;
}

.mmlms-tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mmlms-tab-btn:hover {
    color: var(--text-primary);
}

.mmlms-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.mmlms-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.mmlms-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .mmlms-grid-2,
    .mmlms-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.mmlms-text-center {
    text-align: center;
}

.mmlms-mb-0 { margin-bottom: 0; }
.mmlms-mb-1 { margin-bottom: 8px; }
.mmlms-mb-2 { margin-bottom: 16px; }
.mmlms-mb-3 { margin-bottom: 24px; }
.mmlms-mb-4 { margin-bottom: 32px; }

.mmlms-mt-0 { margin-top: 0; }
.mmlms-mt-1 { margin-top: 8px; }
.mmlms-mt-2 { margin-top: 16px; }
.mmlms-mt-3 { margin-top: 24px; }
.mmlms-mt-4 { margin-top: 32px; }


/* ========================================
   MY COURSES PAGE - NEW DESIGN
   ======================================== */

/* Main Course Cards */
.mmlms-courses-main-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.mmlms-course-main-card {
    display: flex;
    justify-content: space-between;
    padding: 28px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mmlms-course-main-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.mmlms-course-main-content {
    flex: 1;
}

.mmlms-course-level-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #eff6ff;
    color: var(--primary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.mmlms-course-main-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mmlms-course-main-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.mmlms-course-main-progress {
    margin-top: auto;
}

.mmlms-progress-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.mmlms-course-main-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-left: 20px;
}

/* Course Modules Section */
.mmlms-modules-section {
    margin-bottom: 40px;
}

.mmlms-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mmlms-section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mmlms-view-all-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.mmlms-view-all-link:hover {
    text-decoration: underline;
}

.mmlms-modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mmlms-module-card {
    display: block;
    padding: 20px;
    background: var(--sidebar-bg);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mmlms-module-card:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mmlms-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mmlms-module-icon {
    width: 36px;
    height: 36px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.mmlms-module-chapters {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.mmlms-module-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.mmlms-module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mmlms-module-progress-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.mmlms-progress-bar-sm {
    flex: 1;
    height: 4px;
    margin: 0;
}

.mmlms-module-progress-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: right;
}

/* Resume Learning Section */
.mmlms-resume-section {
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 28px;
}

.mmlms-resume-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    margin-top: -12px;
}

.mmlms-resume-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mmlms-resume-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 10px;
}

.mmlms-resume-chapter-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mmlms-icon-progress {
    font-size: 20px;
}

.mmlms-icon-locked {
    font-size: 18px;
    opacity: 0.5;
}

.mmlms-resume-info {
    flex: 1;
}

.mmlms-resume-chapter-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mmlms-resume-chapter-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.mmlms-resume-status {
    text-align: center;
    min-width: 80px;
}

.mmlms-status-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mmlms-status-value {
    font-size: 12px;
    font-weight: 600;
}

.mmlms-status-in-progress {
    color: #d97706;
}

.mmlms-status-locked {
    color: var(--text-muted);
}

.mmlms-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mmlms-resume-btn:hover {
    background: var(--primary-dark);
}

.mmlms-resume-btn.mmlms-btn-locked {
    background: var(--sidebar-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.mmlms-resume-btn svg {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 900px) {
    .mmlms-courses-main-grid {
        grid-template-columns: 1fr;
    }
    
    .mmlms-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .mmlms-modules-grid {
        grid-template-columns: 1fr;
    }
    
    .mmlms-resume-item {
        flex-wrap: wrap;
    }
    
    .mmlms-resume-status {
        order: 3;
        min-width: auto;
    }
    
    .mmlms-resume-btn {
        order: 4;
        width: 100%;
        justify-content: center;
    }
}


/* ========================================
   ANALYSIS WIDGETS
   ======================================== */
.mmlms-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.mmlms-analysis-widget {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.mmlms-analysis-widget h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.mmlms-analysis-value {
    font-size: 36px;
    font-weight: 700;
    color: #3b82f6;
    line-height: 1;
}

.mmlms-analysis-value span {
    font-size: 18px;
    font-weight: 500;
    color: #64748b;
    margin-left: 2px;
}

.mmlms-analysis-meta {
    font-size: 13px;
    color: #64748b;
    margin: 8px 0 0;
}

.mmlms-analysis-sub {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}

.mmlms-predictive-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.mmlms-predictive-item:last-child {
    border-bottom: none;
}

.mmlms-predictive-label {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.mmlms-predictive-marks {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.mmlms-predictive-marks small {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.mmlms-predictive-rank {
    font-size: 12px;
    color: #64748b;
}

.mmlms-confidence-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.mmlms-confidence-badge.high {
    background: #d1fae5;
    color: #065f46;
}

.mmlms-confidence-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.mmlms-confidence-badge.low {
    background: #fee2e2;
    color: #991b1b;
}

.mmlms-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mmlms-recommendation-item {
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #94a3b8;
    background: #ffffff;
}

.mmlms-recommendation-item.priority-high {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.mmlms-recommendation-item.priority-medium {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.mmlms-recommendation-item.priority-low {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.mmlms-recommendation-item strong {
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
}

.mmlms-recommendation-item p {
    margin: 0;
    color: #475569;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .mmlms-analysis-grid {
        grid-template-columns: 1fr;
    }
}
