/* ==========================
   БАЗА Telegram-стиля
   ========================== */

/* Сброс отступов */
body, h1, h2, h3, h4, p, ul, li {
  margin: 0;
  padding: 0;
}

/* Переменные тем */
:root[data-theme='light'] {
  --bg: #ffffff;
  --text: #111111;
  --secondary-text: #555;
  --accent: #0088cc;
  --pro-accent: #ff8c00;
  --exp-accent: #e60000;

  --topbar-bg: linear-gradient(90deg, #0088cc, #29a9e0);
  --topbar-text: #ffffff;

  --card-bg: #f2f3f5;
  --card-border: #dcdcdc;
  --card-hover: rgba(0, 136, 204, 0.08);

  --pro-bg: #fff4e5;
  --pro-border: #ff8c00;
  --pro-text: #ff6a00;

  --expert-bg: #ffe5e5;
  --expert-border: #e60000;
  --expert-text: #cc0000;

  --bonus-bg: #e9ffe9;
  --bonus-border: #00b300;
  --bonus-text: #008000;

  --important-bg: #eaf6ff;
  --important-border: #0088cc;
  --important-text: #005f8a;

  --quote-bg: #fffbf0;
  --quote-border: #cc8500;
  --quote-text: #2c3e50;
}

:root[data-theme='dark'] {
  --bg: #1e1e1e;
  --text: #e1e1e1;
  --secondary-text: #aaa;
  --accent: #29a9e0;

  --topbar-bg: linear-gradient(90deg, #1c1c1c, #2a2a2a);
  --topbar-text: #ffffff;

  --card-bg: #222;
  --card-border: #444;
  --card-hover: rgba(255, 255, 255, 0.05);

  --pro-bg: #3a2a10;
  --pro-border: #ffb366;
  --pro-text: #ffae5a;

  --expert-bg: #3a0f0f;
  --expert-border: #ff6666;
  --expert-text: #ff9999;

  --bonus-bg: #103a10;
  --bonus-border: #66ff66;
  --bonus-text: #b3ffb3;

  --important-bg: #10344a;
  --important-border: #29a9e0;
  --important-text: #cde9ff;

  --quote-bg: #2a2520;
  --quote-border: #cc8500;
  --quote-text: #e1e1e1;
}

/* Базовые стили */
body {
  font-family: 'Telegram WebApp', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  padding: 16px;
  transition: background-color 0.3s, color 0.3s;
  padding-top: 60px;
}

/* ==========================
   Верхняя панель
   ========================== */

/* Topbar */
    #topbar {
      position: fixed;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      width: calc(100% - 32px);
      max-width: 400px;
      height: 48px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.25);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
      z-index: 1100;
      color: var(--text);
    }

/* Светлая тема */
:root[data-theme='light'] {
  --topbar-text: #222; /* тёмный текст */
  --topbar-bg: rgba(255,255,255,0.25);
}

/* Тёмная тема */
:root[data-theme='dark'] {
  --topbar-text: #fff; /* белый текст */
  --topbar-bg: rgba(0,0,0,0.25);
}

/* Применяем фон через переменную */
#topbar {
  background: var(--topbar-bg);
}

#topbar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.3);
  position: absolute; /* аватарка фиксируется слева */
  left: 12px;         /* отступ от левого края */
}

img.my-avatar {
  margin-bottom: 0 !important; /* чтобы перебить глобальный img */
}

#topbar #username {
  font-size: 15px;
  font-weight: 500;
  color: var(--topbar-text);
  white-space: nowrap;
  margin: 0 auto; /* центрирует текст горизонтально относительно плашки */
  display: flex;
  align-items: center; /* вертикальное центрирование текста */
  height: 100%;
}
/* Прячем шапку при открытом модуле */
body.no-scroll #topbar {
  display: none;
}

/* Пример переменных для темы */
:root {
  --topbar-text: #111; /* для светлой темы */
}

body.dark {
  --topbar-text: #fff; /* для тёмной темы */
  #topbar {
    background: rgba(0,0,0,0.25);
  }
}

