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

:root {
  /* Colors - Light Mode (Premium Day) */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --header-bg: rgba(248, 250, 252, 0.8);
  --footer-bg: #0f172a;

  --border: rgba(0, 0, 0, 0.06);
  --border-bright: rgba(0, 0, 0, 0.1);
  --glass-border: rgba(0, 0, 0, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-2: #06b6d4;

  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --gold: #f59e0b;
  --gold-bg: rgba(245, 158, 11, 0.12);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 32px;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  --blur: 15px;
}

body.dark-mode {
  /* Colors - Dark Mode (Premium Night) */
  --bg-primary: #040712;
  --bg-secondary: #0a0f24;
  --bg-glass: rgba(20, 28, 46, 0.7);
  --bg-card: #0d122b;
  --bg-card-hover: #151b3d;
  --header-bg: rgba(4, 7, 18, 0.75);
  --footer-bg: #03050d;

  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.1);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}

body.dark-mode {
  background: radial-gradient(circle at top, #0f1535 0%, #03040a 100%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

/* ===== TICKER ===== */
.ticker-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 40px;
  display: flex;
  align-items: center;
}

.ticker-label {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 6px;
}

.ticker-track {
  display: flex;
  animation: ticker-slide 60s linear infinite;
  align-items: center;
  height: 100%;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  font-size: 12px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}

.ticker-item .t-name {
  color: var(--text-secondary);
}

.ticker-item .t-price {
  font-weight: 600;
}

.ticker-item .t-change {
  font-size: 11px;
}

.ticker-item .t-change.up {
  color: var(--green);
}

.ticker-item .t-change.down {
  color: var(--red);
}

@keyframes ticker-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Header */
header {
  background-color: var(--header-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

header.scrolled {
  padding: 8px 0;
  background-color: rgba(4, 7, 18, 0.9);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo img {
  height: 40px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  border-color: var(--accent-color);
}

/* Theme Toggle */
#theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.section-header h2 {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
}

#live-clock {
  font-weight: 700;
  color: var(--accent-2);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hidden by default – shown only via media query */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-close {
  display: none;
}

.nav-links-desktop {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}

@media (max-width: 900px) {
  .nav-links-desktop {
    display: none;
  }
}

.nav-btn {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.nav-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.nav-btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
}

.nav-btn.price-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow-soft);
  border-color: var(--accent);
}

.price-card.btn-fav {
  border-color: var(--warning);
}

/* Favorites Header & Buttons */
.fav-btn,
.fav-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn.active,
.fav-icon-btn.active {
  color: #facc15;
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.5));
}

.fav-btn:hover,
.fav-icon-btn:hover {
  color: #fde047;
  transform: scale(1.2);
}

.fav-row {
  background: rgba(250, 204, 21, 0.03);
}

/* Sentiment Badges */
.card-sentiment {
  margin: 10px 0;
}

.sentiment-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sentiment-buy-strong {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sentiment-buy {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

.sentiment-sell-strong {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sentiment-sell {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.sentiment-neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
}

/* ===== MAIN ===== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== ANNOUNCEMENT ===== */
.announcement {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.15), rgba(0, 212, 255, 0.08));
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  display: none;
}

.announcement.show {
  display: flex;
}

/* ===== HERO STATS ===== */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.stat-icon {
  font-size: 24px;
}

.stat-info .label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.stat-info .value {
  font-size: 15px;
  font-weight: 800;
}

.stat-info .value.up {
  color: var(--green);
}

.stat-info .value.down {
  color: var(--red);
}

.stat-info .value.gold {
  color: var(--gold);
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ===== PRICE GRID & GROUPING ===== */
.price-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 40px;
}

.category-header {
  margin-bottom: 20px;
  padding-right: 12px;
  border-right: 4px solid var(--accent);
}

.category-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.price-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
  overflow-visible: true;
  padding-bottom: 15px;
}

.price-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.price-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.price-card:hover::before {
  opacity: 1;
}

.price-card.up::before {
  background: var(--green);
  opacity: 0.6;
}

.price-card.down::before {
  background: var(--red);
  opacity: 0.6;
}

