/* Глобальні стилі */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f9; /* Світло-сірий фон як на Introduction */
  line-height: 1.6;
}

/* Стилі для бокової панелі */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  background-color: #333;
  color: white;
  height: 100%;
  padding: 15px 8px;
}

.sidebar ul {
  list-style-type: none !important; /* Додаємо !important для гарантії */
  padding: 0;
  margin: 0; /* Додаємо margin: 0 */
}

.sidebar ul li {
  margin: 10px 0;
  list-style: none !important; /* Гарантуємо відсутність маркерів */
}

.sidebar ul li a {
  color: white;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  display: block;
  word-break: break-word;
  hyphens: auto;
  padding: 3px 0; /* Базовий padding для рівномірності */
  transition: all 0.3s ease; /* Плавний перехід для всіх змін */
  border-radius: 4px; /* Базове заокруглення */
}

.sidebar ul li a:hover {
  color: #16a085;
  background-color: rgba(22, 160, 133, 0.15); /* Легкий фон з кольором hover */
  padding: 5px 8px;
  border-radius: 4px;
  transition: all 0.3s ease; /* Плавний перехід */
  transform: translateX(3px); /* Легке зміщення вправо */
}

/* Стиль для активної сторінки */
.sidebar ul li a.active {
  color: #e67e22;
  font-weight: bold;
  background-color: rgba(230, 126, 34, 0.1); /* Легкий фон */
  padding: 5px 8px;
  border-radius: 4px;
}

/* Hide learning menu by default, show only on page1 and introduction */
#learning-menu {
  display: none;
}

/* Show learning menu on page1 and introduction pages */

.introduction #learning-menu {
  display: block;
}

/* Hide learning menu by default, show only on page1 and introduction */
#html-menu {
  display: none;
}

/* Show learning menu on page1 and introduction pages */
.html #html-menu {
  display: block;
}

.base-menu {
  display: none;
}

/* Show learning menu on page1 and introduction pages */

.base #base-menu {
  display: block;
}

.hidden {
  display: none !important;
}

/* Dropdown menu styles */
.dropdown-menu,
.dropdown-menu2,
.dropdown-menu3 {
  display: none;
  margin-left: 0px !important;
  padding-left: 20px !important;
  border-left: 2px solid #16a085; /* Додаємо лінію зліва для візуального розділення */
  margin-top: 8px; /* Збільшуємо відступ зверху */
  padding-top: 5px; /* Додаємо відступ зверху всередині */
}

/* Стилі для елементів випадного меню */
.dropdown-menu li,
.dropdown-menu2 li,
.dropdown-menu3 li {
  margin: 6px 0; /* Трохи менші відступи для підменю */
  margin-left: 0 !important; /* Скидаємо margin елементів */
}

.dropdown-menu li a,
.dropdown-menu2 li a,
.dropdown-menu3 li a {
  font-size: 13px; /* Трохи менший шрифт для підменю */
  color: #ccc; /* Трохи світліший колір */
  margin-left: 0 !important; /* Скидаємо margin посилань */
}

.dropdown-menu li a:hover,
.dropdown-menu2 li a:hover,
.dropdown-menu3 li a:hover {
  color: #16a085;
  background-color: rgba(22, 160, 133, 0.1);
  transform: translateX(2px); /* Менше зміщення для підменю */
}

/* Стилі для кнопок + та - */
.toggle-btn,
.toggle-btn2,
.toggle-btn3 {
  background: none;
  border: 1px solid #16a085;
  color: #16a085;
  cursor: pointer;
  font-weight: bold;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 3px;
  font-size: 12px;
  transition: all 0.3s ease;
  display: none; /* За замовчуванням приховані */
}

.toggle-btn:hover,
.toggle-btn2:hover,
.toggle-btn3:hover {
  background-color: #16a085;
  color: white;
  transform: scale(1.1);
}

/* Стилі для елементів списку з кнопками */
.sidebar li:not(#learning-menu):not(#html-menu):not(#base-menu) {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Стилі для випадних меню залишаються без flex */
#learning-menu,
#html-menu,
#base-menu {
  display: block;
}

/* Стилі для елементів всередині випадних меню */
.dropdown-menu2 li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Показуємо кнопки тільки на відповідних сторінках */
.introduction .toggle-btn {
  display: inline-block;
}

