/*
 * Media LMS — Frontend Styles
 * Udemy-inspired learning interface: sidebar + main content layout.
 */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --mlms-primary:      #0076BF;
  --mlms-primary-dark: #000000;
  --mlms-success:      #0076BF;
  --mlms-success-bg:   #dbeeff;
  --mlms-text:         #1c1d1f;
  --mlms-text-muted:   #6a6f73;
  --mlms-border:       #d1d7dc;
  --mlms-bg:           #f7f9fa;
  --mlms-sidebar-w:    320px;
  --mlms-topbar-h:     76px;
  --mlms-radius:       6px;
  --mlms-shadow:       0 2px 8px rgba(0,0,0,.12);
}

/* ── Reset / base ───────────────────────────────────────────────────────────── */
.mlms-wrap *,
.mlms-wrap *::before,
.mlms-wrap *::after {
  box-sizing: border-box;
}

.mlms-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--mlms-text);
  line-height: 1.6;
}

/* ── Course archive ─────────────────────────────────────────────────────────── */
.mlms-archive {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.mlms-archive-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.mlms-archive-desc {
  color: var(--mlms-text-muted);
  margin-bottom: 32px;
}

.mlms-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* ── Course card ────────────────────────────────────────────────────────────── */
.mlms-course-card {
  border: 1px solid var(--mlms-border);
  border-radius: var(--mlms-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
}

.mlms-course-card:hover {
  box-shadow: var(--mlms-shadow);
  transform: translateY(-2px);
}

.mlms-course-card__thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: #e0e0e0;
}

.mlms-course-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #bbb;
}

.mlms-course-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mlms-course-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.4;
}

.mlms-course-card__title a {
  color: var(--mlms-text);
  text-decoration: none;
}

.mlms-course-card__title a:hover {
  color: var(--mlms-primary);
}

.mlms-course-card__meta {
  font-size: .8rem;
  color: var(--mlms-text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}

.mlms-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #dbeeff;
  color: var(--mlms-primary);
}

.mlms-badge--green { background: var(--mlms-success-bg); color: var(--mlms-success); }
.mlms-badge--grey  { background: #f0f0f0; color: var(--mlms-text-muted); }

/* ── Course single / landing page ───────────────────────────────────────────── */
.mlms-course-hero {
  background: linear-gradient(135deg, #1c1d1f 60%, var(--mlms-primary) 100%);
  color: #fff;
  padding: 48px 40px;
}

.mlms-course-hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

.mlms-course-hero__title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
}

.mlms-course-hero__excerpt {
  font-size: 1.05rem;
  opacity: .9;
  margin-bottom: 24px;
}

.mlms-course-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .9rem;
  opacity: .85;
}

.mlms-course-hero__card {
  background: #fff;
  border-radius: var(--mlms-radius);
  overflow: hidden;
  color: var(--mlms-text);
  box-shadow: var(--mlms-shadow);
  position: sticky;
  top: 80px;
}

.mlms-course-hero__card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.mlms-course-hero__card-body {
  padding: 24px;
}

.mlms-enroll-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--mlms-primary) !important;
  color: #fff !important;
  border: none;
  border-radius: var(--mlms-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .15s;
  margin-bottom: 16px;
}

.mlms-enroll-btn:hover {
  background: var(--mlms-primary-dark);
  color: #fff;
}

.mlms-enroll-btn--enrolled {
  background: var(--mlms-success);
}

.mlms-enroll-btn--enrolled:hover {
  background: #155732;
}

.mlms-course-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px;
}

.mlms-course-body__main {
  max-width: 700px;
}

.mlms-section-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--mlms-border);
}

/* Course outline (on landing page) */
.mlms-outline { margin: 0; padding: 0; list-style: none; }