/* ==========================
   Контент и структура
   ========================== */

#main-content {
  display: none;
  padding-top: 80px;
}

.img-content {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Отступы между элементами */
p, ul, .important, .quote, img, h2, h3, h4 {
  margin-bottom: 16px;
}

/* ==========================
   Заголовки
   ========================== */

h1 {
  font-size: 25px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  color: #ffffff;
  background-color: #2AB6DD;
  border-radius: 12px;
  padding: 8px 10px;
  border: 2px solid #2AB6DD;
  margin: 24px 0 20px;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 28px 0 12px;
}

h1.exp {
   background-color: #e60000;
   border: 2px solid #e60000;
}

h1.pro {
   background-color: #ff8c00;
   border: 2px solid #ff8c00;
}

/* H2 — жирный текст с вертикальной полосой слева 
h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border-left: 6px solid var(--accent);
  padding-left: 10px;
  margin: 24px 0 12px;
} */

/* H3 — голубой акцент, капсом, чуть меньше */
h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  margin: 20px 0 10px;
  letter-spacing: 0.3px;
}
h4 {
  font-size: 18px;
  margin: 16px 0 6px;
}

/* ==========================
   Списки модулей
   ========================== */

.module-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-list li {
  background: var(--card-bg);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.module-list li:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

/* Профильные */
.module-list li.pro,
.module-list li.ppr {
  border-left-color: var(--pro-border);
  background: var(--pro-bg);
}

.module-list li.pro a,
.module-list li.ppr a {
  color: var(--pro-text);
}

/* Экспертные */
.module-list li.expert,
.module-list li.epr {
  border-left-color: var(--expert-border);
  background: var(--expert-bg);
}

.module-list li.expert a,
.module-list li.epr a {
  color: var(--expert-text);
}

/* Бонусные */
.module-list li.bonus {
  border-left-color: var(--bonus-border);
  background: var(--bonus-bg);
}

.module-list li.bonus a {
  color: var(--bonus-text);
}

.module-list li a {
  display: block;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  padding: 2px 6px;
}

/* ==========================
   Модули
   ========================== */

.module {
  display: none;
}

.module.active {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: var(--bg);
  color: var(--text);
  padding: 20px;
  overflow-y: auto;
  z-index: 1300;
  box-sizing: border-box;
}

body.no-scroll {
  overflow: hidden;
}

/* Кнопка "Назад" */
.back {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s ease;
}

.back:hover {
  background: #0077b3;
}

/* ==========================
   Важные блоки и цитаты
   ========================== */

.important {
  position: relative;
  background: var(--pro-bg); /* тёплый фон */
  border-left: 5px solid var(--pro-border);
  border-radius: 10px;
  padding: 16px 18px 16px 52px;
  color: var(--text);
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}

/* Иконка ℹ️ */
.important::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  width: 24px;
  height: 24px;
  background: no-repeat center/contain
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'><rect fill='%23fa0' rx='15' width='32' height='32'/><path fill='%23fff' d='m14.1048 9.88669c-.0579-1.04199.7435-1.88669 1.8015-1.88669h.1874c1.0528 0 1.8593.8467 1.8015 1.88669l-.3115 5.60691c-.0462.832-.7495 1.5064-1.5837 1.5064-.8284 0-1.5376-.6765-1.5837-1.5064zm-.1048 11.11331c0-1.1046.8877-2 2-2 1.1046 0 2 .8877 2 2 0 1.1046-.8877 2-2 2-1.1046 0-2-.8877-2-2z'/></svg>");
  opacity: 0.9;
}



/* Заголовок внутри */
.important strong {
  display: block;
  color: var(--pro-text);
  font-weight: 700;
  margin-bottom: 6px;
}

/* Hover-анимация */
.important:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Цитаты (без изменений, только чуть унификация под визуал) */
.quote {
  border-left: 3px solid var(--quote-border);
  background: var(--quote-bg);
  color: var(--quote-text);
  border-radius: 6px;
  padding: 10px 14px;
  font-style: italic;
  transition: all 0.2s ease;
}