.html .toggle-btn2 {
  display: inline-block;
}

.base .toggle-btn3 {
  display: inline-block;
}

/* Клас для примусового показу кнопок коли меню відкрите */
.toggle-btn.force-show,
.toggle-btn2.force-show,
.toggle-btn3.force-show {
  display: inline-block !important;
}

/* Стилі для основного контенту */
.main-content {
  margin: 20px auto; /* Автоматичне центрування з відступами зверху/знизу */
  max-width: 800px; /* Обмежуємо ширину */
  padding: 20px 40px; /* Внутрішні відступи */
  background-color: #fff; /* Білий фон як на Introduction */
  border-radius: 10px; /* Заокруглені кути */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Тінь як на Introduction */
  /* Просто додаємо відступ зліва для sidebar */
  margin-left: calc(
    280px + (100vw - 280px - 800px) / 2
  ); /* Центрування з урахуванням sidebar */
  margin-right: auto;
}

/* Загальні стилі для заголовків */
h1,
h2,
h3 {
  color: #333;
}

/* Стилі для зображень */
.content-image {
  max-width: 100%;
  height: auto;
  margin-top: 20px;
}

/* Стилі для code блоків */
pre {
  background-color: #f4f4f4;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

/* Стилі для завантажувача контенту */
.loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #666;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin: 20px 0;
}