.mlms-outline__section {
  border: 1px solid var(--mlms-border);
  border-radius: var(--mlms-radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.mlms-outline__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f7f9fa;
  cursor: pointer;
  font-weight: 600;
}

.mlms-outline__section-header:hover { background: #eff0f1; }

.mlms-outline__lessons { display: none; padding: 8px 0; }
.mlms-outline__lessons.is-open { display: block; }

.mlms-outline__lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: .9rem;
  cursor: pointer;
}

.mlms-outline__lesson:hover { background: #f7f9fa; }

.mlms-outline__lesson .dashicons { font-size: 1rem; color: var(--mlms-text-muted); }

/* ── Lesson learning interface ──────────────────────────────────────────────── */
.mlms-learning {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.mlms-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #0075BE;
    color: #fff;
    height: auto;
    display: flex !important;
    flex-flow: column;
    align-items: flex-start;
    padding: 20px 30px;
    gap: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

/* Push topbar below the WP admin bar when an admin is logged in */
.admin-bar .mlms-topbar { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .mlms-topbar { top: 46px; }
}

.mlms-topbar__back {
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    font-weight: 600 !important;
    white-space: nowrap;
    background: unset;
    border: none;
    text-decoration: none;
    line-height: 1;
    border-radius: 6px;
    padding: 0;
    transition: background .15s ease, border-color .15s ease;
}

.mlms-topbar__back:hover {
  background: rgba(255,255,255,.32);
  border-color: rgba(255,255,255,.75);
  color: #fff;
}

.mlms-topbar__title {
  font-size: 1.75rem;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mlms-topbar__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: .85rem;
  opacity: .9;
}

.mlms-topbar__progress-bar {
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,.3);
  border-radius: 3px;
  overflow: hidden;
}

.mlms-topbar__progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width .4s ease;
}

.mlms-topbar__menu-toggle {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: none;
  padding: 4px;
}

/* Main content area */
.mlms-learning__body {
  display: flex;
  flex: 1;
}

/* Sidebar */
.mlms-sidebar {
  width: var(--mlms-sidebar-w);
  min-width: var(--mlms-sidebar-w);
  border-right: 1px solid var(--mlms-border);
  overflow-y: auto;
  background: #fff;
  position: sticky;
  top: var(--mlms-topbar-h);
  height: calc(100vh - var(--mlms-topbar-h));
}

.mlms-sidebar__header {
  padding: 16px;
  border-bottom: 1px solid var(--mlms-border);
}

.mlms-sidebar__course-title {
  font-size: .85rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.mlms-sidebar__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--mlms-text-muted);
}

.mlms-sidebar__progress-bar {
  flex: 1;
  height: 4px;
  background: var(--mlms-border);
  border-radius: 2px;
  overflow: hidden;
}

.mlms-sidebar__progress-fill {
  height: 100%;
  background: var(--mlms-primary);
  transition: width .4s ease;
}

/* Sidebar sections */
.mlms-sidebar-sections { padding: 0; margin: 0; list-style: none; }

.mlms-sidebar-section { border-bottom: 1px solid var(--mlms-border); }

.mlms-sidebar-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: #fafafa;
  font-size: .85rem;
  font-weight: 700;
}

.mlms-sidebar-section__header:hover { background: #f0f0f0; }

.mlms-sidebar-section__header .dashicons {
  font-size: 1rem;
  transition: transform .2s;
}

.mlms-sidebar-section.is-open .mlms-sidebar-section__header .dashicons {
  transform: rotate(180deg);
}

.mlms-sidebar-lessons {
  display: none;
  padding: 4px 0;
}

.mlms-sidebar-section.is-open .mlms-sidebar-lessons { display: block; }

/* Lesson item in sidebar */
.mlms-sidebar-lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--mlms-text);
  transition: background .1s;
  position: relative;
}

.mlms-sidebar-lesson:hover { background: #f7f9fa; color: var(--mlms-text); }

.mlms-sidebar-lesson.is-active {
  background: #dbeeff;
  font-weight: 600;
  color: var(--mlms-primary);
}

.mlms-sidebar-lesson.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--mlms-primary);
}

.mlms-lesson-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--mlms-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}

.mlms-lesson-check.is-done {
  background: var(--mlms-success);
  border-color: var(--mlms-success);
  color: #fff;
}

.mlms-lesson-check.is-locked {
  background: #f0f0f0;
  border-color: #ccc;
  color: #999;
}

.mlms-sidebar-lesson__title { flex: 1; line-height: 1.3; }

/* ── Elementor enroll button — override the full-width default ──────────────
 * When .mlms-enroll-btn is inside an Elementor widget (.mlms-el-enroll-btn),
 * let the widget's own display/width inline styles take over instead of
 * the full-width block default from the PHP template CSS.
 * Elementor colour/typography controls still apply via {{WRAPPER}} selectors.
 */
.mlms-el-enroll-btn.mlms-enroll-btn {
  display: inline-block;   /* overridden to block by inline style when full-width is on */
  width: auto;
  margin-bottom: 0;
}
.mlms-sidebar-lesson__duration { font-size: .75rem; color: var(--mlms-text-muted); white-space: nowrap; }

