/* 5MinuteAI LMS - Frontend Styles */
:root {
  --fmai-primary:   #7c3aed;
  --fmai-primary-d: #6d28d9;
  --fmai-accent:    #f59e0b;
  --fmai-success:   #10b981;
  --fmai-danger:    #ef4444;
  --fmai-bg:        #0f0f1a;
  --fmai-bg2:       #1a1a2e;
  --fmai-bg3:       #16213e;
  --fmai-text:      #e2e8f0;
  --fmai-text2:     #94a3b8;
  --fmai-border:    rgba(255,255,255,0.08);
  --fmai-radius:    10px;
  --fmai-shadow:    0 4px 24px rgba(0,0,0,0.4);
}

/* ===== LAYOUT ===== */
.fmai-player-wrap {
  background: var(--fmai-bg);
  color: var(--fmai-text);
  border-radius: var(--fmai-radius);
  overflow: hidden;
  margin-bottom: 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fmai-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--fmai-bg2);
  border-bottom: 1px solid var(--fmai-border);
}
.fmai-course-link { color: var(--fmai-text2); text-decoration: none; font-size: 13px; flex-shrink:0; }
.fmai-course-link:hover { color: var(--fmai-primary); }
.fmai-video-title-top { flex:1; font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fmai-top-actions { display:flex; gap:8px; }

/* ===== COURSE PROGRESS BAR ===== */
.fmai-course-progress-bar {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.1);
  overflow: visible;
}
.fmai-course-progress-bar .fmai-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fmai-primary), var(--fmai-accent));
  transition: width 0.6s ease;
}
.fmai-course-progress-bar .fmai-progress-label {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: var(--fmai-text2);
  white-space: nowrap;
}

/* ===== MAIN LAYOUT ===== */
.fmai-main-layout {
  display: flex;
  min-height: 500px;
}

/* ===== SIDEBAR ===== */
.fmai-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--fmai-bg2);
  border-right: 1px solid var(--fmai-border);
  overflow-y: auto;
  max-height: 80vh;
}
.fmai-sidebar h3 {
  padding: 16px 16px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fmai-text2);
  margin: 0;
}
.fmai-lesson-list { list-style: none; margin:0; padding:0; }
.fmai-lesson-item {
  border-bottom: 1px solid var(--fmai-border);
  transition: background 0.15s;
}
.fmai-lesson-item:hover { background: rgba(255,255,255,0.03); }
.fmai-lesson-item.current { background: rgba(124,58,237,0.12); border-left: 3px solid var(--fmai-primary); }
.fmai-lesson-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--fmai-text);
  font-size: 13px;
}
.fmai-lesson-item.fmai-status-done .fmai-lesson-link { color: var(--fmai-text2); }
.fmai-lesson-item.locked .fmai-lesson-locked { display:flex; align-items:center; gap:8px; padding:10px 14px; color:var(--fmai-text2); font-size:13px; opacity:0.5; }
.fmai-lesson-num { color: var(--fmai-text2); font-size: 11px; flex-shrink:0; }
.fmai-lesson-name { flex:1; }
.fmai-lesson-status-dot { font-size: 14px; flex-shrink:0; }
.fmai-sidebar-thumb { width:40px; height:24px; object-fit:cover; border-radius:3px; flex-shrink:0; }

/* ===== CONTENT AREA ===== */
.fmai-content-area { flex:1; min-width:0; display:flex; flex-direction:column; }

