/* ==========================================================================
   اسمارت ابزار — استایل‌های اختصاصی سایت
   ========================================================================== */

:root {
  --bg: #0b1220;
  --text: #f8fafc;
  --glass-bg: rgba(30, 41, 59, 0.55);
  --glass-bg-strong: rgba(30, 41, 59, 0.78);
  --border-soft: rgba(255, 255, 255, 0.09);
  --border-faint: rgba(255, 255, 255, 0.05);

  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --blue-dark: #2563eb;
  --emerald: #10b981;
  --emerald-light: #34d399;
  --orange: #f97316;
  --orange-light: #fdba74;
  --yellow: #eab308;
  --yellow-light: #fde047;
  --purple: #a855f7;
  --purple-light: #d8b4fe;
  --red: #ef4444;
  --red-light: #fca5a5;
  --indigo: #6366f1;
  --indigo-light: #a5b4fc;
  --rose: #f43f5e;
  --amber: #f59e0b;
  --sky: #38bdf8;
  --violet: #8b5cf6;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --shadow-soft: 0 20px 45px -20px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 30px 60px -20px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% -5%, rgba(59, 130, 246, 0.16), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(16, 185, 129, 0.10), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(139, 92, 246, 0.08), transparent 45%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  scroll-behavior: smooth;
  min-height: 100vh;
  padding-bottom: 3rem;
  margin: 0;
  letter-spacing: -0.01em;
}

[id] { scroll-margin-top: 5.5rem; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }
h1, h2 { color: var(--blue-light); margin: 0; }
i { line-height: 1; }

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--slate-900); }
::-webkit-scrollbar-thumb { background: var(--slate-800); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-600); }

.price-number { font-variant-numeric: tabular-nums; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   کانتینر اصلی
   ========================================================================== */
.page-container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   مودال ماشین‌حساب
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.modal-overlay.is-open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.modal-box {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  width: 92%;
  max-width: 28rem;
  padding: 1.75rem;
  border-radius: 2rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  animation: fadeUp 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-light);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.modal-close {
  color: var(--slate-400);
  font-size: 1.75rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.modal-body { display: flex; flex-direction: column; gap: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--slate-400);
  margin-bottom: 0.5rem;
  margin-right: 0.25rem;
  font-weight: 500;
}
.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  color: #fff;
  text-align: left;
  font-family: monospace;
  font-size: 1.4rem;
  outline: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--blue-dark); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }

.result-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: center;
}
.result-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(52, 211, 153, 0.75);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.result-value { font-size: 1.9rem; font-weight: 900; color: var(--emerald-light); }

.modal-footnote {
  font-size: 10px;
  color: var(--slate-500);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0.25rem 0 0;
}

/* ==========================================================================
   هدر
   ========================================================================== */
.site-header {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem;
}
@media (min-width: 768px) { .site-header { flex-direction: row; } }

.brand { display: flex; align-items: center; gap: 1rem; }
.logo-wrap { position: relative; }
.logo-glow {
  position: absolute;
  inset: -0.35rem;
  background: linear-gradient(135deg, var(--blue), var(--emerald));
  border-radius: 1rem;
  filter: blur(12px);
  opacity: 0.3;
  transition: opacity 0.6s;
}
.brand:hover .logo-glow { opacity: 0.55; }
.logo-img {
  position: relative;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 0.85rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  display: block;
}
.brand-name {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff, var(--blue-light) 65%, var(--emerald-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-underline {
  height: 3px;
  width: 100%;
  margin-top: 0.3rem;
  border-radius: 9999px;
  background: linear-gradient(to left, var(--blue), var(--emerald-light), transparent);
}

.header-right { display: flex; flex-direction: column; align-items: center; }
@media (min-width: 768px) { .header-right { align-items: flex-end; } }

.datetime-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums;
}
.date-block { display: flex; align-items: center; gap: 0.3rem; color: var(--slate-300); }
.date-icon { color: var(--blue-light); font-size: 0.85rem; margin-left: 0.25rem; }
.date-year { color: var(--slate-400); margin-right: 0.25rem; }
.datetime-sep { color: var(--slate-600); }
.time-block { display: flex; align-items: center; gap: 0.5rem; color: var(--emerald-light); min-width: 90px; justify-content: center; }
.time-icon { font-size: 0.85rem; }

.update-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 10.5px;
  color: var(--slate-400);
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  border: 1px solid var(--border-faint);
}
.refresh-timer { color: var(--blue-light); font-weight: 700; margin-left: 0.25rem; }
.live-dot { position: relative; display: flex; height: 0.55rem; width: 0.55rem; }
.live-dot-ping {
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background: var(--emerald-light);
  opacity: 0.75;
}
.live-dot-core {
  position: relative;
  display: inline-flex;
  border-radius: 9999px;
  height: 0.55rem;
  width: 0.55rem;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

/* دکمه ماشین‌حساب */
.calc-btn-wrap { margin-top: 1.75rem; }
.calc-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: var(--blue-light);
  padding: 0.85rem 2rem;
  border-radius: 1.1rem;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
}
@media (min-width: 768px) { .calc-toggle-btn { width: auto; } }
.calc-toggle-btn:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--emerald));
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.calc-toggle-btn i { transition: transform 0.3s; }
.calc-toggle-btn:hover i { transform: rotate(12deg) scale(1.1); }

