/* ==========================================================================
   components.css — کامپوننت‌ها: دکمه، کارت، بج، تب، آکاردئون، توست و…
   (نام‌گذاری BEM)
   ========================================================================== */

/* ——— دکمه‌ها ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.25s var(--ease), border-color 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn--primary {
  background: var(--btn-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { transform: translateY(-2px); filter: brightness(1.12); color: #fff; }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-strong); border-color: var(--border-strong); transform: translateY(-2px); color: var(--text); }

/* ——— دکمه‌ی آیکونی ——— */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.icon-btn:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-2px);
}
.icon-btn--pill { width: auto; padding-inline: 14px; gap: 6px; font-weight: 700; font-size: 0.85rem; }

/* ——— جعبه‌ی جست‌وجو ——— */
.search-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 50px;
  padding-inline: var(--sp-4);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}
.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ——— چیپ‌های فیلتر ——— */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.chip.is-active {
  background: var(--btn-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ——— بج دسته‌بندی ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.8;
  color: var(--c, var(--text-2));
  background: color-mix(in srgb, var(--c, var(--text-2)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--text-2)) 30%, transparent);
}
.badge .icon { width: 0.95em; height: 0.95em; }

/* بج میرور رسمی (اوبونتو کشوری) — نارنجی Ubuntu */
.badge--official { --c: #fb923c; }
html[data-theme='light'] .badge--official { --c: #ea580c; }

/* ——— کاشی لوگو (گرادیانت هم‌رنگ برند هر توزیع) ——— */
.logo-tile {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--tile-a, #38bdf8), var(--tile-b, #3b82f6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 24px -10px var(--tile-a, #38bdf8);
}
.logo-tile img { width: 26px; height: 26px; }

/* ——— کارت میرور ——— */
.mirror-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mirror-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--tile-a) 45%, var(--border-strong));
  box-shadow: var(--shadow-1), 0 16px 40px -16px color-mix(in srgb, var(--tile-a) 55%, transparent);
}
.mirror-card__head { display: flex; align-items: center; gap: var(--sp-3); }
.mirror-card__name { font-size: 1.12rem; }
.mirror-card__path {
  display: inline-block;
  direction: ltr;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
}
.mirror-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  color: var(--ok);
  font-size: 0.74rem;
  font-weight: 700;
}
.mirror-card__status .pulse-dot { width: 7px; height: 7px; }
.mirror-card__desc { color: var(--text-2); font-size: 0.92rem; flex: 1; }
.mirror-card__badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mirror-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border);
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 600;
}
.mirror-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.mirror-card__meta-item .icon { width: 0.95em; height: 0.95em; }

/* دامنه‌ی رسمی (ir.archive.ubuntu.com) به‌عنوان آدرس جایگزین */
.mirror-card__meta-item--alias {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-strong);
}
.mirror-card__meta-item--alias:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mirror-card__actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.mirror-card__actions .btn { flex: 1; padding: 10px 18px; font-size: 0.9rem; }
.icon-btn.is-copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* ——— حالت خالی ——— */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-7) var(--sp-5);
  border-radius: var(--radius-l);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  text-align: center;
}
.empty-state.is-visible { display: flex; }
.empty-state h3 { font-size: 1.05rem; }
.empty-state p { color: var(--text-3); font-size: 0.92rem; }
.empty-state .icon { width: 34px; height: 34px; color: var(--text-3); }

/* ——— ردیف آمار: اعداد بزرگ بدون قاب (typography-first) ——— */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-4) var(--sp-3);
  padding-block: var(--sp-5);
}
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-1);
  min-width: 0;
}
/* جداکننده‌ی مویی گرادیانت بین ستون‌ها */
.stat:not(:first-child)::before {
  content: '';
  position: absolute;
  inset-inline-start: calc(var(--sp-3) / -2);
  top: 14%;
  height: 72%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-strong) 30%, var(--border-strong) 70%, transparent);
}
/* برچسب بالا: آیکون کوچک + متن */
.stat__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}
.stat__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.stat__icon .icon { width: 14px; height: 14px; }
/* مقدار پایین: عدد بزرگ گرادیانتی */
.stat__value {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 900;
  line-height: 1.25;
  direction: ltr;
  white-space: nowrap;
  margin-top: var(--sp-1);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__value--sm { font-size: clamp(0.98rem, 1.3vw, 1.15rem); font-weight: 800; line-height: 1.6; }

/* ——— تب‌های راهنما ——— */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.tab[aria-selected='true'] {
  background: var(--btn-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}
/* لوگوی مونوکروم توزیع داخل تب — بدون رنگ در حالت عادی */
.tab__logo {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease), filter 0.2s var(--ease);
}
/* در تم روشن، لوگوی سفید با فیلتر سیاه می‌شود */
html[data-theme='light'] .tab__logo { filter: brightness(0); opacity: 0.6; }
/* تب انتخابی: لوگو سفید روی گرادیانت */
.tab[aria-selected='true'] .tab__logo { filter: none; opacity: 1; }

.tabpanel { animation: fade-in 0.35s var(--ease); }

/* ——— بلوک کد ——— */
.code-block {
  margin-top: var(--sp-4);
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  background: #060a16;
  overflow: hidden;
}
html[data-theme='light'] .code-block { background: #0b1226; }
.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 9px 10px 9px 18px;
  border-bottom: 1px solid rgba(148, 178, 255, 0.12);
}
.code-block__file {
  direction: ltr;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #7d8db3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-block__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 178, 255, 0.2);
  color: #a9b7d8;
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.code-block__copy:hover { color: #fff; border-color: rgba(148, 178, 255, 0.45); background: rgba(148, 178, 255, 0.08); }
.code-block__copy.is-copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

.code-block pre {
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  font-size: 0.83rem;
  line-height: 1.8;
  color: #c9d6f2;
}
/* هایلایت ساده */
.hl-k { color: #93c5fd; font-weight: 600; }   /* کلیدواژه: deb / Server / sudo */
.hl-u { color: #7dd3fc; }                     /* آدرس میرور */
.hl-c { color: #64748b; font-style: italic; } /* کامنت */

/* ——— راهنمای نسخه‌محور ——— */
.guide-block { margin-top: var(--sp-5); }
.guide-block:first-child { margin-top: 0; }
.guide-block__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--sp-2);
}
.guide-block__title::before {
  content: '';
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 10px var(--primary);
}
.guide-block .code-block { margin-top: 0; }

.guide-note {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-s);
  border-inline-start: 3px solid var(--primary);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.88rem;
}

/* ——— کارت ویژگی ——— */
.feature-card {
  padding: var(--sp-5);
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}
.feature-card__icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.feature-card__icon .icon { width: 22px; height: 22px; }
.feature-card h3 { margin-top: var(--sp-3); font-size: 1.03rem; }
.feature-card p { margin-top: var(--sp-2); color: var(--text-2); font-size: 0.9rem; }

/* ——— توست ——— */
.toast {
  position: fixed;
  bottom: 26px;
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast .icon { color: var(--ok); }
