/* ============================================================
   AlexSoftClub - кастомная тема документации (docsify)
   Поверх docsify-themeable / vue.css
   ============================================================ */

/* ---------- Шрифты ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Палитра ---------- */
:root {
  --brand:        #2ea6ff;   /* фирменный синий (Telegram-стиль) */
  --brand-dark:   #1b7fd6;
  --brand-soft:   #eaf5ff;
  --accent:       #7c5cff;   /* акцент-фиолетовый для градиентов */
  --ok:           #17b978;
  --warn:         #f0a020;
  --danger:       #e5484d;

  --ink:          #1a2233;   /* основной текст */
  --ink-soft:     #556074;   /* приглушённый текст */
  --line:         #e7ebf2;   /* границы */
  --bg:           #ffffff;
  --bg-soft:      #f6f8fb;
  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 6px 24px rgba(24, 39, 75, .08);
  --shadow-lg:    0 18px 50px rgba(24, 39, 75, .16);

  /* переменные docsify */
  --theme-color: var(--brand);
}

/* ---------- База ---------- */
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.markdown-section {
  max-width: 860px;
  padding: 32px 28px 80px;
}

.markdown-section p,
.markdown-section li {
  font-size: 16.5px;
  line-height: 1.72;
  color: #2b3547;
}

.content { top: 0; }

/* ---------- Заголовки ---------- */
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.markdown-section h1 { font-size: 2.05rem; font-weight: 800; margin-top: .4em; }
.markdown-section h2 {
  font-size: 1.45rem;
  margin-top: 2.1em;
  padding-bottom: .35em;
  border-bottom: 2px solid var(--line);
}
.markdown-section h3 { font-size: 1.16rem; margin-top: 1.7em; }

