/**
 * ProCourse LMS - Frontend Stylesheet
 * Design: Clean, minimal, professional SaaS-style
 * Font: Poppins 400/500/600
 * Spacing: 8px grid
 * No gradients, no emojis, no decorative icons
 */

/* === Base === */
.lms-courses-grid, .lms-single-course, .lms-dashboard, .lms-lesson-viewer, .lms-auth-form, .lms-my-courses {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === Grid === */
.lms-courses-grid { display: grid; gap: 24px; }
.lms-cols-2 { grid-template-columns: repeat(2, 1fr); }
.lms-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lms-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* === Course Card === */
.lms-course-card {
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.lms-course-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.lms-card-image { aspect-ratio: 16/9; overflow: hidden; background: #f0f0f5; }
.lms-card-image img { width: 100%; height: 100%; object-fit: cover; }
.lms-card-placeholder { background: #e8e8ed; }
.lms-card-body { padding: 16px; }
.lms-card-title { font-size: 16px; font-weight: 600; margin: 8px 0; }
.lms-card-title a { color: #1a1a2e; text-decoration: none; }
.lms-card-title a:hover { color: #2d5be3; }
.lms-card-desc { font-size: 13px; color: #666; margin: 0 0 12px; }
.lms-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid #f0f0f5; }

/* === Badge === */
.lms-badge {
    display: inline-block; font-size: 11px; font-weight: 500;
    padding: 2px 8px; border-radius: 4px; background: #f0f0f5; color: #555; text-transform: uppercase; letter-spacing: 0.5px;
}

/* === Prices === */
.lms-price { font-weight: 600; font-size: 15px; color: #1a1a2e; }
.lms-price-free { font-weight: 600; font-size: 20px; color: #16a34a; }
.lms-price-amount { font-weight: 600; font-size: 24px; }
.lms-price-original { text-decoration: line-through; color: #999; font-size: 14px; margin-left: 8px; }
.lms-meta { font-size: 13px; color: #888; }

/* === Buttons === */
.lms-btn {
    display: inline-block; padding: 10px 24px; font-family: 'Poppins', sans-serif;
    font-size: 14px; font-weight: 500; border-radius: 6px; border: none;
    cursor: pointer; text-decoration: none; text-align: center; transition: all 0.15s ease;
    line-height: 1.4;
}
.lms-btn-primary { background: #1a1a2e; color: #fff; }
.lms-btn-primary:hover { background: #2d2d44; color: #fff; }
.lms-btn-secondary { background: #f0f0f5; color: #1a1a2e; }
.lms-btn-secondary:hover { background: #e0e0e8; }
.lms-btn-full { display: block; width: 100%; }
.lms-btn-sm { padding: 6px 16px; font-size: 13px; }
.lms-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === Forms === */
.lms-auth-form { max-width: 420px; margin: 40px auto; padding: 32px; background: #fff; border: 1px solid #e8e8ed; border-radius: 8px; }
.lms-auth-form h2 { font-size: 22px; font-weight: 600; margin: 0 0 24px; }
.lms-form-group { margin-bottom: 16px; }
.lms-form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: #333; }
.lms-input {
    width: 100%; padding: 10px 12px; font-family: 'Poppins', sans-serif; font-size: 14px;
    border: 1px solid #d0d0d8; border-radius: 6px; background: #fff; color: #1a1a2e;
    transition: border-color 0.15s ease; box-sizing: border-box;
}
.lms-input:focus { outline: none; border-color: #2d5be3; box-shadow: 0 0 0 3px rgba(45,91,227,0.1); }
.lms-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lms-form-messages { margin-bottom: 16px; padding: 10px 12px; border-radius: 6px; font-size: 13px; display: none; }
.lms-form-messages.lms-error { display: block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.lms-form-messages.lms-success { display: block; background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.lms-help-text { font-size: 12px; color: #888; margin: 4px 0 0; }
.lms-auth-link { text-align: center; font-size: 13px; margin-top: 16px; color: #666; }
.lms-auth-link a { color: #2d5be3; text-decoration: none; }
.lms-flex-between { display: flex; justify-content: space-between; align-items: center; }
.lms-checkbox-label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
#lms-forgot-link { font-size: 13px; color: #2d5be3; text-decoration: none; }

/* === Single Course === */
.lms-single-course { max-width: 1080px; margin: 0 auto; }
.lms-course-header { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding: 32px 0; align-items: start; }
.lms-course-title { font-size: 28px; font-weight: 600; margin: 8px 0 12px; }
.lms-course-excerpt { font-size: 15px; color: #555; margin-bottom: 16px; }
.lms-course-meta-row { display: flex; gap: 16px; font-size: 13px; color: #888; }
.lms-course-sidebar-card { background: #fff; border: 1px solid #e8e8ed; border-radius: 8px; overflow: hidden; position: sticky; top: 32px; }
.lms-course-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.lms-sidebar-body { padding: 20px; }
.lms-price-display { margin-bottom: 16px; }
.lms-course-content { padding: 16px 0; }
.lms-section { margin-bottom: 32px; }
.lms-section h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #e8e8ed; }

/* === Progress Bar === */
.lms-progress-bar { height: 6px; background: #e8e8ed; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.lms-progress-fill { height: 100%; background: #2d5be3; border-radius: 3px; transition: width 0.3s ease; }
.lms-progress-text { font-size: 12px; color: #888; }

/* === Curriculum === */
.lms-curriculum-section { margin-bottom: 16px; border: 1px solid #e8e8ed; border-radius: 8px; overflow: hidden; }
.lms-section-title { font-size: 15px; font-weight: 600; padding: 12px 16px; background: #fafafa; margin: 0; }
.lms-lesson-list { list-style: none; margin: 0; padding: 0; }
.lms-lesson-item { padding: 10px 16px; border-top: 1px solid #f0f0f5; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.lms-lesson-item a { color: #2d5be3; text-decoration: none; }
.lms-lesson-item a:hover { text-decoration: underline; }
.lms-duration { font-size: 12px; color: #888; margin-left: auto; }
.lms-preview-badge { font-size: 11px; background: #dbeafe; color: #2563eb; padding: 1px 6px; border-radius: 3px; }

/* === Lesson Viewer === */
.lms-lesson-viewer { display: grid; grid-template-columns: 280px 1fr; min-height: 80vh; }
.lms-lesson-sidebar { background: #fafafa; border-right: 1px solid #e8e8ed; padding: 20px; overflow-y: auto; }
.lms-lesson-sidebar h3 { font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.lms-sidebar-section h4 { font-size: 13px; font-weight: 500; color: #888; margin: 12px 0 4px; }
.lms-sidebar-section ul { list-style: none; padding: 0; margin: 0; }
.lms-sidebar-section li { padding: 6px 8px; font-size: 13px; border-radius: 4px; }
.lms-sidebar-section li.active { background: #e8e8f0; font-weight: 500; }
.lms-sidebar-section li a { color: #333; text-decoration: none; }
.lms-lesson-main { padding: 32px 40px; max-width: 800px; }
.lms-lesson-main h1 { font-size: 24px; font-weight: 600; margin: 0 0 24px; }
.lms-video-wrap { margin-bottom: 24px; border-radius: 8px; overflow: hidden; }
.lms-lesson-content { font-size: 15px; line-height: 1.7; }
.lms-lesson-content img { max-width: 100%; border-radius: 6px; }
.lms-lesson-actions { display: flex; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid #e8e8ed; }
.lms-completed-badge { display: inline-flex; align-items: center; padding: 8px 16px; background: #f0fdf4; color: #16a34a; border-radius: 6px; font-size: 14px; font-weight: 500; }

/* === Dashboard === */
.lms-dashboard { max-width: 960px; margin: 0 auto; padding: 24px 0; }
.lms-dash-header { margin-bottom: 24px; }
.lms-dash-header h1 { font-size: 24px; font-weight: 600; }
.lms-dash-nav { display: flex; gap: 0; border-bottom: 1px solid #e8e8ed; margin-bottom: 24px; }
.lms-tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: #666; text-decoration: none; border-bottom: 2px solid transparent; }
.lms-tab.active { color: #1a1a2e; border-bottom-color: #1a1a2e; }
.lms-tab:hover { color: #1a1a2e; }

/* Stats Grid */
.lms-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.lms-stat-card { padding: 20px; background: #fff; border: 1px solid #e8e8ed; border-radius: 8px; text-align: center; }
.lms-stat-value { font-size: 28px; font-weight: 600; color: #1a1a2e; }
.lms-stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* Enrolled Card */
.lms-enrolled-card { padding: 16px; border: 1px solid #e8e8ed; border-radius: 8px; margin-bottom: 12px; }
.lms-enrolled-card h3 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.lms-enrolled-card h3 a { color: #1a1a2e; text-decoration: none; }

/* Certificate Card */
.lms-cert-card { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid #e8e8ed; border-radius: 8px; margin-bottom: 8px; }
.lms-cert-card strong { flex: 1; }
.lms-cert-card span { font-size: 12px; color: #888; }

/* Activity */
.lms-activity-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f5; font-size: 14px; }
.lms-activity-date { font-size: 12px; color: #888; }

/* Instructor Dashboard */
.lms-instructor-course-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid #e8e8ed; border-radius: 8px; margin-bottom: 8px; }
.lms-instructor-course-row h3 { flex: 1; font-size: 15px; font-weight: 500; margin: 0; }

/* Avatar */
.lms-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.lms-instructor-card-inline { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.lms-role { display: block; font-size: 12px; color: #888; }

/* Login prompt */
.lms-login-prompt { text-align: center; padding: 40px; }

/* Pagination */
.lms-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 32px; }
.lms-page-link { padding: 8px 14px; border: 1px solid #e8e8ed; border-radius: 6px; font-size: 14px; color: #333; text-decoration: none; }
.lms-page-link.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* Empty state */
.lms-empty { text-align: center; padding: 40px; color: #888; }

/* === Responsive === */
@media (max-width: 1024px) {
    .lms-course-header { grid-template-columns: 1fr; }
    .lms-course-sidebar-card { position: static; }
    .lms-lesson-viewer { grid-template-columns: 1fr; }
    .lms-lesson-sidebar { display: none; }
    .lms-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .lms-courses-grid { grid-template-columns: 1fr !important; }
    .lms-form-row { grid-template-columns: 1fr; }
    .lms-lesson-main { padding: 20px; }
    .lms-stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .lms-auth-form { margin: 16px; padding: 20px; }
    .lms-stats-grid { grid-template-columns: 1fr; }
    .lms-dash-nav { overflow-x: auto; }
}

/* === Archive Filters === */
.lms-archive-filters { margin-bottom: 24px; }
.lms-filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.lms-filter-search { flex: 1; min-width: 200px; }
.lms-filter-select { width: auto; min-width: 140px; }
.lms-results-count { font-size: 13px; color: #888; margin-bottom: 16px; }
.lms-filter-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.lms-tag {
    display: inline-block; padding: 4px 12px; font-size: 12px; font-weight: 500;
    background: #f0f0f5; color: #555; border-radius: 20px; text-decoration: none;
    transition: all 0.15s;
}
.lms-tag:hover { background: #e0e0e8; color: #333; }
.lms-tag.active { background: #1a1a2e; color: #fff; }

/* === Card Badges === */
.lms-card-badges { display: flex; gap: 6px; margin-bottom: 6px; }
.lms-badge-bundle { background: #dbeafe; color: #2563eb; }
.lms-badge-soon { background: #fef3c7; color: #d97706; }

/* === FAQs === */
.lms-faqs { margin-top: 24px; }
.lms-faq-item { border: 1px solid #e8e8ed; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.lms-faq-question {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
    background: #fafafa; transition: background 0.15s;
}
.lms-faq-question:hover { background: #f0f0f5; }
.lms-faq-toggle { font-size: 18px; color: #888; transition: transform 0.2s; }
.lms-faq-item.open .lms-faq-toggle { transform: rotate(45deg); }
.lms-faq-answer { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; font-size: 14px; color: #555; line-height: 1.6; }
.lms-faq-item.open .lms-faq-answer { max-height: 500px; padding: 12px 16px; }

/* === Badges Display === */
.lms-badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.lms-badge-card {
    text-align: center; padding: 16px 12px; background: #fff;
    border: 1px solid #e8e8ed; border-radius: 8px;
}
.lms-badge-card img { width: 48px; height: 48px; border-radius: 50%; margin-bottom: 8px; object-fit: cover; }
.lms-badge-card .lms-badge-icon { width: 48px; height: 48px; border-radius: 50%; background: #f0f0f5; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; color: #1a1a2e; }
.lms-badge-card h4 { font-size: 13px; font-weight: 500; margin: 0 0 2px; }
.lms-badge-card p { font-size: 11px; color: #888; margin: 0; }

/* === Distraction-Free Learning === */
.lms-distraction-free { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 999999; background: #fff; overflow-y: auto; }
.lms-distraction-free .lms-df-header {
    position: sticky; top: 0; background: #fff; border-bottom: 1px solid #e8e8ed;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; z-index: 10;
}
.lms-distraction-free .lms-df-header h2 { font-size: 16px; font-weight: 500; margin: 0; }
.lms-distraction-free .lms-df-close {
    padding: 6px 16px; font-size: 13px; background: #f0f0f5;
    border: none; border-radius: 6px; cursor: pointer;
}
.lms-distraction-free .lms-df-body { max-width: 800px; margin: 0 auto; padding: 32px 24px; }

/* === Live Stream Badge === */
.lms-live-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; background: #fef2f2; color: #dc2626;
    font-size: 11px; font-weight: 500; border-radius: 4px;
}
.lms-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #dc2626; animation: lms-pulse 1.5s infinite; }
@keyframes lms-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* === Bundle Course List === */
.lms-bundle-list { margin-top: 16px; }
.lms-bundle-course-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border: 1px solid #e8e8ed; border-radius: 8px;
    margin-bottom: 8px; transition: background 0.15s;
}
.lms-bundle-course-item:hover { background: #fafafa; }
.lms-bundle-course-item h4 { flex: 1; font-size: 14px; font-weight: 500; margin: 0; }
.lms-bundle-course-item h4 a { color: #1a1a2e; text-decoration: none; }
.lms-bundle-course-item .lms-badge { flex-shrink: 0; }

/* === SCORM Container === */
.lms-scorm-wrapper { width: 100%; border: 1px solid #e8e8ed; border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.lms-scorm-wrapper iframe { width: 100%; height: 600px; border: 0; }

/* === Course End Screen === */
.lms-course-end {
    text-align: center; padding: 48px 24px;
    background: #fff; border: 1px solid #e8e8ed; border-radius: 8px; margin-top: 24px;
}
.lms-course-end h2 { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.lms-course-end p { font-size: 15px; color: #555; margin-bottom: 24px; }

/* === Responsive Additions === */
@media (max-width: 768px) {
    .lms-filter-row { flex-direction: column; }
    .lms-filter-search { width: 100%; }
    .lms-filter-select { width: 100%; }
    .lms-badges-grid { grid-template-columns: repeat(2, 1fr); }
}