/* ── Container visibility classes ───────────────────────────────────────────
 *
 * Add these class names to an Elementor container's "CSS Classes" field
 * (Advanced tab) to show/hide the entire container based on the user's
 * LMS state. No JavaScript required — controlled server-side via body classes.
 *
 * Class to add on the container:   When it is HIDDEN
 * ─────────────────────────────────────────────────────────────────────────
 * mlms-enrolled-only               Not enrolled / not logged in
 * mlms-logged-in-only              Not logged in
 * mlms-completed-only              Has not completed the course
 * mlms-not-enrolled-only           Already enrolled
 * mlms-not-logged-in-only          Already logged in
 * ────────────────────────────────────────────────────────────────────────── */

body.mlms-not-enrolled  .mlms-enrolled-only,
body.mlms-not-logged-in .mlms-enrolled-only   { display: none !important; }

body.mlms-not-logged-in .mlms-logged-in-only  { display: none !important; }

body.mlms-not-completed .mlms-completed-only,
body.mlms-not-enrolled  .mlms-completed-only,
body.mlms-not-logged-in .mlms-completed-only  { display: none !important; }

body.mlms-enrolled      .mlms-not-enrolled-only  { display: none !important; }

body.mlms-logged-in     .mlms-not-logged-in-only { display: none !important; }

/* Main lesson content */
.mlms-lesson-content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.mlms-lesson-media {
  background: #000;
  line-height: 0;
}

.mlms-lesson-media video,
.mlms-lesson-media audio,
.mlms-lesson-media iframe {
  width: 100%;
  display: block;
}

.mlms-lesson-media video { max-height: 60vh; }
.mlms-lesson-media iframe { aspect-ratio: 16/9; border: none; }
.mlms-lesson-media audio { padding: 20px; background: #111; }

.mlms-lesson-body {
  max-width: 860px;
  padding: 32px 40px;
  margin: 0 auto;
}

.mlms-lesson-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 24px;
}

.mlms-lesson-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--mlms-text);
}

.mlms-lesson-text h2, .mlms-lesson-text h3 { margin-top: 2rem; }
.mlms-lesson-text ul, .mlms-lesson-text ol { padding-left: 1.5em; }
.mlms-lesson-text img { max-width: 100%; height: auto; border-radius: 4px; }
.mlms-lesson-text blockquote { border-left: 4px solid var(--mlms-primary); padding-left: 1em; color: var(--mlms-text-muted); margin: 1.5rem 0; }

/* Duration formatted tag */
.mlms-dur { display: inline-flex; align-items: baseline; gap: 2px; }
.mlms-dur + .mlms-dur { margin-left: 5px; }

/* Resources */
.mlms-resources {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.mlms-resources__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.mlms-resources__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mlms-resources__list li {
  margin-bottom: 8px;
}

.mlms-resources__list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mlms-primary);
  font-size: .9rem;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--mlms-primary);
  border-radius: var(--mlms-radius);
  transition: background .15s, color .15s;
}

.mlms-resources__list a:hover {
  background: var(--mlms-primary);
  color: #fff;
}

/* Lesson navigation */
.mlms-lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-top: 1px solid var(--mlms-border);
  background: var(--mlms-bg);
  margin-top: 48px;
}

.mlms-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 60px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  border: 2px solid transparent;
  border-radius: 100px !important;
}

.mlms-btn--primary {
  background: var(--mlms-primary) !important;
  color: #fff !important;
  border-color: var(--mlms-primary) !important;
}