.loading::before {
  content: "⏳";
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

.error {
  text-align: center;
  padding: 30px 20px;
  background-color: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  margin: 20px 0;
  color: #c33;
}

.error h3 {
  margin-top: 0;
  color: #c33;
}

.error button {
  background-color: #16a085;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.error button:hover {
  background-color: #149174;
}

/* Стилі для навігації сторінок */
.page-navigation {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}

.page-navigation button {
  background-color: #16a085;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.page-navigation button:hover {
  background-color: #149174;
  transform: translateY(-1px);
}

.page-navigation button.active {
  background-color: #2c3e50;
}

.page-navigation .home-link {
  background-color: #34495e;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-size: 14px;
  display: inline-block;
}

.page-navigation .home-link:hover {
  background-color: #2c3e50;
  transform: translateY(-1px);
}

/* Стилі сторінки Roblox — базуються на існуючих */
/* Герой-блок */
.hero {
  background: linear-gradient(135deg, #ff7eb3, #65c7f7, #0052d4);
  color: white;
  padding: 40px 20px;
  border-radius: 10px;
  text-align: center;
}
.hero h1 {
  font-size: 2.5em;
}
.hero .lead {
  font-size: 1.2em;
  margin: 10px 0 20px;
}
.btn-start {
  background: #ffcc00;
  color: #333;
  padding: 12px 24px;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-start:hover {
  background: #ffd633;
}

/* Блоки розділів */
.intro-section,
.teacher-section,
.program-section,
.fun-facts {
  margin: 30px 0;
}

/* Вчитель */
.teacher-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #fef6e4;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.teacher-photo {
  width: 140px;
  border-radius: 10px;
}

/* Програма */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.level-card {
  padding: 20px;
  border-radius: 10px;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-weight: bold;
}
.level-card.easy {
  background: #00c2ff;
}
.level-card.middle {
  background: #ff8c00;
}
.level-card.pro {
  background: #8a2be2;
}
.level-card.senior {
  background: #228b22;
}

/* Цікавий факт */
.fun-facts {
  background: linear-gradient(135deg, #e0f7fa, #f1f8e9);
  padding: 20px;
  border-left: 5px solid #16a085;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

/* ========== Тема та базові змінні (не ламає твої існуючі) ========== */
:root {
  --rc-ink: #2c3e50;
  --rc-muted: #6b7280;
  --rc-bg: #ffffff;
  --rc-soft: #f4f6fb;
  --rc-radius: 16px;
  --rc-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  --easy: #06b6d4; /* блакитний */
  --middle: #f59e0b; /* помаранчевий */
  --pro: #7c3aed; /* фіолетовий */
  --senior: #15803d; /* зелений */
}

/* оболонка сторінки */
.rc-shell {
  padding: 28px 24px 40px;
}

/* загальна анімація появи секцій */
.rc-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.rc-reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* ховери по сторінці */
.rc-hover-float {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.rc-hover-float:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.rc-hover-tilt {
  transform-style: preserve-3d;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.rc-hover-tilt:hover {
  transform: rotateX(2deg) rotateY(-2deg) translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

/* кнопка */
.rc-btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
}
.rc-btn--primary {
  background: #ffcc00;
  color: #1f2937;
  box-shadow: 0 8px 22px rgba(255, 204, 0, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.rc-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 204, 0, 0.5);
}

/* HERO */
.rc-hero {
  background: radial-gradient(
      900px 400px at 90% -10%,
      rgba(124, 58, 237, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 400px at -10% 0%,
      rgba(6, 182, 212, 0.2),
      transparent 60%
    ),
    linear-gradient(135deg, #65c7f7, #0052d4);
  color: #fff;
  padding: 36px 24px;
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-shadow);
  text-align: center;
}
.rc-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 6px 0 10px;
}
.rc-hero h1 span {
  white-space: nowrap;
}
.rc-hero__lead {
  max-width: 60ch;
  margin: 0 auto 18px;
  opacity: 0.95;
}
.rc-hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* ЗАГОЛОВКИ РОЗДІЛІВ */
.rc-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.rc-section__head h2 {
  margin: 0;
}
.rc-section__sub {
  color: var(--rc-muted);
  margin: 0;
}

/* =================== ПРОГРАМА (перероблена) =================== */
.rc-section {
  margin: 36px 0;
}

.rc-levels {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.rc-level {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--rc-bg);
  box-shadow: var(--rc-shadow);
  isolation: isolate;
}

/* тонкий градієнт-бордер зверху */
.rc-level__stripe {
  height: 10px;
  width: 100%;
  background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 12%,
        rgba(255, 255, 255, 0) 24%
      )
      repeat-x,
    linear-gradient(90deg, #06b6d4, #f59e0b, #7c3aed, #15803d);
  background-size: 160px 10px, 100% 10px;
  mix-blend-mode: plus-lighter;
}

/* контент картки */
.rc-level__body {
  padding: 18px 18px 20px;
}
.rc-level__icon {
  font-size: 22px;
}
.rc-level__title {
  margin: 4px 0 8px;
}
.rc-level__desc {
  color: var(--rc-muted);
  margin: 0 0 12px;
}

.rc-level__bullets {
  --dot: currentColor;
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--rc-ink);
}
.rc-level__bullets li {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: start;
  gap: 10px;
}
.rc-level__bullets li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot);
  margin-top: 6px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* колір акценту для кожного рівня */
.rc-level--easy {
  --dot: var(--easy);
}
.rc-level--middle {
  --dot: var(--middle);
}
.rc-level--pro {
  --dot: var(--pro);
}
.rc-level--senior {
  --dot: var(--senior);
}

/* ефект «блік» при ховері */
.rc-level::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      600px 200px at -10% -40%,
      rgba(255, 255, 255, 0.3),
      transparent 60%
    ),
    linear-gradient(
      120deg,
      transparent,
      rgba(255, 255, 255, 0.08) 40%,
      transparent 65%
    );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.rc-level:hover::after {
  opacity: 1;
}

/* прогрес-лінія під секцією */
.rc-progress {
  margin-top: 18px;
}
.rc-progress__line {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--easy) 0 25%,
    var(--middle) 25% 50%,
    var(--pro) 50% 75%,
    var(--senior) 75% 100%
  );
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}
.rc-progress__dots {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--rc-muted);
  margin-top: 8px;
  font-size: 0.95rem;
}

/* FUN FACT */
.fun-facts {
  background: linear-gradient(135deg, #e0f7fa, #f1f8e9);
  border-left: 6px solid #00acc1;
  padding: 20px;
  border-radius: 14px;
  box-shadow: var(--rc-shadow);
}

/* TEACHER */
.teacher-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--rc-shadow);
}
.teacher-photo {
  width: 140px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
}

/* Дрібні покращення типографіки */
.rc-section h2,
.intro-section h2,
.teacher-section h2,
.fun-facts h2 {
  color: var(--rc-ink);
}