/* List View - Alanchand Style */
.price-list-container {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.price-list-table {
  width: 100%;
  border-collapse: collapse;
}

.price-list-table th {
  background-color: var(--bg-secondary);
  padding: 10px 14px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.price-list-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.85rem;
}

.price-list-table tr:last-child td {
  border-bottom: none;
}

.price-list-table tr:hover {
  background-color: var(--bg-card-hover);
}

.list-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-item-icon {
  font-size: 1.4rem;
  width: 32px;
}

.list-item-crypto-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-crypto-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.price-card:hover .card-crypto-icon {
  transform: scale(1.1) rotate(5deg);
}

.list-item-names {
  display: flex;
  flex-direction: column;
}

.list-item-fa {
  font-weight: 700;
  font-size: 0.95rem;
}

.list-item-en {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.list-price {
  font-weight: 800;
  font-size: 0.95rem;
}

.list-unit {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-right: 5px;
}

.list-change {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Buy / Sell cells in currency table */
.buysell-cell {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.buysell-cell.buy {
  color: var(--red);
  background: var(--red-bg);
}

.buysell-cell.sell {
  color: var(--green);
  background: var(--green-bg);
}

.price-list-table th.col-buy,
.price-list-table td.col-buy {
  border-left: 1px solid var(--border);
}

.price-list-table th.col-sell,
.price-list-table td.col-sell {
  border-left: 1px solid var(--border);
}

/* Footer Improvements */
/* Footer Premium */
footer {
  background-color: var(--footer-bg);
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 100px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 60px;
  padding: 0 24px;
}

@media (max-width: 1200px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 16px;
  }
}

.footer-brand .logo-text {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  opacity: 0.8;
}

.footer-links h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
}

.footer-links h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--accent-light);
  transform: translateX(-5px);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-bottom strong {
  color: var(--text-secondary);
}

/* Utilities */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.update-flash {
  animation: flash 0.8s ease-out;
}

@keyframes flash {
  0% {
    background: var(--bg-card);
  }

  50% {
    background: var(--accent-glow);
  }

  100% {
    background: var(--bg-card);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  font-size: 22px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
}

.card-en {
  font-size: 11px;
  color: var(--text-muted);
}

.card-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
}

.badge-currency {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-2);
}

.badge-gold {
  background: var(--gold-bg);
  color: var(--gold);
}

.badge-coin {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.badge-crypto {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
}

.card-price {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  direction: ltr;
  text-align: right;
}

.card-unit {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.card-change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.change-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
}

.change-badge.up {
  background: var(--green-bg);
  color: var(--green);
}

.change-badge.down {
  background: var(--red-bg);
  color: var(--red);
}

.change-badge.neutral {
  background: var(--border);
  color: var(--text-secondary);
}

.change-amount {
  font-size: 12px;
  color: var(--text-muted);
  direction: ltr;
}

.sparkline-container {
  height: 40px;
  overflow: hidden;
  position: relative;
}

.sparkline-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.update-flash {
  animation: flash 0.6s ease;
}

/* ===== CHART SECTION ===== */
.chart-section {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 28px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-controls {
  display: flex;
  gap: 6px;
}

.period-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.chart-symbol-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Vazirmatn', sans-serif;
}

#main-chart-container {
  height: 200px;
  position: relative;
}

/* ===== CONVERTER ===== */
.converter-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: end;
}

.conv-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.conv-field input,
.conv-field select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'Vazirmatn', sans-serif;
  direction: ltr;
  text-align: right;
}

.conv-field input:focus,
.conv-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.swap-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(180deg);
}

.conv-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-2);
  direction: ltr;
}

.conv-result-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 400;
  direction: rtl;
}

/* ===== API TEASER ===== */
.api-section {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.12), rgba(0, 212, 255, 0.06));
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 28px;
}

.api-section h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}

.api-section p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 500px;
  margin-right: auto;
  margin-left: auto;
}

.api-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.plan-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.plan-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin: 8px 0;
}

