/* Root */
.vma-slide-widget {
  position: fixed;
  top: var(--vma-top, 120px);
  left: 0;
  z-index: var(--vma-z, 9999);
  width: var(--vma-width, 320px);
  max-width: 90vw;
  transition: transform 0.25s ease;
  box-sizing: border-box;
}
.vma-slide-widget[data-side="right"] { left: auto; right: 0; }

/* Panel */
.vma-slide-widget .vma-panel {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-left: none;
  border-right: none;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  border-radius: 0 12px 12px 0;
  overflow: hidden;
}
.vma-slide-widget[data-side="right"] .vma-panel { border-radius: 12px 0 0 12px; }

/* Header */
.vma-slide-widget .vma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: #f7f7f9;
}
.vma-slide-widget .vma-header,
.vma-slide-widget .vma-header-title,
.vma-slide-widget .vma-toggle,
.vma-slide-widget .vma-toggle::before {
  text-transform: none !important;
  font-variant-caps: normal !important;
}

/* Content */
.vma-slide-widget .vma-content {
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
}

/* ===== Toggle buttons ===== */

/* Close button (inside header, visible when expanded) */
.vma-toggle-close {
  all: unset;
  cursor: pointer;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #2c3e50;
}
.vma-toggle-close:hover { background: rgba(0,0,0,0.06); }

/* X icon */
.vma-toggle-close .vma-toggle-icon {
  position: relative;
  width: 14px;
  height: 14px;
}
.vma-toggle-close .vma-toggle-icon::before,
.vma-toggle-close .vma-toggle-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform-origin: center;
}
.vma-toggle-close .vma-toggle-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.vma-toggle-close .vma-toggle-icon::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* Tab button (outside panel edge, visible when collapsed) */
.vma-toggle-tab {
  position: absolute;
  top: 16px;
  left: calc(100% - 16px);
  display: none; /* hidden by default (expanded) */
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  min-width: 28px;
  height: 56px;
  border: 1px solid rgba(0,0,0,.1);
  border-left: none;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  border-radius: 0 8px 8px 0;
  color: #2c3e50;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.vma-slide-widget[data-side="right"] .vma-toggle-tab {
  left: auto;
  right: calc(100% - 16px);
  border-left: 1px solid rgba(0,0,0,.1);
  border-right: none;
  border-radius: 8px 0 0 8px;
}

/* Show the tab only when collapsed */
.vma-slide-widget.is-collapsed .vma-toggle-tab { display: inline-flex; }
/* Hide the close button when collapsed */
.vma-slide-widget.is-collapsed .vma-toggle-close { display: none; }

/* Collapsed label “Curriculum” before the arrow */
.vma-slide-widget.is-collapsed .vma-toggle-tab::before {
  content: "Curriculum";
  font-size: 14px;
  color: #2c3e50;
  font-weight: 600;
  text-transform: none !important;
}

/* Arrow for tab */
.vma-slide-widget.is-collapsed .vma-toggle-tab .vma-toggle-icon {
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.vma-slide-widget[data-side="left"].is-collapsed .vma-toggle-tab .vma-toggle-icon {
  border-left: 8px solid currentColor;
}
.vma-slide-widget[data-side="right"].is-collapsed .vma-toggle-tab .vma-toggle-icon {
  border-right: 8px solid currentColor;
}

/* Slide offset */
.vma-slide-widget.is-collapsed { transform: translateX(calc(-1 * (var(--vma-width, 320px) - 12px))); }
.vma-slide-widget[data-side="right"].is-collapsed { transform: translateX(calc(var(--vma-width, 320px) - 12px)); }

/* Mobile */
@media (max-width: 768px) {
  .vma-slide-widget { --vma-width: 86vw; top: 80px; }
  .vma-slide-widget.is-collapsed .vma-toggle-tab {
    height: 48px;
    padding: 0 8px;
  }
  .vma-slide-widget.is-collapsed .vma-toggle-tab::before { font-size: 13px; }
}

/* =========================================================
   LifterLMS outline — bulletproof downsizing inside the slide
   (works for outline-list-small.php & syllabus widget)
   ========================================================= */

/* 1) Shrink the base in the slide and force descendants to inherit */
.vma-slide-widget .vma-content { font-size: 13px !important; line-height: 1.35 !important; }
.vma-slide-widget .vma-content * { font-size: inherit !important; line-height: inherit !important; }

/* 2) Explicitly include common LLMS wrappers used by shortcode & widget */
.vma-slide-widget .vma-content .llms-course-outline,
.vma-slide-widget .vma-content .llms-syllabus,
.vma-slide-widget .vma-content .llms-outline,
.vma-slide-widget .vma-content .llms-outline-list,
.vma-slide-widget .vma-content .llms-sections,
.vma-slide-widget .vma-content .llms-section,
.vma-slide-widget .vma-content .llms-lesson {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* 3) Headings & anchors inside outline: normalize sizes (themes often up-size h-tags) */
.vma-slide-widget .vma-content h1,
.vma-slide-widget .vma-content h2,
.vma-slide-widget .vma-content h3,
.vma-slide-widget .vma-content h4,
.vma-slide-widget .vma-content h5,
.vma-slide-widget .vma-content h6,
.vma-slide-widget .vma-content a,
.vma-slide-widget .vma-content p,
.vma-slide-widget .vma-content li,
.vma-slide-widget .vma-content span,
.vma-slide-widget .vma-content strong,
.vma-slide-widget .vma-content em,
.vma-slide-widget .vma-content button {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* 4) Specific LLMS title classes */
.vma-slide-widget .vma-content .llms-section-title,
.vma-slide-widget .vma-content .llms-section-title a {
  font-weight: 600 !important;
}
.vma-slide-widget .vma-content .llms-lesson-title,
.vma-slide-widget .vma-content .llms-lesson-title a,
.vma-slide-widget .vma-content .llms-lesson-preview-title {
  font-weight: 500 !important;
}

/* 5) Optional: tighten spacing */
.vma-slide-widget .vma-content .llms-course-outline li,
.vma-slide-widget .vma-content .llms-syllabus li,
.vma-slide-widget .vma-content .llms-outline-list li {
  margin: 2px 0 !important;
  padding: 0 !important;
}