.mlms-btn--primary:hover { background: var(--mlms-primary-dark) !important; border-color: var(--mlms-primary-dark) !important; color: #fff !important; }

.mlms-btn--outline {
  background: #fff;
  color: var(--mlms-text)!important;
  border-color: var(--mlms-border);
}

.mlms-btn--outline:hover { background: #000 !important; border-color: #000 !important; color: #fff !important; }

.mlms-btn--success {
  background: var(--mlms-success);
  color: #fff;
  border-color: var(--mlms-success);
}

.mlms-btn--success:hover { background: #000 !important; border-color: #000 !important; color: #fff !important; }

.mlms-btn--ghost {
  background: transparent;
  color: var(--mlms-primary);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}

.mlms-btn--ghost:hover { background: #000 !important; color: #fff !important; }

.mlms-mark-complete-btn { min-width: 180px; justify-content: center; }

.mlms-mark-complete-btn.is-completed {
  background: var(--mlms-success-bg);
  color: var(--mlms-success);
  border-color: var(--mlms-success);
  cursor: default;
  pointer-events: none;
}

.mlms-lesson-nav button {
    color: #000 !important;
}

.media_lesson-template-default  button {
  border-radius: 80px!important;
}

/* Completion banner */
.mlms-completion-banner {
  background: var(--mlms-success-bg);
  border: 1px solid #93c5fd;
  border-radius: var(--mlms-radius);
  padding: 24px 32px;
  margin: 32px 40px;
  text-align: center;
  display: none;
}

.mlms-completion-banner.is-visible { display: block; }

.mlms-completion-banner__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--mlms-success);
  margin: 0 0 12px;
}

.mlms-completion-banner p { margin: 0 0 16px; color: var(--mlms-text-muted); }

/* Survey prompt */
.mlms-survey-prompt {
  background: #fff4e0;
  border: 1px solid #ffc955;
  border-radius: var(--mlms-radius);
  padding: 20px 28px;
  margin: 24px 40px;
  display: none;
}

.mlms-survey-prompt.is-visible { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mlms-survey-prompt p { margin: 0; flex: 1; font-weight: 600; }

/* Locked overlay */
.mlms-locked-overlay {
  background: rgba(28,29,31,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 60px 20px;
  color: #fff;
  text-align: center;
}

.mlms-locked-overlay .dashicons { font-size: 2.5rem; opacity: .7; }
.mlms-locked-overlay p { font-size: 1rem; opacity: .85; margin: 0; }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.mlms-dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px;
}

.mlms-dashboard__title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.mlms-dashboard__subtitle { color: var(--mlms-text-muted); margin-bottom: 40px; }

.mlms-dashboard-section { margin-bottom: 48px; }
.mlms-dashboard-section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--mlms-border); }

.mlms-enrollment-card {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--mlms-border);
  border-radius: var(--mlms-radius);
  background: #fff;
  margin-bottom: 12px;
  transition: box-shadow .15s;
}

.mlms-enrollment-card:hover { box-shadow: var(--mlms-shadow); }

.mlms-enrollment-card__thumb {
  width: 100px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  background: #e0e0e0;
}

.mlms-enrollment-card__title { font-weight: 700; margin: 0 0 6px; font-size: 1rem; }
.mlms-enrollment-card__title a { color: var(--mlms-text); text-decoration: none; }
.mlms-enrollment-card__title a:hover { color: var(--mlms-primary); }

.mlms-enrollment-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .85rem;
  color: var(--mlms-text-muted);
  margin-top: 8px;
}

.mlms-progress-bar-wrapper {
  flex: 1;
  height: 6px;
  background: var(--mlms-border);
  border-radius: 3px;
  overflow: hidden;
}

.mlms-progress-bar-fill {
  height: 100%;
  background: var(--mlms-primary);
  border-radius: 3px;
  transition: width .4s;
}

/* ── Certificate ────────────────────────────────────────────────────────────── */
.mlms-certificate-page {
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  font-family: Georgia, 'Times New Roman', serif;
}

.mlms-cert-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  font-family: -apple-system, sans-serif;
}

.mlms-certificate {
  background: #fff;
  width: 100%;
  max-width: 860px;
  padding: 60px;
  border: 8px solid var(--mlms-primary);
  position: relative;
  box-shadow: 0 4px 32px rgba(0,0,0,.15);
}

.mlms-certificate::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--mlms-primary);
  opacity: .3;
  pointer-events: none;
}

.mlms-certificate__logo {
  text-align: center;
  margin-bottom: 32px;
}

.mlms-certificate__logo img { max-height: 70px; max-width: 200px; }

.mlms-certificate__label {
  text-align: center;
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mlms-text-muted);
  margin-bottom: 8px;
}

.mlms-certificate__heading {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--mlms-primary);
  margin: 0 0 32px;
  font-family: Georgia, serif;
}

.mlms-certificate__awarded-to {
  text-align: center;
  font-size: .95rem;
  color: var(--mlms-text-muted);
  margin-bottom: 8px;
}

.mlms-certificate__name {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--mlms-text);
  margin: 0 0 16px;
  border-bottom: 2px solid var(--mlms-primary);
  padding-bottom: 16px;
}

.mlms-certificate__course-label {
  text-align: center;
  font-size: .9rem;
  color: var(--mlms-text-muted);
  margin-bottom: 8px;
}

.mlms-certificate__course {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 40px;
}

.mlms-certificate__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--mlms-border);
  font-size: .85rem;
}

.mlms-certificate__footer-col { text-align: center; }