/* ===== VIDEO ===== */
.fmai-video-container { position:relative; background:#000; }
.fmai-vimeo-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.fmai-vimeo-wrapper iframe {
  position:absolute; top:0; left:0; width:100%; height:100%;
}
.fmai-no-video { padding:60px; text-align:center; color:var(--fmai-text2); }

/* Resume overlay */
.fmai-resume-overlay {
  position:absolute; inset:0; z-index:10;
  background:rgba(0,0,0,0.75);
  display:flex; align-items:center; justify-content:center;
}
.fmai-resume-box {
  background:var(--fmai-bg2);
  border:1px solid var(--fmai-border);
  border-radius:12px;
  padding:30px 40px;
  text-align:center;
  color:var(--fmai-text);
}
.fmai-resume-box p { margin:0 0 16px; font-size:16px; }

/* ===== VIDEO CONTROLS ===== */
.fmai-video-controls {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 16px;
  background:var(--fmai-bg3);
  border-bottom:1px solid var(--fmai-border);
  gap:12px;
}
.fmai-video-progress-wrap { display:flex; align-items:center; gap:10px; flex:1; }
.fmai-watch-bar {
  flex:1; height:6px; background:rgba(255,255,255,0.1);
  border-radius:3px; overflow:hidden;
}
.fmai-watch-bar #fmai-watch-fill {
  height:100%; background: linear-gradient(90deg,var(--fmai-primary),var(--fmai-accent));
  transition:width 1s ease;
}
#fmai-watch-pct { font-size:12px; color:var(--fmai-text2); white-space:nowrap; }
.fmai-ctrl-btns { display:flex; gap:8px; align-items:center; }

/* ===== BUTTONS ===== */
.fmai-btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 18px; border-radius:6px; font-size:14px; font-weight:600;
  cursor:pointer; border:none; text-decoration:none;
  transition:all 0.2s; white-space:nowrap;
}
.fmai-btn-primary { background:var(--fmai-primary); color:#fff; }
.fmai-btn-primary:hover { background:var(--fmai-primary-d); color:#fff; }
.fmai-btn-secondary { background:rgba(124,58,237,0.2); color:var(--fmai-primary); border:1px solid var(--fmai-primary); }
.fmai-btn-ghost { background:transparent; color:var(--fmai-text2); border:1px solid var(--fmai-border); }
.fmai-btn-ghost:hover { background:rgba(255,255,255,0.05); color:var(--fmai-text); }
.fmai-btn-pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(124,58,237,0.5)} 50%{box-shadow:0 0 0 8px rgba(124,58,237,0)} }

.fmai-icon-btn {
  width:36px; height:36px; border-radius:50%; background:transparent;
  border:1px solid var(--fmai-border); color:var(--fmai-text2);
  cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center;
  transition:all 0.2s;
}
.fmai-icon-btn:hover, .fmai-icon-btn.active { color:var(--fmai-accent); border-color:var(--fmai-accent); }

/* ===== TABS ===== */
.fmai-tabs-wrap { flex:1; display:flex; flex-direction:column; background:var(--fmai-bg); }
.fmai-tabs {
  display:flex; gap:0; border-bottom:1px solid var(--fmai-border);
  background:var(--fmai-bg2);
}
.fmai-tab {
  padding:12px 20px; background:transparent; border:none; border-bottom:2px solid transparent;
  color:var(--fmai-text2); cursor:pointer; font-size:14px; font-weight:500;
  transition:all 0.15s; position:relative;
}
.fmai-tab:hover { color:var(--fmai-text); }
.fmai-tab.active { color:var(--fmai-primary); border-bottom-color:var(--fmai-primary); }
.fmai-tab-badge {
  position:absolute; top:6px; right:6px;
  width:8px; height:8px; border-radius:50%;
  font-size:0;
}
.fmai-tab-badge.green { background:var(--fmai-success); }

.fmai-tab-content { display:none; padding:20px; flex:1; }
.fmai-tab-content.active { display:block; }

/* ===== NOTES ===== */
.fmai-notes-area { display:flex; flex-direction:column; gap:10px; }
#fmai-note-textarea {
  width:100%; padding:14px; background:var(--fmai-bg2);
  border:1px solid var(--fmai-border); border-radius:8px;
  color:var(--fmai-text); font-size:14px; line-height:1.6;
  resize:vertical; font-family:inherit;
}
#fmai-note-textarea:focus { outline:none; border-color:var(--fmai-primary); }
.fmai-notes-footer { display:flex; justify-content:space-between; align-items:center; }
.fmai-note-status { font-size:13px; color:var(--fmai-text2); }