/* Повага до користувачів з вимкненими анімаціями */
@media (prefers-reduced-motion: reduce) {
  .rc-reveal,
  .rc-hover-float,
  .rc-hover-tilt,
  .rc-btn--primary {
    transition: none !important;
  }
}
/* ===== Комірна типографія і підзаголовок ===== */
.levels-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  justify-content: space-between;
}
.levels-sub {
  margin: 0;
  color: #7a8a99;
  font-size: 0.95rem;
}

/* ===== Сітка та картки (той самий «дорослий» стиль) ===== */
:root {
  --clr-ink: #2c3e50;
  --clr-muted: #6b7280;
  --clr-easy: #08b4ff;
  --clr-middle: #ff8a00;
  --clr-pro: #7a2cf2;
  --clr-senior: #1f8d3a;
  --radius: 14px;
  --shadow-1: 0 8px 18px rgba(16, 24, 40, 0.08);
  --shadow-2: 0 12px 28px rgba(16, 24, 40, 0.16);
}
* {
  transition: box-shadow 0.3s ease, transform 0.3s ease, background 0.3s ease,
    border-color 0.3s ease, color 0.3s ease;
}
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.levels-pro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin-top: 12px;
}
.levels-pro .level-pro {
  grid-column: span 6;
}
@media (max-width: 880px) {
  .levels-pro .level-pro {
    grid-column: 1 / -1;
  }
}

.level-pro {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: clip;
}
.level-pro:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
}
.level-pro::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
}
.card-easy::before {
  background: linear-gradient(
    135deg,
    rgba(8, 180, 255, 0.22),
    rgba(255, 255, 255, 0)
  );
}
.card-middle::before {
  background: linear-gradient(
    135deg,
    rgba(255, 138, 0, 0.22),
    rgba(255, 255, 255, 0)
  );
}
.card-pro::before {
  background: linear-gradient(
    135deg,
    rgba(122, 44, 242, 0.24),
    rgba(255, 255, 255, 0)
  );
}
.card-senior::before {
  background: linear-gradient(
    135deg,
    rgba(31, 141, 58, 0.24),
    rgba(255, 255, 255, 0)
  );
}

.level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.level-badge {
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--clr-ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-easy .level-badge::before {
  background: var(--clr-easy);
}
.card-middle .level-badge::before {
  background: var(--clr-middle);
}
.card-pro .level-badge::before {
  background: var(--clr-pro);
}
.card-senior .level-badge::before {
  background: var(--clr-senior);
}

.level-lead {
  margin: 6px 0 10px;
  color: var(--clr-muted);
  font-weight: 600;
  line-height: 1.45;
}
.level-list {
  margin: 10px 0 0 18px;
}
.level-list li {
  margin: 8px 0;
}

/* акуратні «кулі» як на скріні */
.bullets {
  list-style: none;
  padding-left: 0;
}
.bullets li {
  position: relative;
  padding-left: 18px;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #172b4d, #1f395b);
}

/* футер */

.btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #16a085;
  color: #16a085;
  text-decoration: none;
  font-weight: 700;
}
.btn-ghost:hover {
  background: #16a085;
  color: #fff;
  box-shadow: var(--shadow-1);
}

/* «блиск» при наведенні */
.level-pro {
  --shine: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.65) 45%,
    transparent 60%
  );
  background-repeat: no-repeat;
  background-size: 0% 100%;
}
.level-pro:hover {
  background-image: var(--shine);
  background-size: 250% 100%;
  background-position: -50% 0;
  animation: shine-move 0.9s ease forwards;
}
@keyframes shine-move {
  to {
    background-position: 150% 0;
  }
}

/* прогрес-індикатор під картками */
.levels-progress {
  position: relative;
  margin-top: 18px;
  padding-top: 18px;
}
.levels-progress .track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--clr-easy) 0 25%,
    var(--clr-middle) 25% 50%,
    var(--clr-pro) 50% 75%,
    var(--clr-senior) 75% 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}
.levels-progress .dot {
  position: absolute;
  bottom: 30px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.levels-progress .easy {
  left: 2%;
  background: var(--clr-easy);
}
.levels-progress .middle {
  left: 34%;
  background: var(--clr-middle);
}
.levels-progress .pro {
  left: 66%;
  background: var(--clr-pro);
}
.levels-progress .senior {
  left: 98%;
  background: var(--clr-senior);
}
.levels-progress .labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #566b7a;
  font-size: 0.92rem;
}