.quote:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


/* ==========================
   Loader
   ========================== */

#loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================
   Кнопка Назад (иконка)
   ========================== */
.back-icon {
  position: fixed;
  top: 14px;
  left: 14px;
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1500;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.back-icon:hover {
  background: var(--card-hover);
  transform: scale(1.08);
  color: var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Для тёмной темы — лёгкая подсветка */
:root[data-theme='dark'] .back-icon {
  background: #2a2a2a;
  border-color: #444;
}

/* Для пунктов списка, которые недоступны */
.module-list .disabled {
  color: #999; /* серая бледная плашка */
  pointer-events: none; /* не кликается */
  cursor: not-allowed;
  text-decoration: none; /* убираем подчеркивание, если было */
}

/* ==========================
   Стили ссылок
   ========================== */

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: all 0.25s ease;
}

/* Эффект тонкой линии при наведении */
a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 2px;
}

/* Наведение — появляется анимационная линия */
a:hover::after {
  transform: scaleX(1);
}

/* Клик — лёгкое затемнение */
a:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* Вариант для “внутренних ссылок” (доп. класс) */
a.internal {
  color: var(--text);
  border-bottom: 1px dashed var(--accent);
  transition: all 0.25s ease;
}

a.internal:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Вариант “кнопка-ссылка” */
a.btn-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

a.btn-link:hover {
  background: #0077b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Цвета подчёркивания для профильных модулей */
.module-list li.pro a::after {
  background: var(--pro-border); /* оранжевый */
}

.module-list li.pro a:hover::after {
  background: var(--pro-border);
}

/* Цвета подчёркивания для экспертных модулей */
.module-list li.expert a::after {
  background: var(--expert-border); /* красный */
}

.module-list li.expert a:hover::after {
  background: var(--expert-border);
}

/* Цвета подчёркивания для бонусных модулей */
.module-list li.bonus a::after {
  background: var(--bonus-border); /* красный */
}

.module-list li.bonus a:hover::after {
  background: var(--bonus-border);
}

/* Цвет текста при наведении тоже меняем */
.module-list li.pro a:hover {
  color: var(--pro-text);
}

.module-list li.expert a:hover {
  color: var(--expert-text);
}

.module-list li.bonus a:hover {
  color: var(--bonus-text);
}

/* Заголовки h4 тоже можно покрасить */
h4.pro {
  border-left: 4px solid var(--pro-border);
  padding-left: 12px;
  margin-top: 30px;
}

h4.expert {
   border-left: 4px solid var(--expert-border);
   padding-left: 12px;
   margin-top: 30px;
}
h4.bonus {
   border-left: 4px solid var(--bonus-border);
   padding-left: 12px;
   margin-top: 30px;
}

/* ===== Темы ===== */
:root[data-theme='light'] {
  --bg-card: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #007bff;
  --text: #111;
  --secondary-text: #555;
  --shadow: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

:root[data-theme='dark'] {
  --bg-card: #1e1e1e;
  --border: rgba(255,255,255,0.08);
  --accent: #4ea3ff;
  --text: #eee;
  --secondary-text: #aaa;
  --shadow: 0 2px 4px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.35);
}
/*====заглушка=====*/
.access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  gap: 16px;
  animation: fadeIn 0.4s ease-out;
}

.access-denied .icon {
  font-size: 60px;
  margin-bottom: 6px;
  animation: bounce 1.5s infinite ease-in-out;
}

.access-denied .title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.access-denied .subtitle {
  font-size: 16px;
  color: var(--secondary-text);
  margin-bottom: 12px;
}

.access-denied .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.access-denied .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ===== Темы ===== */
:root[data-theme='light'] {
  --bg: #f9f9fb;
  --text: #111;
  --secondary-text: #555;
  --accent: #007bff;
}

:root[data-theme='dark'] {
  --bg: #121212;
  --text: #f2f2f2;
  --secondary-text: #aaa;
  --accent: #4ea3ff;
}

/* ===== Анимации ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

