/* =====================================================================
   ML Academy — Design layer khớp với bản thiết kế HTML mẫu 5.0.12
   ===================================================================== */

/* Hero */
.ml-hero {
  padding: 30px;
  border-radius: 20px;
  background: linear-gradient(125deg, #3B2A9E 0%, #5B3FD6 45%, #7B62E0 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}
.ml-hero h1 { font-size: clamp(22px, 3.5vw, 34px); margin: 8px 0; color: #fff; }
.ml-hero p  { color: #EDE9FF; max-width: 55ch; line-height: 1.65; }
.ml-kicker  { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #C4B9FF; margin-bottom: 4px; }
.ml-stat-box { background: #ffffff15; border: 1px solid #ffffff28; padding: 20px; border-radius: 16px; }
.ml-stat-box strong { font-size: 36px; font-weight: 800; display: block; line-height: 1.1; }
.ml-stat-box span   { font-size: 13.5px; color: #D4C9FF; }
.ml-hero-bar   { height: 8px; background: #ffffff25; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.ml-hero-bar i { height: 100%; display: block; background: #FFE45E; border-radius: 999px; transition: width .6s; }
.ml-hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ml-hero-chip  { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #ffffff18; color: #EDE9FF; font-weight: 600; border: 1px solid #ffffff20; }

/* Course grid */
.ml-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ml-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 0;
  min-width: 0;
  transition: border-color .2s, box-shadow .2s;
}
.ml-card:hover { border-color: var(--tim); box-shadow: var(--shadow-2); }
.ml-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.ml-card h3 { margin: 0 0 6px; font-size: 16px; }
.ml-card p  { color: var(--ink-3); font-size: 13.5px; line-height: 1.6; flex: 1; }
.ml-card-foot { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ml-pct { font-size: 13px; color: var(--ink-3); }
.ml-bar   { height: 5px; background: var(--paper-3); border-radius: 999px; overflow: hidden; margin-top: 6px; margin-bottom: 14px; }
.ml-bar i { height: 100%; display: block; background: var(--tim); border-radius: 999px; }

/* Course detail layout */
.ml-course-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.ml-course-sidebar { position: sticky; top: calc(var(--top-h, 60px) + 16px); }
.ml-unit-list { display: grid; gap: 6px; }
.ml-unit-btn {
  width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--paper-2);
  color: var(--ink); padding: 12px 14px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px;
  transition: border-color .15s, background .15s;
}
.ml-unit-btn:hover { border-color: var(--tim); background: var(--tim-soft); }
.ml-unit-btn.active { border-color: var(--tim); background: var(--tim-soft); }
.ml-unit-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-3); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--ink-3); flex: none; margin-top: 1px;
}
.ml-unit-btn.active .ml-unit-num,
.ml-unit-btn.done .ml-unit-num { background: var(--tim); border-color: var(--tim); color: #fff; }
.ml-unit-btn.done .ml-unit-num::after { content: "✓"; }
.ml-unit-info b     { display: block; font-size: 13.5px; font-weight: 600; }
.ml-unit-info small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* Theory panel */
.ml-theory-panel {
  background: var(--tim-soft);
  border: 1px solid color-mix(in srgb, var(--tim) 25%, transparent);
  border-radius: 14px; padding: 18px; margin-bottom: 20px;
}
.ml-theory-panel h4 { color: var(--tim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ml-theory-panel p  { color: var(--ink-2); font-size: 14px; line-height: 1.7; }

/* Mentor box */
.ml-mentor-box { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--paper-2); margin-top: 20px; }
.ml-mentor-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ml-mentor-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--tim-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.ml-role-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ml-role-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-3); color: var(--ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.ml-role-btn:hover, .ml-role-btn.on { background: var(--tim-soft); color: var(--tim); border-color: var(--tim); }
.ml-mentor-answer {
  white-space: pre-wrap; line-height: 1.75;
  background: var(--paper-3); border-radius: 12px;
  padding: 16px; margin-top: 14px; font-size: 14px; border: 1px solid var(--line);
}

/* Teams */
.ml-team-card {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--paper-2);
}
.ml-team-info b    { display: block; font-weight: 700; }
.ml-team-info span { font-size: 13px; color: var(--ink-3); }
.ml-team-actions   { display: flex; gap: 8px; flex-shrink: 0; }

/* Section header */
.ml-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ml-sec-head h2 { font-size: 20px; font-weight: 750; }
.ml-sec-head p  { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }

/* Markdown content */
.lc-md { line-height: 1.75; color: var(--ink); }
.lc-md h1, .lc-md h2, .lc-md h3 { margin: 24px 0 12px; line-height: 1.3; }
.lc-md h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.lc-md h3 { font-size: 16.5px; }
.lc-md p  { margin-bottom: 14px; }
.lc-md ul, .lc-md ol { padding-left: 22px; margin-bottom: 14px; }
.lc-md li { margin-bottom: 4px; }
.lc-md code { background: var(--paper-3); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.lc-md pre  { background: var(--paper-3); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.lc-md pre code { background: none; padding: 0; }
.lc-md blockquote { border-left: 3px solid var(--tim); margin: 16px 0; padding: 12px 16px; background: var(--tim-soft); border-radius: 0 8px 8px 0; }
.lc-md table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.lc-md th { background: var(--paper-3); padding: 9px 12px; text-align: left; font-weight: 700; border: 1px solid var(--line); }
.lc-md td { padding: 9px 12px; border: 1px solid var(--line); }

/* Responsive */
@media (max-width: 760px) {
  .ml-hero { grid-template-columns: 1fr; padding: 22px; }
  .ml-grid { grid-template-columns: 1fr; }
  .ml-course-layout { grid-template-columns: 1fr; }
  .ml-course-sidebar { position: static; }
}