/* повага до reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
/* details/summary — у стилі нових карток + анімація розгортання */
.level-details {
  margin-top: 12px;
  background: #fafbff;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 10px;
  position: relative;
  overflow: hidden;
}
.level-details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: #34495e;
  display: flex;
  align-items: center;
}
.level-details summary::-webkit-details-marker {
  display: none;
}
.level-details summary::after {
  content: "▼";
  font-size: 0.85rem;
  margin-left: 0.5rem;
  transition: transform 0.25s ease;
}
.level-details[open] summary {
  color: #34495e;
}
.level-details[open] summary::after {
  transform: rotate(-180deg);
}

/* плавне відкривання (без JS): анімуємо висоту контенту */
.level-details__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}
.level-details[open] .level-details__content {
  max-height: 700px;
} /* достатньо для списку */
.level-details .level-list {
  margin: 8px 0 0 18px;
}
.level-details .level-list li {
  margin: 6px 0;
}

/* ===== Mentor (teacher) card ===== */
.mentor-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid #eef2f7;
}
@media (max-width: 820px) {
  .mentor-card {
    grid-template-columns: 1fr;
  }
}

/* лівий блок */
.mentor-media {
  position: relative;
  isolation: isolate;
  padding: 6px;
}
.mentor-photo {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transform: translateZ(0);
  animation: avatar-breathe 4.5s ease-in-out infinite;
}
@keyframes avatar-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* стікер-іскра */
.floating-sticker {
  position: absolute;
  right: -6px;
  top: -6px;
  font-size: 24px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: sticker-float 5s ease-in-out infinite;
}
@keyframes sticker-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(8deg);
  }
}

/* бейджі-таблетки */
.mentor-badges {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 10px 0 0;
}
.mentor-badges .badge {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #0f3d3e;
  background: #e6fffb;
  border: 1px solid #bff3eb;
  box-shadow: inset 0 1px 0 #fff;
  position: relative;
  overflow: hidden;
}
.mentor-badges .badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    40% 60% at 0% 0%,
    rgba(22, 160, 133, 0.25),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mentor-badges .badge:hover::after {
  opacity: 1;
}

/* правий блок */
.mentor-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mentor-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mentor-name {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  color: #2c3e50;
  font-weight: 900;
}
.mentor-role {
  color: #64748b;
  font-size: 0.95rem;
}

.mentor-lead {
  margin: 6px 0 2px;
  color: #34495e;
  font-weight: 600;
  line-height: 1.5;
}

.mentor-points {
  margin: 8px 0 0 18px;
}
.mentor-points li {
  margin: 6px 0;
}
.mentor-points li::marker {
  color: #1f395b;
}

/* details/summary у стилі кнопки (контрастні ховери) */
.mentor-details {
  margin-top: 8px;
  background: #fafbff;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px;
}
.mentor-details summary {
  display: inline-block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #16a085;
  background: #ffffff;
  color: #16a085;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  text-align: left;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.mentor-details summary:hover,
.mentor-details summary:focus-visible {
  background: #16a085;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(22, 160, 133, 0.25);
}
.mentor-details summary::after {
  content: "▼";
  font-size: 0.9rem;
  margin-left: 0.6rem;
  transition: transform 0.25s ease;
  color: currentColor;
}
.mentor-details[open] summary {
  background: #16a085;
  color: #fff;
}
.mentor-details[open] summary::after {
  transform: rotate(-180deg);
}

.mentor-details__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}
.mentor-details[open] .mentor-details__content {
  max-height: 420px;
}
.mentor-details__content ul {
  margin: 8px 0 0 18px;
}
.mentor-details__content li {
  margin: 6px 0;
}

/* CTA під блоком */
.mentor-cta {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.mentor-cta .btn-ghost {
  font-weight: 800;
}

/* плавна поява секції, якщо в тебе вже є .reveal — використовуємо */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* повага до reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
.mentor-badges {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 в ряд */
  gap: 10px;
  padding: 0;
  margin: 12px 0 0;
}

.mentor-badges .badge {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 0; /* щоб рівно вписувались у колонки */
  border-radius: 999px;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mentor-badges .badge:hover {
  transform: translateY(-3px);
  background: #16a085;
  color: #fff;
}
