/* ============================================================
   AI for Teachers — LMS styles
   Clean light theme, teal accent. Mobile responsive.
   ============================================================ */
:root {
  --accent: #0d9488;
  --accent-dark: #0b7c72;
  --accent-soft: #e6f7f4;
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error-text { color: var(--danger-dark); }

.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px; }

/* ---------- config warning banner ---------- */
.config-warning {
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  padding: 12px 16px;
  text-align: center;
  font-size: 14.5px;
}

/* ---------- header / nav ---------- */
.site-header {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  position: sticky;
  top: 0;
  z-index: 50;
}
#nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-badge {
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px;
  border-radius: 8px; padding: 5px 10px;
}
.brand-text { font-weight: 700; font-size: 18px; }
.brand-text-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.brand-tagline { font-size: 11.5px; color: var(--muted, #6b7280); font-weight: 500; letter-spacing: 0.4px; }
.brand-logo { height: 38px; width: 38px; object-fit: cover; border-radius: 8px; }
.login-logo { height: 72px; width: 72px; object-fit: cover; border-radius: 16px; }
.login-card .tagline { text-align: center; color: var(--muted); font-size: 14px; margin: -6px 0 14px; letter-spacing: 0.4px; }
/* ---------- Contact card ---------- */
.contact-card { display: flex; gap: 18px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.contact-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid var(--accent); }
.contact-info h4 { margin: 0 0 4px; font-size: 18px; }
.contact-info .muted { margin: 0 0 10px; }
.contact-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1eb856; }
.btn-youtube { background: #ff0000; color: #fff; }
.btn-youtube:hover { background: #d90000; }
.wa-icon { display: inline-block; transform: rotate(90deg); margin-right: 2px; }
/* ---------- Assignment / lists ---------- */
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.check-item input { width: 17px; height: 17px; accent-color: var(--accent); }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.assign-row td { background: #f8fafc; }
/* ---------- Team ---------- */
.team-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.team-card { width: 130px; text-align: center; }
.team-card img { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid var(--accent); display: block; margin: 0 auto 6px; }
.team-card b { display: block; font-size: 14px; }
/* ---------- Progress ---------- */
.progress-wrap { background: #e2e8f0; border-radius: 999px; height: 8px; overflow: hidden; margin-top: 8px; }
.progress-wrap.small { height: 6px; margin: 8px 0 2px; }
.progress-bar { background: var(--accent); height: 100%; width: 0; border-radius: 999px; transition: width .4s ease; }
.lesson-row .done-ico {
  flex: 0 0 auto; width: 20px; height: 20px; border: 2px solid #cbd5e1; border-radius: 50%;
  margin-right: 8px; cursor: pointer; background: #fff;
}
.lesson-row.done .done-ico { background: var(--accent); border-color: var(--accent); position: relative; }
.lesson-row.done .done-ico::after {
  content: "✓"; color: #fff; font-size: 13px; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -52%);
}
.lesson-row.done .play-ico + span, .lesson-row.done > span:last-child { color: var(--muted); }
/* ---------- Certificate banner ---------- */
.cert-banner {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: #fffbeb; border: 1px solid #fde68a; font-size: 15px;
}
.cert-banner .btn { margin-left: 8px; }
/* ---------- Comments ---------- */
.comments-wrap { margin-top: 26px; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.comment.reply { margin-left: 28px; background: #f8fafc; }
.comment-head { font-size: 14px; margin-bottom: 4px; }
.comment-text { margin: 0 0 6px; font-size: 15px; }
.comment-actions { display: flex; gap: 12px; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 13.5px; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-btn.del-btn { color: var(--danger); }
.admin-badge { background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
/* ---------- Announcements ---------- */
.announce-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; font-size: 15px;
}
.announce-ico { font-size: 18px; }
/* ---------- Certificate page ---------- */
.certificate { max-width: 820px; margin: 10px auto; background: #fff; padding: 14px; border: 3px solid #b45309; border-radius: 6px; }
.cert-inner { border: 2px solid #d97706; border-radius: 4px; padding: 40px 30px; text-align: center; background: #fffdf7; }
.cert-logo { height: 64px; width: 64px; object-fit: cover; border-radius: 12px; }
.cert-org { margin: 10px 0 2px; font-size: 22px; }
.cert-sub { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.cert-title { font-size: 34px; color: #92400e; margin: 14px 0; font-family: Georgia, serif; }
.cert-present { color: var(--muted); margin: 6px 0; }
.cert-name { font-size: 30px; font-weight: 800; margin: 4px 0; font-family: Georgia, serif; border-bottom: 2px solid #e5e7eb; display: inline-block; padding: 0 30px 6px; }
.cert-course { font-size: 20px; font-weight: 700; margin: 4px 0 20px; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26px; gap: 12px; flex-wrap: wrap; }
.cert-sign { border-top: 2px solid #e5e7eb; padding-top: 6px; }
@media print {
  .no-print, .site-header, .footer { display: none !important; }
  main.container { max-width: 100%; padding: 0; }
  .certificate { margin: 0; max-width: 100%; }
  body { background: #fff; }
}
/* ---------- Questions ---------- */
.q-card { margin-bottom: 12px; }
.q-text { font-size: 16px; margin: 0 0 8px; }
.q-answer { margin: 0; background: #f0fdf4; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 6px 6px 0; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 12px; border-radius: 6px; color: #334155;
  text-decoration: none; font-size: 15px; white-space: nowrap;
}
.nav-links a:hover { background: #f1f5f9; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-user { font-size: 14px; color: var(--muted); margin: 0 8px; white-space: nowrap; }
.nav-toggle {
  display: none; margin-left: auto; background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 11px; font-size: 18px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 11px 22px; font-size: 15px; cursor: pointer;
  text-decoration: none; font-weight: 600; text-align: center;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); }
.btn-ghost { background: #eef2f7; color: #334155; }
.btn-ghost:hover { background: #e2e8f0; color: #334155; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 15px; background: #fff; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent); border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.login-card {
  background: #fff; border-radius: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
  padding: 32px; width: 100%; max-width: 400px; text-align: center;
}
.login-card h1 { margin: 10px 0 4px; }
.login-card form { text-align: left; margin-top: 18px; }
.login-brand .brand-badge { font-size: 20px; padding: 8px 14px; }
.error {
  color: var(--danger-dark); background: #fef2f2; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px;
  display: none; text-align: left;
}

/* ---------- dashboard cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 16px; }
.course-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow);
}
.course-card-body { padding: 20px; }
.course-card-body h3 { margin: 0 0 8px; font-size: 19px; }
.course-card .meta { font-size: 13.5px; color: var(--muted); margin: 10px 0 14px; }

/* ---------- course page (video + playlist) ---------- */
.course-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.player {
  position: relative; padding-top: 56.25%; background: #000;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.player iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.playlist { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.playlist-head { padding: 16px; border-bottom: 1px solid var(--line); }
.playlist-head h3 { margin: 0; }
.playlist-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.module { border-bottom: 1px solid var(--line); }
.module:last-child { border-bottom: none; }
.module-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 14px 16px; background: none; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; color: var(--text);
  font-family: inherit;
}
.module-head:hover { background: #f8fafc; }
.module-head .chev { transition: transform .2s; color: var(--muted); }
.module.open .module-head .chev { transform: rotate(180deg); }
.module-lessons { display: none; }
.module.open .module-lessons { display: block; }
.lesson-row {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 11px 16px 11px 20px; border: none; border-top: 1px solid #f1f5f9;
  background: none; cursor: pointer; font-size: 14.5px; color: #334155; font-family: inherit;
}
.lesson-row:hover { background: #f8fafc; }
.lesson-row.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.play-ico { font-size: 11px; color: var(--muted); }
.lesson-row.active .play-ico { color: var(--accent-dark); }

/* ---------- notes ---------- */
.notes-list { margin-top: 16px; }
.note-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
}
.note-title { font-weight: 600; }

/* ---------- quiz ---------- */
.quiz-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.q-text { font-weight: 600; font-size: 16.5px; margin: 12px 0; }
.opt {
  display: block; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; margin: 8px 0; cursor: pointer; font-size: 15px;
}
.opt:hover { background: #f8fafc; }
.opt input { margin-right: 10px; }
.opt.correct { border-color: #16a34a; background: #f0fdf4; }
.opt.wrong { border-color: var(--danger); background: #fef2f2; }
.score {
  background: var(--accent-soft); border: 1px solid #99e5da; color: #0b5f57;
  padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 17px;
}

/* ---------- admin ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tab-btn {
  padding: 10px 16px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 14.5px; font-family: inherit;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.panel.danger { border-color: #fca5a5; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.module-item, .lesson-item, .draft-q {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
}
.module-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.module-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.radio-row input[type="text"] { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14.5px; }

/* ---------- footer ---------- */
.footer { margin-top: 48px; padding: 28px 0; border-top: 1px solid var(--line); background: #fff; }
.footer h3 { margin: 0 0 6px; }
.footer p { margin: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 8px;
  z-index: 200; display: none; font-size: 14.5px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .course-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #nav { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-basis: 100%; flex-direction: column;
    align-items: stretch; padding: 6px 0;
  }
  #nav.open .nav-links { display: flex; }
  .nav-links a { padding: 11px 4px; border-top: 1px solid #f1f5f9; }
  .nav-user { padding: 8px 4px; }
  h1 { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .lesson-nav .btn { padding: 10px 14px; font-size: 14px; }
  .note-row { flex-direction: column; align-items: stretch; text-align: center; }
}