/* ==========================================================================
   نوار دسترسی سریع (دسته‌بندی بخش‌ها)
   ========================================================================== */
.quick-nav-wrap {
  position: sticky;
  top: 0.6rem;
  z-index: 40;
  margin-top: 1.75rem;
  padding: 0.6rem;
  border-radius: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  /* عمداً بدون backdrop-filter: چون این المان هم چسبناکه (sticky) و هم
     روی گزینه‌هاش هاور می‌شه، ترکیبش با بلور باعث می‌شد کروم موقع هاور
     کل بلورهای صفحه (از جمله کارت‌های قیمت) رو دوباره محاسبه کنه و
     یک لحظه تار/فلاش بزنه. پس‌زمینه‌ی توپُر همون ظاهر رو می‌ده بدون این باگ. */
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.quick-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow:
    inset 18px 0 12px -12px rgba(5, 8, 15, 0.55),
    inset -18px 0 12px -12px rgba(5, 8, 15, 0.55);
}
.quick-nav::-webkit-scrollbar { display: none; }

/* دکمه‌های فلش برای اسکرول منو با ماوس (روی موبایل چون سوایپ راحته مخفی می‌شن) */
.quick-nav-arrow {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--slate-300);
  font-size: 0.8rem;
  transition: background 0.2s, color 0.2s, opacity 0.2s, transform 0.15s, border-color 0.2s;
}
.quick-nav-arrow:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.5);
}
.quick-nav-arrow:active { transform: scale(0.9); }
.quick-nav-arrow.is-disabled { opacity: 0.28; pointer-events: none; }
.quick-nav-arrow.is-hidden { display: none; }

@media (max-width: 767px) {
  .quick-nav-arrow { display: none; }
  .quick-nav { box-shadow: none; }
}