/* ===== QUIZ ===== */
.fmai-quiz-intro { color:var(--fmai-text2); font-size:14px; margin-bottom:16px; }
.fmai-quiz-question { margin-bottom:24px; }
.fmai-q-label { font-size:15px; font-weight:600; margin-bottom:10px; line-height:1.5; }
.fmai-q-options { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.fmai-q-option {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; background:var(--fmai-bg2);
  border:1px solid var(--fmai-border); border-radius:8px;
  cursor:pointer; font-size:14px; transition:all 0.15s;
}
.fmai-q-option:hover { border-color:var(--fmai-primary); background:rgba(124,58,237,0.08); }
.fmai-q-option input[type=radio] { accent-color:var(--fmai-primary); }

/* Quiz results */
.fmai-quiz-result-header {
  display:flex; align-items:center; gap:20px;
  padding:20px; border-radius:10px; margin-bottom:20px;
}
.fmai-quiz-result-header.passed { background:rgba(16,185,129,0.12); border:1px solid rgba(16,185,129,0.3); }
.fmai-quiz-result-header.failed { background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.3); }
.fmai-result-score { font-size:48px; font-weight:800; }
.fmai-result-pct { font-size:24px; font-weight:700; }
.fmai-result-status { font-size:18px; }

.fmai-review-item { padding:14px; border-radius:8px; margin-bottom:12px; }
.fmai-review-item.correct { background:rgba(16,185,129,0.08); }
.fmai-review-item.wrong { background:rgba(239,68,68,0.08); }
.fmai-review-item p { margin-bottom:8px; font-size:14px; font-weight:600; }
.fmai-review-item ul { list-style:none; padding:0; display:flex; flex-direction:column; gap:4px; }
.fmai-review-item li { font-size:13px; padding:4px 8px; border-radius:4px; }
.fmai-correct-ans { background:rgba(16,185,129,0.15); color:#10b981; }
.fmai-wrong-ans   { background:rgba(239,68,68,0.15);  color:#ef4444; }
.fmai-explanation { margin-top:8px; padding:8px 12px; background:rgba(245,158,11,0.1); border-radius:6px; font-size:13px; color:var(--fmai-accent); }

.fmai-quiz-best-result { padding:16px; border-radius:8px; margin-bottom:16px; }
.fmai-quiz-best-result.passed { background:rgba(16,185,129,0.1); }
.fmai-quiz-best-result.failed { background:rgba(239,68,68,0.1); }

/* ===== ACCESS DENIED ===== */
.fmai-access-denied, .fmai-locked-course {
  text-align:center; padding:60px 20px;
  background:var(--fmai-bg2); border-radius:12px;
  color:var(--fmai-text); margin:20px 0;
}
.fmai-locked-icon { font-size:60px; margin-bottom:16px; }

/* ===== COURSES GRID ===== */
.fmai-courses-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:24px; padding:20px 0;
}
.fmai-course-card {
  background:#fff; border-radius:12px; overflow:hidden;
  box-shadow:0 2px 12px rgba(0,0,0,0.08); transition:transform 0.2s,box-shadow 0.2s;
}
.fmai-course-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,0.12); }
.fmai-course-thumb { position:relative; padding-bottom:56.25%; overflow:hidden; }
.fmai-course-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.fmai-lock-badge { position:absolute; top:10px; right:10px; background:rgba(0,0,0,0.7); color:#fff; font-size:18px; width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.fmai-course-card-body { padding:16px; }
.fmai-course-card-title { font-size:17px; font-weight:700; margin:0 0 8px; }
.fmai-course-card-title a { text-decoration:none; color:inherit; }
.fmai-course-card-excerpt { font-size:13px; color:#666; margin:0 0 10px; line-height:1.5; }
.fmai-course-card-meta { display:flex; justify-content:space-between; align-items:center; font-size:12px; color:#999; margin-bottom:10px; }
.fmai-enrolled-badge { background:#d1fae5; color:#065f46; padding:2px 8px; border-radius:20px; font-size:11px; font-weight:600; }
.fmai-mini-progress { height:4px; background:#e5e7eb; border-radius:2px; overflow:hidden; margin-bottom:4px; }
.fmai-mini-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#f59e0b); }
.fmai-card-cta { width:100%; justify-content:center; margin-top:12px; }

/* ===== SINGLE COURSE ===== */
.fmai-course-single { max-width:900px; margin:0 auto; }
.fmai-course-hero { height:220px; background-size:cover; background-position:center; position:relative; border-radius:12px 12px 0 0; }
.fmai-course-hero-overlay { position:absolute; inset:0; background:linear-gradient(transparent,rgba(0,0,0,0.6)); border-radius:inherit; }
.fmai-course-header-body { padding:24px; }
.fmai-course-header-body h1 { font-size:28px; margin:0 0 8px; }
.fmai-course-tagline { color:#666; margin:0 0 12px; }
.fmai-course-meta { display:flex; gap:16px; font-size:14px; color:#666; }
.fmai-course-progress-strip { position:relative; height:8px; background:#e5e7eb; }
.fmai-course-progress-strip .fmai-progress-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#f59e0b); transition:width 0.6s; }
.fmai-cert-banner { background:#d1fae5; border:1px solid #6ee7b7; padding:16px 24px; display:flex; align-items:center; justify-content:space-between; border-radius:8px; margin:16px; font-weight:600; color:#065f46; }
.fmai-lesson-grid { padding:0 0 40px; }
.fmai-lesson-grid h2 { font-size:20px; margin:24px 0 16px; }
.fmai-lesson-row {
  display:flex; align-items:center; gap:14px;
  padding:12px 16px; border:1px solid #e5e7eb;
  border-radius:10px; margin-bottom:10px; background:#fff;
  transition:border-color 0.15s,box-shadow 0.15s;
}
.fmai-lesson-row:hover { border-color:#7c3aed; box-shadow:0 2px 8px rgba(124,58,237,0.1); }
.fmai-lesson-row.fmai-status-done { opacity:0.75; }
.fmai-lesson-row.locked { opacity:0.55; background:#f9f9f9; }
.fmai-lesson-row-thumb { position:relative; width:90px; height:52px; flex-shrink:0; }
.fmai-lesson-row-thumb img { width:100%; height:100%; object-fit:cover; border-radius:6px; }
.fmai-done-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; font-size:22px; border-radius:6px; }
.fmai-lesson-row-body { flex:1; min-width:0; }
.fmai-lesson-row-title { font-size:15px; font-weight:600; margin-bottom:4px; }
.fmai-lesson-row-title a { text-decoration:none; color:inherit; }
.fmai-lesson-row-meta { display:flex; gap:10px; font-size:12px; color:#666; flex-wrap:wrap; }
.fmai-free-badge { background:#fef3c7; color:#92400e; padding:1px 6px; border-radius:10px; font-size:11px; font-weight:700; }
.fmai-quiz-pass { background:#d1fae5; color:#065f46; padding:1px 6px; border-radius:10px; font-size:11px; }
.fmai-lesson-row-cta { flex-shrink:0; }
.fmai-enroll-cta { text-align:center; padding:40px; background:#f5f3ff; border-radius:12px; margin-top:20px; }
.fmai-enroll-cta h3 { margin:0 0 16px; }

/* ===== DASHBOARD ===== */
.fmai-dashboard-header { margin-bottom:24px; }
.fmai-dashboard-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:20px; }
.fmai-dash-course-card { background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 2px 12px rgba(0,0,0,0.08); }
.fmai-dash-thumb { height:140px; background-size:cover; background-position:center; }
.fmai-dash-body { padding:16px; }
.fmai-dash-body h3 { font-size:16px; margin:0 0 12px; }
.fmai-dash-body h3 a { text-decoration:none; color:inherit; }
.fmai-dash-progress { margin-bottom:12px; }
.fmai-progress-bar-track { height:6px; background:#e5e7eb; border-radius:3px; overflow:hidden; margin-bottom:4px; }
.fmai-progress-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#f59e0b); transition:width 0.6s; }
.fmai-cert-link { display:block; font-size:13px; color:#7c3aed; text-decoration:none; margin-bottom:10px; }
.fmai-dash-cta { width:100%; justify-content:center; margin-top:8px; }
.fmai-empty-state { text-align:center; padding:60px; color:#666; }

/* ===== BOOKMARKS ===== */
.fmai-bookmarks h2 { margin-bottom:20px; }
.fmai-bookmarks-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; }
.fmai-bookmark-card { background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,0.07); }
.fmai-bookmark-card img { width:100%; height:120px; object-fit:cover; display:block; }
.fmai-bookmark-body { padding:12px; }
.fmai-bookmark-course { font-size:11px; color:#999; text-transform:uppercase; letter-spacing:0.5px; }
.fmai-bookmark-body h4 { font-size:14px; margin:4px 0 8px; }
.fmai-bookmark-body h4 a { text-decoration:none; color:inherit; }
.fmai-bookmark-meta { display:flex; gap:8px; font-size:12px; color:#666; margin-bottom:10px; }

/* ===== ABOUT TAB ===== */
.fmai-about-content { font-size:14px; line-height:1.7; color:var(--fmai-text); }
.fmai-about-content p { margin-bottom:10px; }
.fmai-cert-ready { padding:16px; background:rgba(16,185,129,0.1); border-radius:8px; display:flex; align-items:center; justify-content:space-between; margin-top:20px; }

/* ===== RESPONSIVE ===== */
@media (max-width:768px) {
  .fmai-main-layout { flex-direction:column; }
  .fmai-sidebar { width:100%; max-height:200px; }
  .fmai-video-controls { flex-wrap:wrap; }
  .fmai-top-bar { flex-wrap:wrap; }
  .fmai-lesson-row-cta { display:none; }
  .fmai-courses-grid, .fmai-dashboard-grid { grid-template-columns:1fr; }
}

/* ===== LOCKED VIDEO OVERLAY ===== */
.fmai-locked-overlay {
  position:absolute; inset:0; z-index:10;
  background:rgba(0,0,0,0.85);
  display:flex; align-items:center; justify-content:center;
}
.fmai-locked-msg {
  text-align:center; color:#fff; padding:40px;
}
.fmai-locked-msg p { color:rgba(255,255,255,0.7); margin:8px 0 20px; }

/* ===== MARK COMPLETE BUTTON ===== */
.fmai-completed-badge {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 14px; background:rgba(16,185,129,0.15);
  color:var(--fmai-success); border-radius:6px; font-size:14px; font-weight:600;
}

/* ===== STUDENT STATS TABLE ===== */
.fmai-stats-wrap { overflow-x:auto; }
.fmai-stats-table {
  width:100%; border-collapse:collapse; font-size:14px;
}
.fmai-stats-table th {
  padding:10px 14px; background:#f8fafc; border-bottom:2px solid #e5e7eb;
  text-align:left; font-weight:600; color:#374151;
}
.fmai-stats-table td {
  padding:10px 14px; border-bottom:1px solid #f1f5f9; vertical-align:middle;
}
.fmai-stats-table tr:hover td { background:#fafafa; }
.fmai-stat-bar {
  display:inline-block; width:80px; height:6px;
  background:#e5e7eb; border-radius:3px; overflow:hidden;
  vertical-align:middle; margin-right:6px;
}
.fmai-stat-bar > div { height:100%; background:linear-gradient(90deg,#7c3aed,#f59e0b); }
.fmai-badge-status {
  padding:2px 8px; border-radius:10px; font-size:12px; font-weight:600;
}
.fmai-badge-status.done    { background:#d1fae5; color:#065f46; }
.fmai-badge-status.started { background:#fef3c7; color:#92400e; }
.fmai-badge-status.new     { background:#f1f5f9; color:#475569; }

/* ===== TABBED STUDENT DASHBOARD ===== */
.fmai-dash-tabbed { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
.fmai-dash-tab-nav {
  display:flex; gap:0; border-bottom:2px solid #e5e7eb; margin-bottom:24px;
  flex-wrap:wrap;
}
.fmai-dash-tab-link {
  padding:10px 20px; text-decoration:none; color:#6b7280;
  border-bottom:2px solid transparent; margin-bottom:-2px;
  font-size:14px; font-weight:500; transition:all 0.15s;
}
.fmai-dash-tab-link:hover { color:#7c3aed; }
.fmai-dash-tab-link.active { color:#7c3aed; border-bottom-color:#7c3aed; }
.fmai-dash-tab-body { min-height:200px; }

/* Progress indicator dots in sidebar use CSS vars from settings */
.fmai-lesson-item.fmai-status-new    .fmai-lesson-status-dot { color: var(--fmai-status-new, #ccc); }
.fmai-lesson-item.fmai-status-started .fmai-lesson-status-dot { color: var(--fmai-status-started, #f59e0b); }
.fmai-lesson-item.fmai-status-done   .fmai-lesson-status-dot { color: var(--fmai-status-done, #10b981); }