.mlms-certificate__date-label,
.mlms-certificate__instructor-label,
.mlms-certificate__id-label {
  color: var(--mlms-text-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.mlms-certificate__date,
.mlms-certificate__instructor,
.mlms-certificate__id {
  font-weight: 700;
  font-size: .9rem;
}

.mlms-certificate__qr {
  text-align: center;
  font-size: .7rem;
  color: var(--mlms-text-muted);
  margin-top: 4px;
}

/* Alerts */
.mlms-alert {
  border-radius: var(--mlms-radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: .9rem;
}

.mlms-alert--info    { background: #e8f0fe; color: #1a56b0; border-left: 4px solid #1a56b0; }
.mlms-alert--success { background: var(--mlms-success-bg); color: var(--mlms-success); border-left: 4px solid var(--mlms-success); }
.mlms-alert--warning { background: #fff4e0; color: #7a5900; border-left: 4px solid #f59e0b; }
.mlms-alert--error   { background: #fde8e8; color: #9b1c1c; border-left: 4px solid #e53e3e; }

/* Dashboard — empty enrolment state (colors via Elementor style panel) */
.mlms-dashboard__empty {
  text-align: left;
  padding: 16px 0 8px;
}
.mlms-dashboard__empty p {
  margin: 0 0 16px;
  font-size: .95rem;
  color: rgba(255,255,255,.9); /* fallback — Elementor control overrides */
}
.mlms-dashboard__browse-btn,
.mlms-dashboard__empty .mlms-dashboard__browse-btn {
  display: inline-block;
  padding: 10px 24px;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 100px;
  color: #fff; /* fallback — Elementor control overrides */
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}
.mlms-dashboard__empty .mlms-dashboard__browse-btn:hover {
  color: #000; /* fallback — Elementor control overrides */
  font-weight: 700;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mlms-course-hero__inner {
    grid-template-columns: 1fr;
  }

  .mlms-course-hero__card {
    position: static;
    max-width: 400px;
  }

  .mlms-topbar__menu-toggle { display: block; }

  .mlms-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: var(--mlms-sidebar-w);
    height: 100vh;
    z-index: 300;
    transform: translateX(-105%);
    transition: transform .3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }

  .mlms-sidebar.is-open { transform: translateX(0); }

  .mlms-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 290;
  }

  .mlms-sidebar-overlay.is-open { display: block; }

  .mlms-lesson-body { padding: 24px 20px; }
  .mlms-lesson-nav  { padding: 16px 20px; flex-wrap: wrap; gap: 10px; }
  .mlms-completion-banner { margin: 20px; padding: 20px; }
  .mlms-survey-prompt { margin: 16px; }
}

@media (max-width: 600px) {
  .mlms-courses-grid { grid-template-columns: 1fr; }
  .mlms-course-hero { padding: 28px 20px; }
  .mlms-course-hero__title { font-size: 1.5rem; }
  .mlms-enrollment-card { grid-template-columns: 1fr; }
  .mlms-enrollment-card__thumb { width: 100%; }
  .mlms-certificate { padding: 32px 24px; }
  .mlms-certificate__heading { font-size: 1.8rem; }
  .mlms-certificate__name { font-size: 1.6rem; }
  .mlms-certificate__footer { flex-direction: column; gap: 20px; align-items: center; }
}

/* ── Print styles (certificate) ─────────────────────────────────────────────── */
@media print {
  .mlms-cert-actions,
  .mlms-topbar,
  header, footer, nav,
  .site-header, .site-footer,
  #wpadminbar {
    display: none !important;
  }

  body { background: #fff !important; }

  .mlms-certificate-page {
    background: #fff;
    padding: 0;
    min-height: auto;
  }

  .mlms-certificate {
    box-shadow: none;
    border-width: 4px;
    max-width: 100%;
    margin: 0;
  }
}

/* ── Auth Modal ──────────────────────────────────────────────────────────────── */

.mlms-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mlms-modal[hidden] { display: none; }

.mlms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  cursor: pointer;
}

.mlms-modal__wrap {
  position: relative;
  background: #F6F6F6;
  color: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 36px 32px;
  margin: 16px;
}

.mlms-modal__wrap p,
.mlms-modal__wrap label {
  color: #1a1a1a;
}

.mlms-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,.4);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s;
}

.mlms-modal__close:hover { color: #1a1a1a; }

.mlms-modal__title {
  margin: 0 0 24px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* Tab bar — pill container */
.mlms-modal__tabs {
  display: flex;
  gap: 0;
  background: rgba(0,0,0,.08);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 28px;
}

/* Individual tab — inactive */
.mlms-modal__tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 9px 16px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: rgba(0,0,0,.4);
  transition: background .2s, color .2s;
  text-align: center;
}

.mlms-modal__tab:hover {
  color: rgba(0,0,0,.65);
}

/* Active tab — blue pill, white text */
.mlms-modal__tab.is-active {
  background: #0076BF;
  color: #fff;
}

.mlms-modal__panel { display: none; }
.mlms-modal__panel.is-active { display: block; }

@media (max-width: 520px) {
  .mlms-modal__wrap { padding: 24px 20px 22px; }
}