.quick-nav-link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  color: var(--slate-300);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.quick-nav-link i { font-size: 0.85rem; opacity: 0.85; }
.quick-nav-link:hover {
  color: #fff;
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 8px 18px -8px rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   گرید کارت‌ها
   ========================================================================== */
.cards-grid-3 { margin-top: 2.25rem; display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .cards-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.cards-grid-2 { margin-top: 2.25rem; display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .cards-grid-2 { grid-template-columns: repeat(2, 1fr); } }

.crypto-section-wrap { margin-top: 3rem; }

/* کارت‌های قیمت بالای صفحه (بیت‌کوین/تتر/طلا) */
.price-card {
  position: relative;
  padding: 1.6rem;
  border-bottom: 3px solid transparent;
  border-radius: 1.5rem;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.price-card:hover { box-shadow: var(--shadow-lift), 0 0 0 1px rgba(255, 255, 255, 0.06) inset; }
.price-card--orange { border-bottom-color: rgba(251, 146, 60, 0.55); }
.price-card--emerald { border-bottom-color: rgba(16, 185, 129, 0.55); background: linear-gradient(160deg, rgba(16, 185, 129, 0.08), rgba(30, 41, 59, 0.55)); }
.price-card--yellow { border-bottom-color: rgba(234, 179, 8, 0.55); }

.price-card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.price-card-icon { font-size: 2.6rem; }
.icon-orange { color: var(--orange); }
.icon-emerald { color: var(--emerald); }
.icon-yellow { color: var(--yellow); }
.price-card-title { font-size: 1.15rem; font-weight: 700; color: var(--slate-300); }
.price-card-value { font-size: 1.9rem; font-weight: 900; }
.value-emerald { color: var(--emerald); }
.value-yellow { color: var(--yellow-light); }
.price-card-sub { font-size: 1.05rem; color: var(--slate-400); margin-top: 0.5rem; font-weight: 600; }
.sub-orange { color: var(--orange-light); }

/* کارت‌های آماری (تورم/مسکن) */
.stat-card {
  padding: 1.6rem;
  border-bottom: 3px solid transparent;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 185px;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.stat-card:hover { box-shadow: var(--shadow-lift); }
.stat-card--purple { border-bottom-color: rgba(168, 85, 247, 0.55); background: linear-gradient(160deg, rgba(168, 85, 247, 0.08), rgba(30, 41, 59, 0.55)); }
.stat-card--red { border-bottom-color: rgba(239, 68, 68, 0.55); background: linear-gradient(160deg, rgba(239, 68, 68, 0.08), rgba(30, 41, 59, 0.55)); }
.stat-card--indigo { border-bottom-color: rgba(99, 102, 241, 0.55); background: linear-gradient(160deg, rgba(99, 102, 241, 0.08), rgba(30, 41, 59, 0.55)); }

.stat-card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.stat-card-icon { font-size: 2.6rem; }
.icon-purple { color: var(--purple); }
.icon-red { color: var(--red); }
.icon-indigo { color: var(--indigo); }
.stat-card-title { font-size: 1.3rem; font-weight: 700; color: #fff; }
.stat-card-value { font-size: 2.1rem; font-weight: 700; }
.value-purple { color: var(--purple-light); }
.value-red { color: var(--red-light); }
.value-indigo { color: var(--indigo-light); }

.stat-card-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border-faint); }
.stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.stat-row + .stat-row { margin-top: 0.3rem; }
.stat-row-label { color: var(--gray-400); }
.stat-row-value { font-weight: 700; }
.rv-emerald { color: var(--emerald); }
.rv-rose { color: var(--rose); }
.rv-orange { color: var(--orange); }
.stat-date-row { text-align: left; margin-top: 0.5rem; }
.stat-date { font-size: 10px; color: var(--gray-500); }

.section-gap-top { margin-top: 1.5rem; }

/* ==========================================================================
   جدول‌ها
   ========================================================================== */
.tables-grid-3 { margin-top: 3.5rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .tables-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.tables-grid-2 { margin-top: 3.5rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .tables-grid-2 { grid-template-columns: repeat(2, 1fr); } }

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  position: relative;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  margin-right: 0.5rem;
  background: linear-gradient(to left, var(--border-soft), transparent);
}
.section-title-icon { font-size: 1.05rem; }
.section-title-icon.icon-amber { color: var(--amber); }
.section-title-icon.icon-red { color: var(--red); }
.section-title-icon.icon-blue { color: var(--blue-light); }
.section-title-icon.icon-sky { color: var(--sky); }
.section-title-icon.icon-violet { color: var(--violet); }

.table-container { overflow: hidden; border-radius: 1.2rem; }
.table-scroll { overflow-x: auto; }

.data-table { width: 100%; font-size: 0.875rem; text-align: right; border-collapse: collapse; }
.data-table thead tr { background: linear-gradient(90deg, rgba(59, 130, 246, 0.14), rgba(51, 65, 85, 0.4)); }
.data-table th {
  padding: 1rem 1.1rem;
  font-weight: 700;
  color: var(--slate-300);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}
.data-table td { padding: 0.95rem 1.1rem; }
.data-table th.align-left, .data-table td.align-left { text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border-faint); transition: background 0.2s; }
.data-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.data-table tbody tr:hover { background: rgba(59, 130, 246, 0.07); }
.data-table tbody tr:last-child { border-bottom: none; }

.symbol-tag { font-size: 10px; color: var(--slate-500); margin-right: 0.35rem; }
.change-up { color: var(--emerald); font-weight: 700; direction: ltr; display: inline-block; }
.change-down { color: var(--red); font-weight: 700; direction: ltr; display: inline-block; }
.muted-toman { color: var(--slate-400); }
.rtl-embed { display: inline-block; direction: ltr; unicode-bidi: embed; }

/* ==========================================================================
   فوتر
   ========================================================================== */
.site-footer { margin-top: 5.5rem; padding-bottom: 2.5rem; }
.footer-divider-wrap { max-width: 80rem; margin: 0 auto 2.75rem; padding: 0 1rem; }
.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.55), rgba(16, 185, 129, 0.35), transparent);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}
.footer-content { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.footer-brand-row { display: flex; align-items: center; gap: 0.75rem; color: var(--slate-400); font-weight: 500; }
.footer-brand-name { color: var(--blue-light); font-weight: 800; font-size: 1.25rem; }
.footer-vdivider { height: 1rem; width: 1px; background: var(--slate-600); }
.footer-tagline { font-size: 0.875rem; letter-spacing: 0.02em; }
.footer-social { margin-top: 1.5rem; }
.social-circle {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 9999px;
  background: var(--slate-800);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-faint);
  transition: background 0.3s, box-shadow 0.3s;
}
.social-circle:hover { background: linear-gradient(135deg, var(--blue-dark), var(--emerald)); box-shadow: 0 0 18px rgba(37, 99, 235, 0.55); }
.social-circle i { color: #fff; font-size: 1.2rem; }
.footer-copy { margin-top: 1.5rem; color: var(--slate-500); font-size: 11px; }
.footer-copy span { color: var(--slate-400); }