.markdown-section h1::after {
  content: "";
  display: block;
  width: 62px; height: 4px;
  margin-top: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

/* ---------- Ссылки ---------- */
.markdown-section a {
  color: var(--brand-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(46,166,255,.32);
  transition: all .15s;
}
.markdown-section a:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---------- Инлайн-код и блоки (имена таблиц, кнопки) ---------- */
.markdown-section code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .86em;
  background: var(--brand-soft);
  color: #12609e;
  padding: .16em .45em;
  border-radius: 6px;
  border: 1px solid #d6e9fb;
  white-space: nowrap;
}
.markdown-section pre {
  background: #0e1626;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.markdown-section pre > code {
  background: transparent;
  color: #d7e2f2;
  border: none;
  font-size: .92em;
  white-space: pre;
}
.markdown-section pre::after { color: #7c8aa5 !important; }

/* ---------- Таблицы ---------- */
.markdown-section table {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 1.4em 0;
}
.markdown-section thead { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }
.markdown-section th {
  color: #fff;
  font-weight: 600;
  text-align: left;
  border: none;
  padding: 12px 16px;
}
.markdown-section td {
  border: none;
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  font-size: 15px;
}
.markdown-section tr:nth-child(2n) td { background: var(--bg-soft); }

/* ---------- Цитаты / базовые callout ---------- */
.markdown-section blockquote {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  color: #2b3547;
  margin: 1.3em 0;
}
.markdown-section blockquote p { margin: .3em 0; }

/* ---------- Блоки-подсказки (callout) ----------
   Используются как <div class="box box-tip"> ... </div> в главах.
   Первый жирный элемент внутри = заголовок. */
.box {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left-width: 5px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin: 1.3em 0;
}
.box > :first-child { margin-top: 0; }
.box > :last-child  { margin-bottom: 0; }
.box p, .box li { font-size: 15.5px; }
.box-tip    { border-left-color: var(--ok);     background: #eafaf3; }
.box-info   { border-left-color: var(--brand);  background: var(--brand-soft); }
.box-warn   { border-left-color: var(--warn);   background: #fff6e6; }
.box-danger { border-left-color: var(--danger); background: #fdecec; }
.box b, .box strong { color: var(--ink); }

/* Бейдж "Новинка" для нового функционала */
.badge-new {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  padding: 2px 9px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ---------- Кнопки в тексте (Скачать) ---------- */
.md-btn, a.md-btn {
  display: inline-block;
  padding: 12px 26px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  color: #fff !important;
  border-radius: 10px;
  font-weight: 700;
  border: none;
  box-shadow: 0 8px 20px rgba(46,166,255,.35);
  transition: transform .15s, box-shadow .15s;
}
.md-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46,166,255,.45); }

/* ============================================================
   КАРТОЧКИ на главной
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 26px 0;
}
.card {
  display: block;
  padding: 20px 20px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, border-color .16s;
  border-bottom: 3px solid transparent;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-bottom-color: var(--brand);
}
.card .card-ico { font-size: 26px; line-height: 1; }
.card .card-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin: 12px 0 5px;
  font-size: 16.5px;
  border: none;
}
.card .card-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
a.card { border-bottom: 1px solid var(--line); }
a.card:hover { border-bottom: 1px solid var(--line); border-bottom-color: var(--brand); }

/* Плитка сценариев (рецептов) */
.recipe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  background: linear-gradient(180deg, #fff, var(--bg-soft));
  box-shadow: var(--shadow);
}
.recipe .recipe-flow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 8px 12px;
  display: inline-block;
  margin: 6px 0;
}

/* ============================================================
   БОКОВОЕ МЕНЮ
   ============================================================ */
.sidebar {
  background: #0f1729;
  border-right: none;
}
.sidebar .search { border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.sidebar .search input { color: #e8eefb; }
.sidebar .search .clear { color: #8ea3c4; }
.sidebar .search .results-panel { background: #16213a; color: #cdd8ec; }

.app-name.app-name-link { padding: 8px 0; }
.sidebar-nav { padding: 0 14px 40px; }

.sidebar ul li a {
  color: #b7c4dc;
  font-size: 15px;
  border: none;
  padding: 3px 0;
  transition: color .15s;
}
.sidebar ul li a:hover { color: #fff; text-decoration: none; }

/* Секции-заголовки в сайдбаре (жирные пункты **...**) */
.sidebar-nav > ul > li > strong,
.sidebar-nav strong {
  display: block;
  color: #6b7c9c;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin: 20px 0 6px;
}

/* Активный пункт - синяя пилюля */
.sidebar-nav li.active > a,
.sidebar-nav li > a.active {
  color: #fff !important;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(46,166,255,.22), rgba(124,92,255,.14));
  border-radius: 8px;
  padding: 6px 10px;
  margin-left: -10px;
}

/* ---------- Ссылка-логотип ---------- */
.app-name-link { color: #fff !important; font-weight: 800; font-size: 20px; }

/* ---------- Пагинация ---------- */
.pagination-item-title { color: var(--brand-dark); font-weight: 600; }
.docsify-pagination-container {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* ============================================================
   ОБЛОЖКА (cover)
   ============================================================ */
section.cover {
  background: radial-gradient(1100px 600px at 78% -8%, rgba(124,92,255,.5), transparent 60%),
              radial-gradient(900px 520px at 10% 108%, rgba(46,166,255,.42), transparent 60%),
              linear-gradient(160deg, #0a1122 0%, #0f1c34 55%, #0a1428 100%) !important;
  color: #eaf1fc;
}
section.cover .cover-main { color: #eaf1fc; }
section.cover h1 { font-weight: 800; font-size: 3.1rem; letter-spacing: -.02em; }
section.cover h1 a { color: #fff; }
section.cover h1 small { color: #9fb3d6; }
section.cover blockquote p {
  font-size: 1.28rem;
  color: #b9c8e4;
}
section.cover .cover-main > p:last-child a {
  border-radius: 11px;
  padding: 12px 30px;
  font-weight: 700;
  border: none;
  transition: transform .16s, box-shadow .16s;
}
section.cover .cover-main > p:last-child a:first-child {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 12px 30px rgba(46,166,255,.4);
}
section.cover .cover-main > p:last-child a:last-child {
  background: transparent;
  color: #dbe6fa;
  border: 1px solid rgba(255,255,255,.28);
}
section.cover .cover-main > p:last-child a:hover { transform: translateY(-3px); }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 768px) {
  .markdown-section { padding: 20px 16px 60px; }
  .markdown-section h1 { font-size: 1.7rem; }
  section.cover h1 { font-size: 2.2rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
}
