/* ═══════════════════════════════════════════════
   میهن‌ارز — main.css
   Theme: Light / Clean / Trustworthy
═══════════════════════════════════════════════ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ── VARIABLES ── */
:root {
  --white:      #ffffff;
  --bg:         #f4f6f9;
  --bg-card:    #ffffff;
  --bg-hover:   #f8fafc;
  --border:     #e2e8ef;
  --border-md:  #cdd5e0;

  --blue:       #1a56db;
  --blue-lt:    #eff4ff;
  --blue-md:    #3b82f6;

  --green:      #0d9f6e;
  --green-bg:   #ecfdf5;
  --red:        #e02424;
  --red-bg:     #fff5f5;
  --gold:       #d97706;
  --gold-bg:    #fffbeb;

  --text-1:     #111928;
  --text-2:     #374151;
  --text-3:     #6b7280;
  --text-4:     #9ca3af;

  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 12px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md:  0 8px 24px rgba(0,0,0,.09);
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  direction: rtl;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

/* ════════════════════════════════════════════
   HEADER
════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a56db, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(26,86,219,.3);
}

.logo-text {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.3px;
}

.logo-text strong {
  font-weight: 900;
  color: var(--blue);
}

/* Main Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-nav a {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  transition: all .18s;
}

.main-nav a:hover { color: var(--text-1); background: var(--bg); }
.main-nav a.active { color: var(--blue); background: var(--blue-lt); }

/* Header Left */
.header-left { display: flex; align-items: center; gap: 10px; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-bg);
  border: 1px solid rgba(13,159,110,.2);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%,100% { opacity:1; }
  50%      { opacity:.3; }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  padding: 8px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all .2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 8px 16px 12px;
  gap: 2px;
  background: var(--white);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  transition: background .15s;
}

.mobile-nav a:hover { background: var(--bg); }
.mobile-nav a.active { color: var(--blue); background: var(--blue-lt); }

/* ════════════════════════════════════════════
   TICKER
════════════════════════════════════════════ */
.ticker-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
}

.ticker-label {
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  letter-spacing: .3px;
}

.ticker-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerMove 45s linear infinite;
}

@keyframes tickerMove {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.t-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  border-left: 1px solid var(--border);
  font-size: 12.5px;
}

.t-name  { color: var(--text-3); font-weight: 600; }
.t-price { color: var(--text-1); font-weight: 700; }
.t-chg.up { color: var(--green); font-weight: 700; font-size: 11px; }
.t-chg.dn { color: var(--red);   font-weight: 700; font-size: 11px; }

/* ════════════════════════════════════════════
   PAGE CONTAINER
════════════════════════════════════════════ */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ════════════════════════════════════════════
   SECTION TITLE
════════════════════════════════════════════ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 18px;
  background: var(--blue);
  border-radius: 3px;
}

.section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}

.section-more:hover { gap: 7px; }

/* ════════════════════════════════════════════
   CARDS
════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── PRICE TABLE ── */
.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table thead th {
  text-align: right;
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.price-table thead th:first-child { border-radius: 0; }

.price-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.price-table tbody tr:last-child { border-bottom: none; }
.price-table tbody tr:hover { background: var(--bg-hover); }

.price-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-2);
}

/* Currency cell */
.cur-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cur-flag {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cur-name { font-weight: 700; color: var(--text-1); font-size: 14px; }
.cur-code { font-size: 11px; color: var(--text-4); font-weight: 500; margin-top: 1px; }

/* Price cell */
.price-cell {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
}

/* Change badge */
.chg-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  direction: ltr;
}

.chg-badge.up { background: var(--green-bg); color: var(--green); }
.chg-badge.dn { background: var(--red-bg);   color: var(--red); }
.chg-badge.nc { background: #f3f4f6; color: var(--text-4); }

/* Chart sparkline area */
.sparkline { width: 80px; height: 32px; }

/* ── MINI CARD (hero stats) ── */
.mini-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}

.mini-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.mini-card-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-card-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: -.5px;
  line-height: 1.1;
}

.mini-card-sub {
  font-size: 11.5px;
  margin-top: 5px;
  font-weight: 600;
}

/* ── TAB STRIP ── */
.tab-strip {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 5px;
  transition: all .15s;
}

.tab-btn.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) { color: var(--text-1); }

/* ── TABLE SECTION WRAPPER ── */
.table-section { margin-bottom: 36px; }

.table-section .card { overflow: hidden; }

/* ── UPDATE TIME ── */
.update-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-4);
}

.update-row strong { color: var(--text-3); }

/* ════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 52px 0 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand .logo-text { font-size: 18px; }

.footer-brand p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.9;
  margin-top: 12px;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.social-link {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all .2s;
}

.social-link:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-lt); }

.footer-col h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  padding: 4px 0;
  transition: color .15s;
}

.footer-col a:hover { color: var(--blue); }
.footer-col a:last-child { color: var(--blue); font-weight: 700; margin-top: 4px; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.footer-bottom p { font-size: 12px; color: var(--text-4); }

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 12px;
  color: var(--text-4);
  font-weight: 500;
  transition: color .15s;
}

.footer-bottom-links a:hover { color: var(--blue); }

/* ════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════ */
.mb-0 { margin-bottom: 0 !important; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-gold  { color: var(--gold); }
.fw-700     { font-weight: 700; }
.fw-800     { font-weight: 800; }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .mini-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .page-wrap { padding: 16px 16px 48px; }

  .price-table thead th:nth-child(5),
  .price-table td:nth-child(5) { display: none; } /* hide sparkline on mobile */

  .mini-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 480px) {
  .mini-cards { grid-template-columns: 1fr; }
  .mini-card-value { font-size: 18px; }
}