.plan-limit {
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-brand .logo-text {
  font-size: 22px;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.footer-bottom {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-close {
  float: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Vazirmatn', sans-serif;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-full {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Vazirmatn', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
  transition: opacity 0.5s;
}

.loading-overlay.fade {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== TOOLBOX ===== */
.toolbox-section {
  margin: 40px 0;
  padding: 32px;
}

.toolbox-section .section-header {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.toolbox-section .section-header p {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
}

.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tool-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.tool-modal-content {
  max-width: 500px !important;
}

.tool-result {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-result strong {
  font-size: 18px;
  color: var(--accent);
}

.converter-box {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.converter-box input {
  flex: 1;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
}

.converter-box select {
  width: 140px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0 10px;
  font-family: 'Vazirmatn', sans-serif;
}

@media (max-width: 768px) {
  .toolbox-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-section {
    padding: 24px 16px;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .toolbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nav-links-desktop {
    display: none;
  }

  .header-center {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
  }

  .mobile-menu-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  /* Side-drawer from RIGHT (RTL site) */
  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    left: auto;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 80px 24px 40px;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1001;
    gap: 12px;
    align-items: stretch;
    display: flex;
  }

  .header-nav.active {
    right: 0;
  }

  .nav-btn {
    width: 100%;
    text-align: right;
    padding: 14px 20px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-btn.primary {
    margin-top: 10px;
    justify-content: center;
  }

  #theme-toggle {
    width: 100%;
    border-radius: 12px;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 20px;
    font-size: 15px;
  }

  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .overlay-active {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
  }

  .overlay-active.show {
    display: block;
  }
}

@media (max-width: 768px) {
  .price-list-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px 30px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .price-list-table th,
  .price-list-table td {
    padding: 8px 4px;
    font-size: 11px;
  }

  .price-list-table th:nth-child(5),
  .price-list-table td:nth-child(5) {
    display: none;
  }

  .price-list-table th.col-minmax,
  .price-list-table td.col-minmax {
    display: none;
  }

  .list-item-fa {
    font-size: 13px;
  }

  .list-price {
    font-size: 11px;
  }

  .buysell-cell {
    font-size: 0.65rem;
    padding: 2px 3px;
    word-break: keep-all;
    white-space: nowrap;
  }

  .hero-stats {
    gap: 12px;
  }

  .stat-card {
    padding: 15px;
    gap: 10px;
  }

  .stat-icon {
    font-size: 20px;
  }

  .stat-info .value {
    font-size: 14px;
  }

  /* Chart header stacks */
  .chart-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .chart-header-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .chart-symbol-select {
    width: 100%;
  }

  /* Converter stacks vertically */
  .converter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .swap-btn {
    width: 100%;
    border-radius: var(--radius-sm);
    height: 44px;
  }

  /* API plans 2-col */
  .api-plans {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer stays 2-col until 480px */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  /* News grid single col */
  .news-section {
    margin-top: 24px !important;
    padding: 20px !important;
  }

  .news-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  header {
    padding: 8px 0;
  }

  .header-container {
    padding: 0 12px;
    gap: 8px;
  }

  .logo-sub {
    display: none;
  }

  .logo-text {
    font-size: 16px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  main {
    padding: 12px 12px 60px;
  }

  .category-tabs {
    margin-bottom: 25px;
    padding-bottom: 8px;
    gap: 6px;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .price-section-grid {
    grid-template-columns: 1fr;
  }

  .price-card {
    padding: 16px;
  }

  .card-price {
    font-size: 18px;
  }

  /* Chart smaller height */
  #main-chart-container {
    height: 220px;
  }

  /* Chart controls full width */
  .chart-controls {
    width: 100%;
    justify-content: space-between;
  }

  .period-btn {
    flex: 1;
    text-align: center;
  }

  /* Converter result smaller */
  .conv-result {
    font-size: 18px;
  }

  /* API plans single column */
  .api-plans {
    grid-template-columns: 1fr;
  }

  .api-section {
    padding: 20px 16px;
  }

  .api-section h2 {
    font-size: 18px;
  }

  /* Footer fully single column */
  .footer-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

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

  /* Toolbox single col */
  .toolbox-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-section {
    padding: 24px 16px;
  }

  /* Section header stacks */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Ticker compact */
  .ticker-label {
    padding: 0 10px;
    font-size: 11px;
  }

  .ticker-item {
    padding: 0 14px;
  }

  /* Mobile menu button smaller */
  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
}

/* ===== NEWS CARDS ===== */
.news-section {
  border-radius: var(--radius);
}

/* Skeleton loader */
.news-skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  height: 240px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* News card */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  color: var(--text-primary);
}

.news-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-glow);
}

.news-card-img {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.news-card-img--noimg {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  height: 100px;
}

.news-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.news-source-badge {
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.news-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card:hover .news-card-title {
  color: var(--accent-light);
}

.news-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .news-card-img {
    height: 120px;
  }
}

/* ===== CHART & CONVERTER LAYOUT FIX ===== */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  overflow: hidden;
}

#main-chart-container {
  width: 100%;
  height: 420px;
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  position: relative;
}

#tv-widget-container {
  width: 100% !important;
  height: 420px !important;
  max-height: 420px !important;
  overflow: hidden !important;
  display: block;
}

#tv-widget-container>div,
#tv-widget-container iframe {
  width: 100% !important;
  height: 420px !important;
  max-height: 420px !important;
  border: none !important;
  display: block !important;
}

.converter-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}