@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0 07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* ===================== VARIABLES ===================== */
:root {
  --bg: linear-gradient(135deg, #0b1020, #141a3a, #0b1020);
  --glass: rgba(255,255,255,.06);
  --glass-border: rgba(255,255,255,.1);
  
  --accent-color: #ffffff;
  --accent-dark: #e0f2fe;
  --positive: #22c55e;
  --negative: #ef4444;
  --text: #e5e7eb;
  --text-light: #9ca3af;
  --radius: 18px;
  --blur: 18px;
  --shadow: 0 15px 45px rgba(0,0,0,.5);
}

body.light {
  --bg: linear-gradient(135deg, #f8fafc, #e5e7eb);
  --glass: rgba(255,255,255,.7);
  --glass-border: rgba(0,0,0,.08);
  --accent-color: #000000;
  --accent-dark: #0ea5e9;
  --text: #111827;
  --text-light: #4b5563;
}

/* ===================== BASE ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--bg);
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  margin: 0;
  padding-top: env(safe-area-inset-top);
  min-height: 100vh;
    font-family: 'IRANSans', 'Vazirmatn', system-ui, -apple-system, sans-serif;

  color: var(--text);
  touch-action: manipulation;
}

body.light {
  color: var(--text);
}
@font-face {
  font-family: 'IRANSans';
  src: url('/fonts/IRANSans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===================== FONTS ===================== */
@font-face {
  font-family: 'Lalezar';
  src: url('/fonts/Lalezar.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Estedad';
  src: url('/fonts/Estedad-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'IRANSans', 'Vazirmatn', system-ui, -apple-system, sans-serif;
}




body.font-estedad {
  font-family: 'Estedad', system-ui, sans-serif;
}

header {
  position: sticky;
  z-index: 1000;
  padding: 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-color), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--accent-color);
  cursor: pointer;
}

/* ===================== HAMBURGER ===================== */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.hamburger span {
  width: 32px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
  transition: .4s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  padding: 80px 20px;
  transition: .5s cubic-bezier(.23,1,.32,1);
  z-index: 999;
}

.sidebar.open { right: 0; }

.sidebar li {
  list-style: none;
  padding: 1rem;
  margin: .4rem 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.sidebar li.active,
.sidebar li:hover {
  background: rgba(255,255,255,.12);
  color: var(--accent-color);
}

/* ===================== MAIN ===================== */
main {
  max-width: 1400px;
  margin: auto;
  padding: clamp(0.8rem, 2vw, 1.2rem);
}


.section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: .5s;
}

.section.active {
  display: block;
  opacity: 1;
  transform: none;
}

h1 {
  text-align: center;
  margin: 1.5rem 0 2rem;
  font-size: 2.4rem;
}

/* ===================== UNIFIED CARD GRID ===================== */
.grid, .list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: .3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 60px rgba(0,0,0,.6);
}


.card-icon {
  font-size: 2.1rem;
  color: var(--accent-color);
}

.price {
  font-size: 2.7rem;
  margin: .6rem 0;
  font-weight: 700;
}

.change.positive { color: var(--positive); }
.change.negative { color: var(--negative); }

.loader {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-light);
}

/* ===================== SEARCH ===================== */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  position: sticky;
  top: 90px;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
}

/* ===================== HOME SECTION - UNIFIED RESPONSIVE CARDS ===================== */
/* Mobile: 2 cards per row, Tablet+: auto-fit */
.home-section .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);  /* Mobile: always 2 per row */
  gap: clamp(0.6rem, 2vw, 1.4rem);
}

/* Tablet and larger: auto-fit for more columns */
@media (min-width: 600px) {
  .home-section .grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Main Card - Unified style across all screen sizes */
.home-section .main-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  padding: clamp(0.7rem, 2vw, 1.2rem);
  border-radius: 24px !important;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Card Header - Title on LEFT, Icon on RIGHT */
.home-section .main-card .card-header {
  position: absolute;
  top: clamp(0.5rem, 1.5vw, 0.8rem);
  left: clamp(0.5rem, 1.5vw, 0.8rem);
  right: clamp(0.5rem, 1.5vw, 0.8rem);
  width: calc(100% - clamp(1rem, 3vw, 1.6rem));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

/* Title - LEFT corner (larger size) */
.home-section .main-card h3 {
  order: 1;
  font-size: clamp(1.35rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  text-align: left;
}

/* Icon - RIGHT corner */
.home-section .main-card img.card-icon,
.home-section .main-card .card-icon {
  order: 2;
  width: clamp(1.8rem, 4.5vw, 3rem);
  height: clamp(1.8rem, 4.5vw, 3rem);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  object-fit: contain;
  flex-shrink: 0;
}

/* Change percentage - center of card */
.home-section .main-card .change {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(0.9rem, 2.2vw, 1.3rem);
  font-weight: 700;
}

/* Price - bottom left (below change percentage) */
.home-section .main-card .price {
  position: absolute;
  bottom: clamp(0.5rem, 1.5vw, 0.8rem);
  left: clamp(0.5rem, 1.5vw, 0.8rem);
  font-size: clamp(1.9rem, 4.8vw, 3.6rem);
  font-weight: 900;
  letter-spacing: clamp(-0.8px, -0.12vw, -1.4px);
  line-height: 1.1;
  text-align: left;
}

/* Card trend background */
.card.up {
  background: linear-gradient(135deg, rgba(34,197,94,.12), var(--glass));
  border-color: rgba(34,197,94,.35);
}

.card.down {
  background: linear-gradient(135deg, rgba(239,68,68,.12), var(--glass));
  border-color: rgba(239,68,68,.35);
}

/* Hover effect for cards */
.home-section .main-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.card.up:hover {
  box-shadow: 0 8px 20px rgba(34,197,94,.2);
}

.card.down:hover {
  box-shadow: 0 8px 20px rgba(239,68,68,.2);
}


@keyframes flashGreen {
  0% { background: rgba(34,197,94,.35); }
  100% { background: transparent; }
}

@keyframes flashRed {
  0% { background: rgba(239,68,68,.35); }
  100% { background: transparent; }
}

@keyframes priceJumpUp {
  0% {
    transform: translateY(-6px) scale(1.06);
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34,197,94,0.5);
  }
  60% {
    transform: translateY(2px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
    color: inherit;
    text-shadow: none;
  }
}

@keyframes priceJumpDown {
  0% {
    transform: translateY(6px) scale(1.06);
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239,68,68,0.5);
  }
  60% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
    color: inherit;
    text-shadow: none;
  }
}


.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.18), rgba(255,255,255,.08));
  background-size: 200% 100%;
  animation: skeleton 1.3s infinite;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

/* ===================== CONVERTER ===================== */
.converter-card {
  margin-top: 0rem;
  padding: 1.6rem;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.converter-card h2 {
  text-align: center;
  margin-bottom: 1.4rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.converter-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}

.converter-row input,
.converter-row select {
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

.converter-row span {
  font-size: 1.4rem;
  opacity: .7;
}

.converter-result {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-color);
}

/* ===================== SEARCHABLE SELECT ===================== */
.select-box {
  position: relative;
}

.select-box input {
  width: 100%;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
}

body.light .select-box input {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

body.light .select-box input::placeholder {
  color: #6b7280;
}

.options {
  position: absolute;
  top: 110%;
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  z-index: 100;
  display: none;
  border-radius: 16px;
}

.options.dark {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
}

.options.dark div {
  color: #e5e7eb;
}

.options.dark div:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.options.light {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  color: #111827;
}

.options.light div {
  color: #111827;
}

.options.light div:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #0ea5e9;
}

.options div {
  padding: .8rem 1.1rem;
  cursor: pointer;
  font-size: .95rem;
  transition: .25s;
  border-radius: 10px;
}

input, select, textarea {
  font-size: 16px !important;
}

/* ===================== CARD ROW ===================== */
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-row .title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
}

.card-row .price {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}

.card-row .change {
  flex: 0 0 auto;
  min-width: 70px;
  text-align: left;
  font-size: .9rem;
  font-weight: 700;
}

.card-row .change.positive { color: #22c55e; }
.card-row .change.negative { color: #ef4444; }

/* ===================== HOME DATE & TIME ===================== */
.home-datetime {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: .4rem .8rem;
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  opacity: .9;
}

body.light .home-datetime {
  color: #111827;
  opacity: 1;
}

.home-datetime span {
  white-space: nowrap;
}

/* ===================== OFFLINE BAR ===================== */
#offline-bar {
  display: none;
  position: sticky;
  top: 72px;
  z-index: 999;
  margin: 0 1rem 1rem;
  padding: .7rem 1rem;
  text-align: center;
  border-radius: 14px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.35);
  color: #fecaca;
  backdrop-filter: blur(12px);
  font-weight: 600;
}

#offline-bar.show {
  display: block;
}

/* ===================== TRENDS ===================== */
.trend-wrapper {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.trend-card {
  padding: 1.4rem;
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
}

.trend-card.up {
  background: linear-gradient(135deg, rgba(34,197,94,.18), var(--glass));
  border-color: rgba(34,197,94,.35);
}

.trend-card.down {
  background: linear-gradient(135deg, rgba(239,68,68,.18), var(--glass));
  border-color: rgba(239,68,68,.35);
}

.trend-card h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 800;
}

.trend-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  font-size: .95rem;
}

.trend-item .name {
  font-weight: 600;
}

.trend-item .change {
  font-weight: 800;
}

/* ===================== QUICK NAV GRID ===================== */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 2vw, 1.1rem);
  margin: 2.2rem 0 1.8rem;
}

.quick-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(0.9rem, 2vw, 1.3rem) clamp(0.7rem, 1.5vw, 0.9rem);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
  color: var(--text);
  min-height: clamp(100px, 20vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.quick-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
  background: rgba(255,255,255,.11);
  color: var(--accent-color);
}

.quick-icon {
  transition: transform 0.25s ease, color 0.25s ease;
  margin-bottom: 0.8rem;
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
}

.quick-icon.currency { color: #22c55e; }
.quick-icon.gold { color: #f59e0b; }
.quick-icon.crypto { color: #f7931a; }

body.light .quick-icon.currency { color: #16a34a; }
body.light .quick-icon.gold { color: #d97706; }
body.light .quick-icon.crypto { color: #c2410c; }

.quick-card span {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 600;
}

/* ===================== MODAL ===================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 2vw;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: 90vw;
  max-width: 1380px;
  min-width: 340px;
  margin: 5vh auto;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 70px rgba(0,0,0,0.62);
  animation: modalFadeIn 0.28s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 2.2rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--negative);
  transform: rotate(90deg);
  transition: all 0.25s;
}

/* ===================== SECTION HEADER ===================== */
.section-header {
  position: sticky;
  top: 0 !important;  
z-index: 999;
  margin: 0 1rem 1.6rem;
  padding: 1.1rem 1.4rem;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
  
}

.section-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 700px;
  margin: 0 auto;
}

#current-section-title {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  text-align: center;
  flex: 1;
  line-height: 1.35;
  padding: 0 1rem;
}

.back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-light);
  width: clamp(40px, 8vw, 48px);
  height: clamp(40px, 8vw, 48px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.back-btn:hover {
  background: rgba(56,189,248,0.22);
  color: var(--accent-color);
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(56,189,248,0.25);
}

.back-btn i {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
}

/* ===================== SWITCH ===================== */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

body.light .slider {
  background-color: #999;
}

/* ===================== SETTINGS ITEM ===================== */
.settings-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.settings-item:hover {
  background: rgba(56,189,248,0.15);
  color: var(--accent-color);
  transform: translateX(4px);
}

.settings-item i {
  font-size: 1.4rem;
  width: 32px;
  text-align: center;
  color: var(--accent-color);
}

body.light .settings-item {
  background: rgba(0,0,0,0.04);
}

body.light .settings-item:hover {
  background: rgba(56,189,248,0.12);
}
.telegram-box {
  position: relative;
  margin: 1.2rem auto 1.8rem;
  max-width: 1000px;
  width: calc(100% - 0rem);
}
/* 
.instagram-box,


.ads-badge {
  position: absolute;
  top: -6px;
  right: 14px;
  background: rgba(249, 115, 22, 0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  line-height: 1.2;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(249,115,22,.25);
  z-index: 2;
  opacity: 0.85;
}

.instagram-box a,
.instagram-box a,
.telegram-box a {
  display: flex;
  align-items: center;
  justify-content: center;   
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;   
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}


.instagram-box a:hover,
.telegram-box a:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.12);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.instagram-box i {
  font-size: 1.8rem;
  color: #e1306c;
}

.telegram-box i {
  font-size: 1.8rem;
  color: #229ED9;
}

.instagram-box span,
.telegram-box span {
  margin: 0;
  text-align: center;
}


.instagram-box small,
.telegram-box small {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0ea5e9;
}

/* ===================== VPN ALERT MODAL ===================== */
#vpn-alert-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#vpn-alert-modal.show {
  display: flex;
}

.vpn-alert-content {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  color: #fff;
  backdrop-filter: blur(var(--blur));
  box-shadow: 0 25px 60px rgba(239, 68, 68, 0.25);
}

.vpn-alert-content h2 {
  color: #fecaca;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.vpn-alert-content p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  opacity: 0.9;
}

.vpn-alert-content button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.vpn-alert-content button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}


/* استایل نگهدارنده کل صفحه لودینگ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg, #ffffff); /* رنگ پس‌زمینه لودینگ - از متغیرهای سایتتان استفاده کنید */
    z-index: 9999; /* قرارگیری روی تمام عناصر صفحه */
    
    /* کدهای مربوط به وسط‌چین کردن دقیق لوگو */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* برای محو شدن نرم (fade-out) */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* زمانی که جاوااسکریپت کلاس hide را اضافه می‌کند */
#loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

/* استایل لوگو (همان انیمیشن قبلی) */
.loading-logo {
    width: 150px; /* اندازه لوگو را اینجا تنظیم کنید */
    height: auto;
    object-fit: contain;
    animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}





@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-dots::after {
  content: '';
  animation: dots 1.4s infinite steps(4, end);
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ===================== UPDATE BADGES ===================== */
.update-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.update-inline-badge {
  margin-right: auto;
  color: #ef4444;
  font-weight: 900;
  font-size: 1rem;
}

/* ===================== CRYPTO CARD CONTENT ===================== */
.crypto-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.crypto-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.crypto-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.crypto-change {
  font-size: 1.35rem;
  font-weight: 800;
  min-width: 75px;
  text-align: right;
}

.crypto-change.positive { color: var(--positive); }
.crypto-change.negative { color: var(--negative); }

.crypto-prices-row {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.price-separator {
  color: var(--text-light);
  opacity: 0.5;
  font-weight: normal;
  white-space: pre;
  flex-shrink: 0;
}

.price-usd {
  font-size: clamp(1.2rem, 2.5vw, 1.38rem);
  font-weight: 800;
  color: var(--accent-color);
  white-space: nowrap;
}

.price-toman {
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  font-weight: 600;
  color: var(--text-light);
  opacity: 0.92;
  text-align: right;
  white-space: nowrap;
}

/* ===================== FONT SELECT ===================== */
.font-select-wrapper {
  position: relative;
  width: 180px;
  direction: rtl;
}

.font-select {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s ease;
}

.font-select:hover {
  border-color: var(--accent-color);
}

.font-select:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

.font-select-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9rem;
  color: var(--text-light);
}

.font-select option {
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

/* ===================== CARD TYPE COLORS ===================== */
.main-card[data-type="btc"] .card-icon { color: #f7931a; }
.main-card[data-type="gold"] .card-icon { color: #f59e0b; }
.main-card[data-type="usd"] .card-icon { color: #22c55e; }

/* ===================== SINGLE RESPONSIVE BREAKPOINT ===================== */
/* Only for layout changes that MUST have a breakpoint (like grid columns for very small screens) */
@media (max-width: 480px) {
  .modal {
    padding: 3vh 4vw;
  }
  
  .modal-content {
    width: 96vw;
    margin: 3vh auto;
    border-radius: 20px 20px 0 0;
  }
  
  .section-header {
    margin: 0 0.8rem 1.4rem;
    padding: 1rem 1.1rem;
    top: 64px;
  }
  
  .section-header-inner {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .converter-row {
    grid-template-columns: 1fr;
  }
  
  .converter-result {
    font-size: 1.5rem;
  }
}
.settings-drawer-mini {
    position: absolute;
    top: 64px;               /* ارتفاع هدر */
    right: 1rem;
    width: 260px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 1000;
}

.settings-drawer-mini.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


/* ====== Settings Mini Drawer (Balanced) ====== */
/* ====== Settings Side Menu – Grey Glass ====== */


.settings-drawer-left.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.settings-drawer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

/* ====== Settings Items (دکمه‌ها) ====== */
.settings-drawer-left .settings-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.85rem !important; /* ✅ override inline */
    font-size: 0.95rem;
    border-radius: 12px;

    background: rgba(160, 160, 160, 0.22); /* ✅ هماهنگ با منو */
    border: 1px solid rgba(255,255,255,0.18);
    color: inherit;
    cursor: pointer;

    transition: background 0.2s ease, transform 0.15s ease;
}

/* hover */
.settings-drawer-left .settings-item:hover {
    background: rgba(180, 180, 180, 0.32);
    transform: translateX(-2px);
}

/* active (اگر section فعال باشد) */
.settings-drawer-left .settings-item.active {
    background: rgba(200, 200, 200, 0.4);
    border-color: rgba(255,255,255,0.35);
}

/* آیکون‌ها */
.settings-drawer-left .settings-item i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    opacity: 0.9;
}
.personalization-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 3000;
}
/* فاصله واقعی بین دکمه‌های تنظیمات */
.settings-drawer-inner .settings-item {
    margin-bottom: 0.8rem;
}

/* حذف فاصله آخر */
.settings-drawer-inner .settings-item:last-child {
    margin-bottom: 0;
}
.settings-drawer,
.settings-drawer-inner {
    background: var(--bg) !important;
    backdrop-filter: none !important;
    border: none !important;
}
.settings-drawer {
    border-radius: 14px; /* گردی ملایم */
}

.settings-drawer-inner {
    border-radius: 12px;
}
.update-item {
    position: relative;
}

.update-badge {
    position: absolute;
    left: 14px;           /* چون RTL هست */
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;        /* پیش‌فرض مخفی */
    align-items: center;
    justify-content: center;
}
/* ===== Currency Flag (Circular) ===== */
.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;          /* ✅ دایره‌ای */
    overflow: hidden;            /* ✅ برش گوشه‌ها */
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,0.15); /* بک خیلی ملایم */
    border: 1px solid rgba(255,255,255,0.25);
}

/* خود تصویر پرچم */
.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;           /* ✅ پرچم کامل داخل دایره */
    border-radius: 50%;
    display: block;
}
.card:hover .card-icon {
    transform: scale(1.08);
    transition: 0.2s ease;
}
/* ===== Crypto Icons ===== */
.crypto-title {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.crypto-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
}
/* پیش‌فرض: بدون blur (اندروید-safe) */


/* فقط برای iOS / مرورگرهای پشتیبان */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

}


.settings-drawer-left.open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
/* ===== Mobile Sticky Footer ===== */
.mobile-footer {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;

  display: none;
  justify-content: center;

  z-index: 2500;
  pointer-events: none;
}


.mobile-footer-inner {
  width: calc(100% - 2rem);
  max-width: 420px;

  display: flex;
  justify-content: space-around;
  align-items: center;

  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;

  padding: 0.6rem 0.4rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);

  pointer-events: auto;
}

/* دکمه‌ها */
.footer-btn {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;

  color: var(--text);
  font-size: 0.7rem;
  cursor: pointer;
}

.footer-btn i {
  font-size: 1.25rem;
}

/* دکمه + برجسته‌تر */
.footer-add i {
  background: var(--accent);
  color: #fff;
  padding: 0.55rem;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* فقط موبایل */
@media (max-width: 768px) {
  .mobile-footer {
    display: flex;
  }
}

/* دسکتاپ مخفی */
@media (min-width: 769px) {
  .mobile-footer {
    display: none !important;
  }
}

/* ===== Mobile More Menu ===== */



/* فعال */


.mobile-more-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* دستگیره بالا */


/* آیتم‌ها */



.mobile-more-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}
/* ===== Mobile: Settings Drawer as Bottom Sheet ===== */
/* ===== FINAL – Settings Drawer ===== */
.settings-drawer-left {
  position: absolute;
  top: 56px;
  left: 0.75rem;

  width: 235px;
  background: rgba(120,120,120,0.18);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.28);

  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;

  transition: 0.25s ease;
  z-index: 3000;
}

.settings-drawer-left.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 768px) {
  .settings-drawer-left {
    position: fixed;
    top: auto;

    right: 0.75rem;   /* ✅ سمت راست */
    left: auto;       /* ✅ خنثی کردن سمت چپ */

    bottom: calc(96px + env(safe-area-inset-bottom)); /* ✅ بالاتر از فوتر */

    width: 220px;
    max-height: 70vh;

    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;

    z-index: 3000;
  }

  .settings-drawer-left.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ===== Converter Drawer Mobile – FLAT like MORE MENU ===== */
@media (max-width: 768px) {
  .converter-drawer-mobile {
    position: fixed;

    /* ✅ وسط افقی */
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(10px);

    /* ✅ کمی بالاتر از فوتر (دقیقاً مثل More) */
    bottom: calc(96px + env(safe-area-inset-bottom));

    /* ✅ بزرگ‌تر */
    width: 92vw;
    max-width: 380px;
    max-height: 78vh;

    /* ✅ کاملاً تخت */
    background: var(--bg);       /* هم‌رنگ منوی بیشتر */
    opacity: 1;

    /* ❌ حذف کامل شیشه‌ای */
    backdrop-filter: none !important;

    /* ❌ حذف سایه */
    box-shadow: none !important;

    /* ❌ حذف شفافیت قبلی */
    background-color: var(--bg) !important;

    /* ✅ فقط همان گردی More */
    border: none !important;
    border-radius: 16px;

    pointer-events: none;
    transition: 0.22s ease;

    z-index: 3000;
  }

  .converter-drawer-mobile.open {
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}
/* ===== Personalization Drawer - بدون شیشه‌ای، کوچک‌تر ===== */
/* ===== Personalization Drawer - دقیقاً زیر آیکون شخصی‌سازی ===== */
.personalization-drawer {
  position: fixed;
  
  /* ✅ محاسبه موقعیت: آیکون سوم از چپ */
  /* فوتر 4 آیکون دارد: بیشتر | تبدیل | شخصی‌سازی | + */
  right: calc(25% - 92px);  /* تقریباً زیر آیکون شخصی‌سازی */
  
  bottom: calc(96px + env(safe-area-inset-bottom) + 8px);

  width: 185px;
  max-height: 60vh;

  background: var(--bg);
  backdrop-filter: none !important;
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;

  transition: 0.25s ease;
  z-index: 3000;
}

.personalization-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Personalization Drawer Inner ===== */
.personalization-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;                /* ✅ padding کمتر */
}

/* ===== عنوان ===== */
.personalization-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.3rem;
}

/* ===== Personalization Items ===== */
.personalization-drawer .personalization-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;

  padding: 0.6rem 0.7rem;          /* ✅ کوچک‌تر */
  font-size: 0.85rem;              /* ✅ فونت کوچک‌تر */
  border-radius: 10px;

  background: rgba(160, 160, 160, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;

  transition: background 0.2s ease;
}

.personalization-drawer .personalization-item:hover {
  background: rgba(180, 180, 180, 0.28);
}

/* ===== سوییچ کوچک‌تر ===== */
.personalization-drawer .switch {
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.personalization-drawer .slider:before {
  height: 16px;
  width: 16px;
}

.personalization-drawer input:checked + .slider:before {
  transform: translateX(20px);
}

/* ===== select کوچک‌تر ===== */
.personalization-drawer .font-select {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ❌ مخفی‌سازی شخصی‌سازی در موبایل */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}
/* ✅ جدید — فقط داخل home مخفی باشد + داخل صفحه تبدیل واحد نمایش داده شود */
@media (max-width: 768px) {
  /* مخفی کردن فقط اگر داخل صفحه اصلی باشد */
  #home .converter-card {
    display: none !important;
  }

  /* نمایش در صفحه مجزا تبدیل واحد */
  #converter .converter-card {
    display: block !important;
  }

  /* نمایش در دراور تبدیل (اگر هنوز استفاده می‌شود) */
  #converter-drawer .converter-card {
    display: block !important;
  }
}
/* ✅ مخفی کردن آیکون تنظیمات هدر در موبایل */
@media (max-width: 768px) {
  #settingsToggleBtn {
    display: none !important;
  }
}
@media (max-width: 768px) {
  header #settingsToggle {
    display: none !important;
  }
}

.home-datetime {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;         /* سمت راست در موبایل */
  gap: 1rem;                       /* فاصله بین تاریخ و ساعت */
  font-size: 0.95rem;                /* بزرگ‌تر از 0.86rem قبلی */
  font-weight: 700;                  /* بولد قوی‌تر */
  white-space: nowrap;
  margin: 0;
  

  min-width: 8.5rem;
  text-align: left;
  display: inline-block;
}

/* موبایل */
@media (max-width: 768px) {
  .home-datetime {
    font-size: 0.92rem;              /* کمی بزرگ‌تر در موبایل */
    font-weight: 400;                /* بولد */
    gap: 1rem;  
  
 
} 
/* فاصله مناسب با اندازه بزرگ‌تر */
  
}

/* اگر می‌خواهی فقط تاریخ بولدتر یا بزرگ‌تر باشد (اختیاری) */
#home-date {
  font-weight: 600;                  /* خیلی بولد */
  /* font-size: 0.96rem; */         /* اگر می‌خواهی تاریخ کمی بزرگ‌تر از ساعت باشد */
}
#home-date {
    opacity: 0.6;
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}
/* اگر می‌خواهی ساعت کمی متفاوت باشد (اختیاری) */
#home-time {
  font-weight: 600;                  /* نیمه‌بولد */
  /* font-size: 0.9rem; */
}

@media (max-width: 768px) {

  /* فاصله بالای main (از هدر تا اولین کارت) */
  main {
    padding-top: 5px;          /* ← این عدد رو با فاصله فعلی بالای کارت‌ها تنظیم کن */
        /* ← دقیقاً برابر با padding-top بذار */
  }

  /* حذف حاشیه/فاصله اضافی از آخرین ردیف کارت‌ها */
  .grid:last-child,
  .home-section:last-of-type,
  main > *:last-child {         /* آخرین فرزند مستقیم main */
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* کارت‌های داخل آخرین گرید هم حاشیه پایین نداشته باشند */
  .grid > .card:last-child,
  .grid > div:last-child {
    margin-bottom: 0 !important;
  }

  /* فوتر رو دقیقاً به پایین بچسبان + فاصله داخلی کمتر */
  .mobile-footer {
    bottom: env(safe-area-inset-bottom);
    margin-bottom: 0 !important;
    padding: 2rem 0.5rem;     /* اگر padding-bottom زیاد بود کمش کن */
  }

  .mobile-footer-inner {
    padding: 0.7rem ;
       margin:5;/* فاصله داخلی فوتر رو کم کن اگر لازم بود */
  }
}

@media (max-width: 768px) {
  .mobile-footer-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
  }

  .footer-btn:first-child {          /* سه‌نقطه - چپ */
    margin-left: 1rem;             /* کمی از لبه چپ فاصله */
  }

  .footer-btn:last-child {           /* تبدیل - راست */
    margin-right: 1rem;            /* کمی از لبه راست فاصله */
  }
}

/* ===== Xiaomi / Android FIX ===== */
body.android * {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {

  body.android .card,
  body.android .converter-card,
  body.android .modal-content,
  body.android .section-header,
  body.android .mobile-footer-inner,
  body.android .settings-drawer-left,
  body.android .personalization-drawer {
    backdrop-filter: none !important;
    background: var(--bg) !important;
  }

  body.android .settings-drawer-left,
  body.android .converter-drawer-mobile,
  body.android .personalization-drawer {
    transform: none !important;
  }

  body.android select {
    appearance: auto !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}


/* خط تیره بین تاریخ و ساعت */
#home-date::after { 
  content: "-";        /* یا "-" */
  margin: 0 0.2rem;    /* فاصله از دو طرف */
  opacity: 0.5;
  font-weight: 400;
}

.home-datetime {
  margin-right: 1.2rem;
}

@media (max-width: 768px) {
  .home-datetime {
    margin-right: 1.8rem;
    margin-left: auto;
    transform: translateX(-11px);
  }
}
/* =======================================================
   🚀 COMPLETE MOBILE PERFORMANCE OPTIMIZATION (iOS FIX)
   ======================================================= */

@media (max-width: 768px) {

  /* 1️⃣ کاهش شدید سایه‌ها (درخواست شما) */
  :root {
    /* سایه قبلی: 0 15px 45px (بسیار سنگین) */
    /* سایه جدید: 0 4px 15px (کم، ظریف و بسیار سریع) */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
  }

  /* 2️⃣ حذف بلور (Blur) - مهم‌ترین عامل کندی در آیفون */
  /* به جای بلور، از رنگ‌های نیمه‌شفاف (Solid) استفاده می‌کنیم */
  .sidebar,
  .card,
  .modal-content,
  .mobile-footer-inner,
  .settings-drawer-left,
  .converter-drawer-mobile,
  .personalization-drawer,
  .trend-card,
  .section-header,
  .select-box .options,
  .search-input {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* رنگ‌بندی پس‌زمینه برای جایگزینی شیشه‌ای بودن */
  /* حالت دارک (Dark) */
.sidebar,
.mobile-footer-inner,
.settings-drawer-left,
.section-header,
.modal-content,
.trend-card {
  background: rgba(0, 0, 0, 0.95) !important;
}


  /* حالت لایت (Light) */
  body.light .sidebar,
  body.light .mobile-footer-inner,
  body.light .modal-content,
  body.light .section-header,
  body.light .trend-card {
    background: rgba(255, 255, 255, 0.92) !important; /* رنگ روشن چسبان */
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
  }

  /* 3️⃣ ساده‌سازی پس‌زمینه سایت */
  /* گرادینت سه رنگی در اسکرول سنگین است. در موبایل رنگ ساده می‌گذاریم. */
  :root {
    --bg: #000000 !important;
  }
  body.light {
    --bg: #f8fafc !important; /* یک رنگ سفید/خاکستری ساده */
  }

  /* 4️⃣ بهینه‌سازی انیمیشن‌ها (پیشگیری از لگ) */
  /* غیرفعال کردن انیمیشن اسکلتون لودینگ چون پردازش زیادی دارد */
  .skeleton {
    animation: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
  }

  /* ساده کردن انیمیشن باز شدن مودال */
  .modal-content { 
    animation: none !important; /* حذف انیمیشن باز شدن برای سرعت */
    opacity: 1 !important;
    transform: none !important;
  }

  /* 5️⃣ فعال‌سازی شتاب‌دهنده سخت‌افزاری (GPU) */
  /* این خط باعث می‌شود کارت‌ها توسط کارت گرافیک (نه پردازنده) رندر شوند */
  .card, .section, .grid, .list, header {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
  }

  /* 6️⃣ حذف افکت‌های اضافی از فوتر موبایل */
  .mobile-footer-inner {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15) !important; /* سایه فوتر هم کوچکتر شد */
  }
}

.ads-wrapper{
    margin:20px 0; 
}

#adBox{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.adCard{
    background:#1e1e1e;
    border-radius:12px;
    padding:14px;
    text-align:center;
}

.adCard a{
    color:#fff;
    text-decoration:none;
    font-size:14px;
}

* {
  font-family: 'IRANSans', sans-serif !important;
}
body.font-estedad {
  font-family: 'Estedad', sans-serif !important;
}

body.font-estedad * {
  font-family: inherit !important;
}
body.lang-en {
  direction: ltr;
}

body.numbers-fa {
  font-feature-settings: "ss02";
}

body.numbers-en {
  font-feature-settings: normal;
}

.price,
.card-price,
.crypto-change,
.converter-result {
  font-family: inherit;
}
body.numbers-fa {
  font-family: 'IRANSans', sans-serif;
}

body.numbers-en {
  font-family: 'Estedad', system-ui, sans-serif;
}
.en-number {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}
.notice-text{
  white-space: pre-line;
  line-height: 1.9;
}
/* ==================== منوی زمینه (Context Menu) ==================== */

/* ==================== Toast Notification ==================== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(145deg, #2a2f38, #1e2329);
    color: #e8e8e8;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(240, 185, 11, 0.3);
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.success {
    border-color: rgba(46, 204, 113, 0.5); 
}

.toast-notification.success i {
    color: #2ecc71;
}

.toast-notification.warning {
    border-color: rgba(241, 196, 15, 0.5);
}

.toast-notification.warning i {
    color: #f1c40f;
}

.toast-notification i {
    font-size: 18px;
}
.dark {
  --bg: #000000 !important;
}

body.dark {
  background: #000000 !important;
}
html.dark,
body.dark {
  background-color: #000000 !important;
}
/* استایل منوی افزودن به صفحه اصلی */
.context-menu {
    position: fixed;
    background: #2ecc71; /* سبز */
    border: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 9999;
    display: none;
    min-width: 180px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #fff; /* برای خوانایی روی سبز */
    display: flex;
    align-items: center;
    gap: 8px; 
}

.context-menu-item:hover {
    background-color: rgba(255,255,255,0.15);
}

/* غیرفعال کردن انتخاب متن روی کارت ها و نمادها */
/* ✅ غیرفعال کردن قطعی انتخاب متن برای کادرها و تمام عناصر داخلی آن‌ها */
.list-item-row, 
.list-item-row *,
.main-card, 
.main-card *,
.context-menu, 
.context-menu * {
    -webkit-touch-callout: none !important; /* غیرفعال کردن منوی کپی/پیست در iOS */
    -webkit-user-select: none !important;   /* Safari و مرورگرهای مبتنی بر WebKit */
    -khtml-user-select: none !important;
    -moz-user-select: none !important;      /* Firefox */
    -ms-user-select: none !important;       /* Edge / IE */
    user-select: none !important;           /* استاندارد برای Chrome و بقیه */
    -webkit-user-drag: none !important;     /* جلوگیری از کشیدن عکس‌ها */
}
/* آیکن حذف پیش‌فرض مخفی */
.remove-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.85);
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none; /* غیرقابل کلیک در حالت عادی */
    transition: opacity 0.3s ease-in-out;
    user-select: none;
}

/* با فعال شدن حالت حذف روی کارت، آیکن حذف نمایان شود */
.main-card.delete-mode .remove-icon {
    opacity: 1;
    pointer-events: auto; /* فعال کردن کلیک */
}

/* حالت طی درگ: اضافه کردن استایل دلخواه برای جابجایی */

/* نمایش آیکون هنگام لمس طولانی */
.main-card.delete-mode .remove-icon {
    display: flex !important;
}
/* اعمال فونت استاندارد برای اعدادی که باید انگلیسی نمایش داده شوند */
/* ۱. تعریف فونت فارسی (IRANSans) */
@font-face {
  font-family: 'IRANSans';
  src: url('/fonts/IRANSans.ttf') format('truetype'); /* مسیر فایل خود را جایگزین کنید */
  font-weight: normal;
  font-display: swap;
}

/* ۲. تعریف فونت انگلیسی (Bahij) */
@font-face {
  font-family: 'BahijTheSans';
  src: url('/fonts/Bahij TheSansArabic-Plain.TTF') format('truetype');
  font-weight: normal;
  font-display: swap;
}

/* ۳. تنظیم فونت پیش‌فرض کل سایت روی فارسی */
body {
  font-family: 'IRANSans', Tahoma, Arial, sans-serif;
}

/* ۴. اعمال فونت Bahij فقط برای اعدادی که باید انگلیسی نمایش داده شوند */
.en-number {
  font-family: 'BahijTheSans', Arial, sans-serif !important;
  direction: ltr !important; /* چینش صحیح اعداد اعشاری و منفی از چپ به راست */
  display: inline-block;
}

@font-face {
  font-family: 'IRANSans';
  src: url('/fonts/Bahij TheSansArabic-Plain.TTF') format('truetype');
  unicode-range: U+0000-007F; /* فقط کاراکترهای لاتین و اعداد انگلیسی */
}
/* استایل مربوط به تصویر لوگو در صفحه لودینگ */
.loading-logo {
    width: 150px; /* عرض لوگو را بسته به نیاز خود تغییر دهید */
    height: auto;
    object-fit: contain;
    animation: pulseLogo 2s infinite ease-in-out;
}

/* استایل برای لوگوی متنی (در صورتی که از عکس استفاده نمی‌کنید) */
.loading-logo-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary, #3b82f6); /* از متغیر رنگ اصلی خود استفاده کنید */
    animation: pulseLogo 2s infinite ease-in-out;
}

/* انیمیشن ملایم پالس برای اینکه سایت ثابت و هنگ‌کرده به نظر نرسد */
@keyframes pulseLogo {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}
#settings-drawer {
    border: none !important;
    outline: none !important;
}
.settings-item {
    padding: 0.7rem 0.9rem !important; /* کاهش پدینگ برای نزدیک شدن گزینه‌ها */
    margin-bottom: 0.4rem !important; /* کاهش فاصله بین هر آیتم */
    border-radius: 10px; /* گرد کردن لبه هر آیتم برای ظاهر مدرن */
    font-size: 0.9rem; /* کمی کوچک‌تر کردن متن برای تناسب با کادر جدید */
    border: none !important; /* اطمینان از نداشتن بوردر داخلی */
    background-color: rgba(0, 0, 0, 0.02); /* یک رنگ پس‌زمینه بسیار ملایم */
    transition: all 0.2s ease;
}

/* کادر اصلی دربرگیرنده تبلیغات */
.telegram-box {
    position: relative;
    width: 100%;
    height: 105px; /* می‌توانید این ارتفاع را به دلخواه خود تغییر دهید */
    padding: 0 !important; /* حذف فاصله‌های داخلی تا عکس به لبه‌ها بچسبد */
    margin-bottom: 20px;
    border-radius: 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* تنظیمات اسلایدها (کارت‌های روی هم) */
.ad-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px; /* گردی گوشه‌های کارت */
    overflow: hidden; /* جلوگیری از بیرون زدن عکس از گوشه‌های گرد */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
    cursor: pointer;
}

/* تنظیمات عکس داخل اسلاید */
.ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* عکس را بدون دفرمه شدن به اندازه کل کادر در می‌آورد */
    display: block;
    border: none;
}

/* افکت کارت فعال (کارت رویی) */
.ad-slide.active {
    transform: translateY(0) scale(1);
    z-index: 2;
    opacity: 1;
}

/* افکت کارت غیرفعال (کارت زیری) */
.ad-slide.inactive {
    transform: translateY(12px) scale(0.92);
    z-index: 1;
    opacity: 0.8;
    filter: brightness(0.8);
}
@keyframes ringBell {
  0% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-10deg); }
  50% { transform: rotate(0); }
  100% { transform: rotate(0); }
}

.shake-animation {
  animation: ringBell 2s infinite;
  display: inline-block;
}
/* استایل برای تاریخ اطلاعیه */
.notice-date {
    display: block;
    font-size: 11px;
    color: #666666; /* رنگ خاکستری ملایم */
    text-align: left; /* هدایت تاریخ به سمت چپ کادر */
    margin-top: 8px;
    margin-bottom: 12px;
}

/* استایل برای خط جداکننده */
.notice-separator {
    border: none;
    border-bottom: 1px solid #666666; /* رنگ خط خاکستری بسیار روشن */
    margin: 0;
}

/* مخفی کردن خط جداکننده برای آخرین اطلاعیه */
.notice-item:last-child .notice-separator {
    display: none;
}
/* استایل برای آیکون حذف کارت */
/* استایل برای آیکون حذف کارت */
.remove-card-btn {
    position: absolute;
    top: 6px;  /* عدد مثبت باعث می‌شود آیکون داخل‌تر بیاید */
    right: 6px; /* عدد مثبت باعث می‌شود آیکون داخل‌تر بیاید */
    width: 24px;
    height: 24px;
    background-color: #ff4d4f;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* حالت ویرایش (لرزش و هاله رنگی) */
.main-card.edit-mode {
    animation: shakeCard 0.4s infinite alternate;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3) !important;
    z-index: 5;
    cursor: grab;
}

/* نمایش آیکون حذف در حالت ویرایش */
.main-card.edit-mode .remove-card-btn {
    opacity: 1;
    transform: scale(1);
}

@keyframes shakeCard {
    0% { transform: rotate(-1deg); }
    100% { transform: rotate(1deg); }
}

/* استایل کارتی که در حال کشیده شدن زیر انگشت است */
.dragging-clone {
    position: fixed !important;
    z-index: 9999 !important;
    pointer-events: none;
    transform: scale(1.05) rotate(3deg) !important;
    box-shadow: 0 15px 25px rgba(0,0,0,0.3) !important;
    opacity: 0.95 !important;
    margin: 0 !important;
    transition: none !important;
    animation: none !important;
}

/* استایل جای خالی کارت در لیست */
.placeholder-card {
    opacity: 0.3 !important;
    border: 2px dashed #ccc !important;
}
@keyframes greenGlow {
  0% { 
    text-shadow: 0 0 3px rgba(0, 230, 118, 0.2); /* کاهش شعاع و شفافیت */
    color: #00c853; 
  }
  50% { 
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.6); /* حذف لایه دوم سایه و کاهش غلظت */
    color: #69f0ae; 
  }
  100% { 
    text-shadow: 0 0 3px rgba(0, 230, 118, 0.2); 
    color: #00c853; 
  }
}

.update-glowing-btn {
  color: #00e676 !important;
  font-weight: bold;
  /* برای اینکه انیمیشن ملایم‌تر به چشم بیاید، می‌توانید زمان آن را از 1.5s به 2s افزایش دهید */
  animation: greenGlow 2s infinite ease-in-out; 
}
/* استایل کوچک کردن سه رقم آخر طلا */
.small-digits {
    font-size: 0.65em; /* اندازه فونت را به ۷۵٪ اندازه اصلی کاهش می‌دهد */
    opacity: 0.55;     /* کمی کمرنگ‌تر برای تمایز بهتر */
    letter-spacing: 0px;
}
/* تنظیمات مربوط به فلش‌های تغییر قیمت */
.price-arrow {
    font-size: 0.7em; /* کوچکتر کردن فلش نسبت به متن اصلی */
    vertical-align: middle; /* تراز کردن فلش با وسط اعداد */
    margin-left: 2px; /* فاصله اندک بین فلش و عدد */
}

/* رنگ فلش رو به بالا */
.up-arrow {
    color: #10b981; /* می‌توانید کد رنگ سبز دلخواه خود را جایگزین کنید */
}

/* رنگ فلش رو به پایین */
.down-arrow {
    color: #ef4444; /* می‌توانید کد رنگ قرمز دلخواه خود را جایگزین کنید */
}
/* کوچک‌تر کردن ابعاد ردیف‌های لیست کریپتو */


/* کوچک‌تر کردن آیکون‌های کریپتو */
.list-item-row .crypto-icon, 
.list-item-row img {
    width: 28px !important;
    height: 28px !important;
}

/* تنظیم سایز فونت نام و قیمت در لیست کریپتو */
.list-item-row .crypto-name,
.list-item-row .symbol-name {
    font-size: 14px !important;
}

.list-item-row .price-usd,
.list-item-row .price-toman,
.list-item-row .card-price {
    font-size: 15px !important;
}
/* کلاس پایه برای حالت لودینگ */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #e2e5e7; /* رنگ پایه طوسی روشن */
    color: transparent !important; /* مخفی کردن متن فعلی */
    border-radius: 4px; /* گردی گوشه‌های لودینگ */
    min-height: 20px; /* حداقل ارتفاع برای اینکه ساختار حفظ شود */
    pointer-events: none; /* غیرفعال کردن کلیک در زمان لودینگ */
}

/* مخفی کردن تمام تگ‌های داخل عنصر در حالت لودینگ */
.skeleton * {
    visibility: hidden !important;
}

/* انیمیشن موج (Shimmer) */
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.6) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* نکته: اگر سایت شما حالت تاریک (Dark Mode) دارد، این بخش را اضافه کنید */
body.dark-mode .skeleton {
    background-color: #2a2a2a;
}
body.dark-mode .skeleton::after {
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
}


/* دکمه شناور سبز بازارها */
.fab-markets {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.5);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.fab-markets:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.7);
}

/* استایل تب‌های بازار */
.market-tab {
    display: none; /* به صورت پیش‌فرض مخفی هستند */
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* کلاسی که وقتی تب فعال می‌شود به آن اضافه می‌گردد */
.market-tab.active-tab {
    display: block;
}

/* کلاسی که باعث اجرای انیمیشن Fade می‌شود */
.market-tab.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.markets-subtitle {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 25px 0 12px 0;
    padding: 0 5px 8px 5px;
    color: var(--text);
    border-bottom: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.markets-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent, #2ecc71);
    border-radius: 50%;
}

/* مخفی کردن بخش بازارها در حالت عادی */
#markets {
    display: none;
}
#markets.active {
    display: block;
}



.markets-entry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    height: 96px;
    padding: 20px 28px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 14px 44px rgba(16, 185, 129, 0.45),
                0 0 0 1px rgba(255,255,255,0.12) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    direction: rtl;
}

/* خط نوری متحرک */
.markets-entry-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -120%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-25deg);
    animation: btnShine 2.8s linear infinite;
}

@keyframes btnShine {
    0%   { left: -120%; }
    100% { left: 180%; }
}

/* انیمیشن نقاط درخشان */
.markets-entry-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 30%, rgba(255,255,255,0.22) 0%, transparent 40%),
                radial-gradient(circle at 75% 70%, rgba(255,255,255,0.15) 0%, transparent 50%);
    animation: dotsMove 5s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes dotsMove {
    0%   { background-position: 0% 0%; }
    100% { background-position: 180% 180%; }
}

.markets-entry-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 54px rgba(16, 185, 129, 0.55);
}

.markets-entry-btn:active {
    transform: scale(0.97);
}

/* ================================================================
   حالت روشن (لایت) — دکمه
   ================================================================ */
.light .markets-entry-btn {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    box-shadow: 0 14px 44px rgba(16, 185, 129, 0.35);
}

/* ================================================================
   اورلی مودال — بدون سایه
   ================================================================ */
.markets-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.markets-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ================================================================
   خود مودال — حالت تاریک (پیش‌فرض)
   ================================================================ */
.markets-modal {
    width: 100%;
    max-width: 470px;
    max-height: 75vh;
    background: #12121c;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}

.markets-modal-overlay.show .markets-modal {
    transform: scale(1);
    opacity: 1;
}

/* ================================================================
   تزئینات پس‌زمینه — تاریک
   ================================================================ */
.markets-modal-deco {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.markets-deco-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.1;
}

.markets-deco-orb-1 { width: 150px; height: 150px; background: #f39c12; top: -40px; right: -20px; }
.markets-deco-orb-2 { width: 120px; height: 120px; background: #3498db; bottom: 20px; left: -15px; }
.markets-deco-orb-3 { width: 80px; height: 80px; background: #2ecc71; top: 50%; right: 30%; }

/* ================================================================
   محتوای داخلی
   ================================================================ */
.markets-modal-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}

/* ================================================================
   هدر مودال — تاریک
   ================================================================ */
.markets-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    flex-shrink: 0;
}

.markets-modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.markets-modal-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(243,156,18,0.18), rgba(230,126,34,0.08));
    color: #f39c12;
    flex-shrink: 0;
}

.markets-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
}

.markets-modal-subtitle {
    margin: 2px 0 0;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    font-weight: 400;
}

.markets-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.markets-modal-close:hover {
    background: rgba(255, 80, 80, 0.12);
    color: #ff5050;
}

/* ================================================================
   لیست آیتم‌ها — تاریک
   ================================================================ */
.markets-modal-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 14px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.markets-modal-grid::-webkit-scrollbar { width: 3px; }
.markets-modal-grid::-webkit-scrollbar-track { background: transparent; }
.markets-modal-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* ================================================================
   هر آیتم بازار — تاریک
   ================================================================ */
.market-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-modal-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(-3px);
}

.market-modal-item:active {
    transform: scale(0.98);
}

/* رنگ‌های هاور — تاریک */
.market-modal-item[data-section="currency"]:hover { background: rgba(26, 115, 232, 0.1); border-color: rgba(26, 115, 232, 0.18); }
.market-modal-item[data-section="gold"]:hover { background: rgba(249, 168, 37, 0.1); border-color: rgba(249, 168, 37, 0.18); }
.market-modal-item[data-section="crypto"]:hover { background: rgba(247, 147, 26, 0.1); border-color: rgba(247, 147, 26, 0.18); }
.market-modal-item[data-section="metal-precious"]:hover { background: rgba(176, 190, 197, 0.1); border-color: rgba(176, 190, 197, 0.18); }
.market-modal-item[data-section="metal-base"]:hover { background: rgba(216, 67, 21, 0.1); border-color: rgba(216, 67, 21, 0.18); }
.market-modal-item[data-section="energy"]:hover { background: rgba(46, 125, 50, 0.1); border-color: rgba(46, 125, 50, 0.18); }

/* ================================================================
   آیکون
   ================================================================ */
.market-modal-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.market-modal-item:hover .market-modal-icon-wrap {
    transform: scale(1.06);
}

.market-modal-icon-wrap img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
}

.market-icon-currency { background: linear-gradient(145deg, #1565c0, #42a5f5); }
.market-icon-gold { background: linear-gradient(145deg, #f57f17, #ffee58); }
.market-icon-crypto { background: linear-gradient(145deg, #e65100, #ffb74d); }
.market-icon-precious { background: linear-gradient(145deg, #546e7a, #cfd8dc); }
.market-icon-base { background: linear-gradient(145deg, #bf360c, #ff8a65); }
.market-icon-energy { background: linear-gradient(145deg, #1b5e20, #66bb6a); }

/* ================================================================
   متن و فلش — تاریک
   ================================================================ */
.market-modal-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.market-modal-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #eee;
    line-height: 1.4;
}

.market-modal-desc {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.market-modal-chevron {
    flex-shrink: 0;
    color: rgba(255,255,255,0.15);
    transition: all 0.2s ease;
}

.market-modal-item:hover .market-modal-chevron {
    color: rgba(255,255,255,0.4);
    transform: translateX(-3px);
}

/* ================================================================
   حالت روشن — مودال کامل
   ================================================================ */
.light .markets-modal {
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.06);
}

.light .markets-deco-orb { opacity: 0.05; }

.light .markets-modal-header h2 { color: #1e293b; }
.light .markets-modal-subtitle { color: #94a3b8; }

.light .markets-modal-close {
    background: rgba(0, 0, 0, 0.04);
    color: #94a3b8;
}
.light .markets-modal-close:hover {
    background: rgba(255, 50, 50, 0.06);
    color: #e53935;
}

.light .market-modal-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

.light .market-modal-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.light .market-modal-label { color: #1e293b; }
.light .market-modal-desc { color: #94a3b8; }
.light .market-modal-chevron { color: #cbd5e1; }
.light .market-modal-item:hover .market-modal-chevron { color: #64748b; }

.light .market-modal-item[data-section="currency"]:hover { background: rgba(26, 115, 232, 0.05); border-color: rgba(26, 115, 232, 0.12); }
.light .market-modal-item[data-section="gold"]:hover { background: rgba(249, 168, 37, 0.05); border-color: rgba(249, 168, 37, 0.12); }
.light .market-modal-item[data-section="crypto"]:hover { background: rgba(247, 147, 26, 0.05); border-color: rgba(247, 147, 26, 0.12); }
.light .market-modal-item[data-section="metal-precious"]:hover { background: rgba(176, 190, 197, 0.06); border-color: rgba(176, 190, 197, 0.12); }
.light .market-modal-item[data-section="metal-base"]:hover { background: rgba(216, 67, 21, 0.05); border-color: rgba(216, 67, 21, 0.12); }
.light .market-modal-item[data-section="energy"]:hover { background: rgba(46, 125, 50, 0.05); border-color: rgba(46, 125, 50, 0.12); }

.light .markets-modal-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }

/* ================================================================
   حالت تاریک صریح — با کلاس dark روی body
   ================================================================ */
body.dark .markets-modal {
    background: #12121c;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
}

body.dark .markets-deco-orb { opacity: 0.1; }

body.dark .markets-modal-header h2 { color: #fff; }
body.dark .markets-modal-subtitle { color: rgba(255,255,255,0.35); }

body.dark .markets-modal-close {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255,255,255,0.35);
}
body.dark .markets-modal-close:hover {
    background: rgba(255, 80, 80, 0.12);
    color: #ff5050;
}

body.dark .market-modal-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark .market-modal-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark .market-modal-label { color: #eee; }
body.dark .market-modal-desc { color: rgba(255,255,255,0.3); }
body.dark .market-modal-chevron { color: rgba(255,255,255,0.15); }
body.dark .market-modal-item:hover .market-modal-chevron { color: rgba(255,255,255,0.4); }

body.dark .market-modal-item[data-section="currency"]:hover { background: rgba(26, 115, 232, 0.1); border-color: rgba(26, 115, 232, 0.18); }
body.dark .market-modal-item[data-section="gold"]:hover { background: rgba(249, 168, 37, 0.1); border-color: rgba(249, 168, 37, 0.18); }
body.dark .market-modal-item[data-section="crypto"]:hover { background: rgba(247, 147, 26, 0.1); border-color: rgba(247, 147, 26, 0.18); }
body.dark .market-modal-item[data-section="metal-precious"]:hover { background: rgba(176, 190, 197, 0.1); border-color: rgba(176, 190, 197, 0.18); }
body.dark .market-modal-item[data-section="metal-base"]:hover { background: rgba(216, 67, 21, 0.1); border-color: rgba(216, 67, 21, 0.18); }
body.dark .market-modal-item[data-section="energy"]:hover { background: rgba(46, 125, 50, 0.1); border-color: rgba(46, 125, 50, 0.18); }

body.dark .markets-modal-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

/* ================================================================
   رفع سیاهی پایین صفحه
   ================================================================ */
@media (max-width: 768px) {
    html { background: #f8fafc; }
    body.dark,
    body:not(.light) { background: #000000; }
    body.light { background: #f8fafc; }
}/* ===== Markets Drawer Mobile – دقیقاً مثل منوی بیشتر ===== */
.markets-drawer {
  display: none; /* پیش‌فرض مخفی، فقط موبایل نمایش داده شود */
}

@media (max-width: 768px) {
  .markets-drawer {
    display: block;
    position: fixed;

    /* وسط افقی – دقیقاً مثل converter-drawer-mobile */
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(10px);

    /* بالاتر از فوتر – دقیقاً مثل منوی بیشتر */
    bottom: calc(96px + env(safe-area-inset-bottom));

    /* اندازه – مشابه منوی بیشتر */
    width: 92vw;
    max-width: 380px;
    max-height: 75vh;

    /* تخت و بدون شیشه‌ای – مثل منوی بیشتر */
    background: var(--bg);
    background-color: var(--bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 16px;

    /* انیمیشن باز/بسته */
    opacity: 0;
    pointer-events: none;
    transition: 0.22s ease;

    /* اسکرول داخلی بدون تأثیر روی صفحه */
    overflow-y: auto;
    overscroll-behavior: contain;

    /* فاصله داخلی */
    padding: 0.6rem;

    /* لایه بالاتر از فوتر */
    z-index: 3000;
  }

  /* حالت باز */
  .markets-drawer.open {
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ===== محتوای داخلی دراور ===== */
.markets-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ===== عنوان دراور ===== */
.markets-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-color);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  margin-bottom: 0.2rem;
}

/* ===== آیتم‌های دراور – دقیقاً مثل settings-item ===== */
.markets-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(160, 160, 160, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.markets-drawer-item:hover,
.markets-drawer-item:active {
  background: rgba(180, 180, 180, 0.3);
  transform: translateX(-2px);
}

/* آیکون دایره‌ای کنار هر آیتم */
.markets-drawer-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== حالت لایت ===== */
body.light .markets-drawer-item {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light .markets-drawer-item:hover,
body.light .markets-drawer-item:active {
  background: rgba(0, 0, 0, 0.08);
}

body.light .markets-drawer-title {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light .markets-drawer-icon {
  border-color: rgba(0, 0, 0, 0.1);
}

/* ===== اندروید – حذف بلور ===== */
@media (max-width: 768px) {
  body.android .markets-drawer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ===== دسکتاپ: مخفی ===== */
@media (min-width: 769px) {
  .markets-drawer {
    display: none !important;
  }
}

/* =============================================================
   📦 دراورهای موبایل — بازارها + بیشتر (استایل مشترک)
   ============================================================= */
/* =============================================================
   📦 دراورهای موبایل — بازارها + بیشتر (استایل مشترک)
   نصف عرض • سمت راست • بالای فوتر
   ============================================================= */

/* ----- کلاس پایه مشترک ----- */
.mobile-drawer {
  display: none; /* فقط موبایل */
}

@media (max-width: 768px) {
  .mobile-drawer {
    display: block;
    position: fixed;

    /* سمت راست — نه وسط */
    left: 0.75rem;
    right: auto;

    /* بالاتر از فوتر */
    bottom: calc(96px + env(safe-area-inset-bottom));

    /* نصف عرض صفحه */
    width: 48vw;
    max-width: 200px;
    max-height: 75vh;

    /* تخت — بدون شیشه‌ای */
    background: var(--bg);
    background-color: var(--bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 14px;

    /* انیمیشن */
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;

    /* اسکرول داخلی */
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem;

    z-index: 3000;
  }

  /* حالت باز */
  .mobile-drawer.open {
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
  }
}
/* ===== تنظیمات اختصاصی دراور "بیشتر" (سمت راست و عرض بیشتر) ===== */
@media (max-width: 768px) {
  #settings-drawer {
    /* برداشتن از سمت چپ */
    left: auto !important;
    
    /* چسبیدن به سمت راست - دقیقاً مثل فاصله سمت چپ دراور بازارها */
    right: 0.75rem;
    
    /* افزایش عرض */
    width: 58vw;
    max-width: 240px;
  }
}
/* ----- محتوای داخلی ----- */
.mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ----- عنوان دراور (فقط بازارها) ----- */
.mobile-drawer-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-color);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  margin-bottom: 0.15rem;
}

.mobile-drawer-title svg {
  flex-shrink: 0;
}

/* ----- آیتم‌های مشترک ----- */
.mobile-drawer .settings-item,
.mobile-drawer .markets-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(160, 160, 160, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-drawer .settings-item:hover,
.mobile-drawer .settings-item:active,
.mobile-drawer .markets-drawer-item:hover,
.mobile-drawer .markets-drawer-item:active {
  background: rgba(180, 180, 180, 0.3);
  transform: translateX(-2px);
}

/* آیکون SVG داخل آیتم‌ها */
.mobile-drawer .settings-item svg,
.mobile-drawer .markets-drawer-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* آیکون تصویری (فقط بازارها) */
.mobile-drawer .markets-drawer-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* آیکون فونت‌آوزوم (فقط بیشتر) */
.mobile-drawer .settings-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* بج اعلان داخل دراور */
.mobile-drawer .update-inline-badge {
  font-size: 0.6rem !important;
  padding: 1px 5px !important;
  margin-right: auto;
}

/* دکمه نصب نسخه جدید */
.mobile-drawer .update-glowing-btn {
  padding: 0.55rem 0.6rem !important;
}

/* ----- زیرمنوی شخصی‌سازی (داخل دراور بیشتر) ----- */
.mobile-drawer .back-btn-settings {
  font-size: 0.8rem;
  padding: 0.55rem 0.6rem;
}

.mobile-drawer .back-btn-settings i {
  font-size: 0.85rem;
}

/* سوئیچ‌ها کوچک‌تر داخل دراور */
.mobile-drawer .switch {
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-drawer .slider:before {
  height: 14px;
  width: 14px;
}

.mobile-drawer input:checked + .slider:before {
  transform: translateX(18px);
}

/* ----- حالت لایت ----- */
body.light .mobile-drawer .settings-item,
body.light .mobile-drawer .markets-drawer-item {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light .mobile-drawer .settings-item:hover,
body.light .mobile-drawer .settings-item:active,
body.light .mobile-drawer .markets-drawer-item:hover,
body.light .mobile-drawer .markets-drawer-item:active {
  background: rgba(0, 0, 0, 0.08);
}

body.light .mobile-drawer-title {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light .mobile-drawer .markets-drawer-icon {
  border-color: rgba(0, 0, 0, 0.1);
}

/* ----- اندروید ----- */
@media (max-width: 768px) {
  body.android .mobile-drawer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ----- دسکتاپ: مخفی ----- */
@media (min-width: 769px) {
  .mobile-drawer {
    display: none !important;
  }
}

/* ===== صفحه تبدیل واحد – ریسپانسیو ===== */
#converter .converter-card {
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  #converter .converter-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  #converter .converter-row span {
    text-align: center;
    transform: rotate(90deg);
  }

  #converter .converter-result {
    font-size: 1.5rem;
  }
}

#converter .converter-row input {
  font-size: 15px !important;
}

#converter .converter-row select {
  font-size: 15px !important;
}/* ===== بزرگتر کردن محتوای دراور بازارهای مالی ===== */
@media (max-width: 768px) {
  
  /* بزرگتر کردن عنوان "بازارهای مالی" */
  #markets-drawer .mobile-drawer-title {
    font-size: 0.9rem; /* قبلاً 0.82rem بود */
    padding: 0.65rem 0.7rem;
  }

  /* بزرگتر کردن متن آیتم‌ها (بازار ارز، طلا و...) و باکس آن‌ها */
  #markets-drawer .markets-drawer-item {
    font-size: 0.85rem; /* قبلاً 0.8rem بود */
    padding: 0.6rem 0.6rem; /* قبلاً 0.55rem 0.6rem بود - ارتفاع آیتم‌ها هم بیشتر میشه */
  }

  /* بزرگتر کردن آیکون‌های تصویری (عکس ارز، طلا و...) */
  #markets-drawer .markets-drawer-icon {
    width: 26px; /* قبلاً 22px بود */
    height: 26px; /* قبلاً 22px بود */
  }

}


/* ========================================
   نوار استوری‌ها (بالای کارت‌ها)
   ======================================== */
.stories-bar {
    padding: 14px 0 6px 0;
}
.stories-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 0 6px 10px 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.stories-scroll::-webkit-scrollbar { display: none; }

.story-circle-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    scroll-snap-align: start;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.story-circle {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(188, 24, 136, 0.25);
}
.story-circle:active {
    transform: scale(0.9);
}
.story-circle.seen {
    background: #bbb;
    box-shadow: none;
}
.story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-main, #fff);
    display: block;
}
.story-circle-label {
    font-size: 11px;
    color: var(--text-secondary, #666);
    max-width: 72px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   نمایش‌دهنده تمام‌صفحه استوری
   ======================================== */
/* ========================================
   نمایش‌دهنده تمام‌صفحه استوری
   نسخه نهایی — پوشش قطعی روی موبایل
   ======================================== */
.story-viewer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    /* دسکتاپ: 100vh کافیه */
    height: 100dvh !important;
    /* فال‌بک برای مرورگرهای قدیمی‌تر */
    min-height: -webkit-fill-available !important;
    z-index: 99999999 !important;
    background: #000 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    /* --- مهم‌ترین بخش: اجبار به لایه GPU بالاتر از همه --- */
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    will-change: transform, opacity !important;
    /* جلوگیری از هرگونه تداخل */
    contain: layout style paint !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: auto !important;
    pointer-events: auto !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.story-viewer.is-open {
    display: flex !important;
    animation: svFadeIn 0.18s ease-out !important;
}
@keyframes svFadeIn {
    from { opacity: 0; transform: translateZ(0) scale(1.02); }
    to   { opacity: 1; transform: translateZ(0) scale(1); }
}

/* --- نوار پیشرفت --- */
.story-progress-bar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    gap: 3px !important;
    padding: 8px 8px 0 8px !important;
    /* ناچ آیفون */
    padding-top: max(8px, env(safe-area-inset-top, 8px)) !important;
    z-index: 30 !important;
}
.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}
.story-progress-segment .fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 3px;
}
.story-progress-segment.done .fill {
    width: 100% !important;
    transition: none !important;
}
.story-progress-segment.active .fill {
    animation: svProgressFill var(--sv-duration) linear forwards !important;
}
@keyframes svProgressFill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* --- هدر شفاف --- */
.story-viewer-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
    z-index: 20 !important;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 55%,
        transparent 100%
    ) !important;
}
.story-viewer-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}
.story-viewer-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-viewer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.story-viewer-title {
    color: #fff !important;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.story-viewer-time {
    color: rgba(255, 255, 255, 0.65) !important;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.story-viewer-close {
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    padding: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
    z-index: 25 !important;
}
.story-viewer-close:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* --- تصویر تمام‌صفحه --- */
.story-viewer-image-wrap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
}
.story-viewer-image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none !important;
}
.story-image-gradient-top {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 150px !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}
.story-image-gradient-bottom {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 180px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* --- نواحی لمسی --- */
.story-tap-zone {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 10 !important;
    cursor: pointer;
}
.story-tap-left {
    left: 0 !important;
    width: 28% !important;
}
.story-tap-right {
    right: 0 !important;
    width: 72% !important;
}

/* --- دکمه لینک --- */
.story-link-btn {
    position: absolute !important;
    bottom: max(30px, env(safe-area-inset-bottom, 30px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 25 !important;
    background: rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: #fff !important;
    padding: 11px 24px !important;
    border-radius: 26px !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: bold;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    transition: background 0.2s, transform 0.15s !important;
}
.story-link-btn:active {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateX(-50%) scale(0.96) !important;
}

/* --- دکمه لایک --- */
.story-like-btn {
    position: absolute !important;
    bottom: max(30px, env(safe-area-inset-bottom, 30px)) !important;
    right: 18px !important;
    z-index: 25 !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 8px !important;
    color: #fff !important;
    transition: transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)) !important;
}
.story-like-btn:active {
    transform: scale(0.8) !important;
}
.story-like-btn.liked #sv-heart-outline { display: none !important; }
.story-like-btn.liked #sv-heart-filled { display: block !important; }

/* --- انیمیشن قلب --- */
.story-heart-float {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    z-index: 50 !important;
    pointer-events: none !important;
    opacity: 0 !important;
}
.story-heart-float.animate {
    animation: svHeartPop 0.85s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards !important;
}
@keyframes svHeartPop {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    10%  { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
    25%  { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
    40%  { transform: translate(-50%, -50%) scale(0.95); opacity: 1; }
    55%  { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    70%  { transform: translate(-50%, -55%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(0.7); opacity: 0; }
}

/* --- قفل اسکرول بدنه --- */
body.story-open,
body.story-open * {
    overflow: hidden !important;
    -webkit-overflow-scrolling: none !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
}
body.story-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- حالت تاریک --- */
.dark .story-circle img {
    border-color: var(--bg-main, #0a0a0a) !important;
}
.dark .story-circle-label {
    color: var(--text-secondary, #aaa) !important;
}
/* ================================================================
   سیستم استوری — تمام‌صفحه موبایل (خارج از stacking context)
   ================================================================ */

/* نوار دایره‌ها */
/* ================================================================
   سیستم استوری — نوار پیشرفت JS-driven + تمام‌صفحه
   ================================================================ */

/* نوار دایره‌ها */
.stories-bar {
    padding: 12px 0 4px 0;
}
.stories-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 0 6px 10px 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.stories-scroll::-webkit-scrollbar { display: none; }

.story-circle-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    scroll-snap-align: start;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.story-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    transition: transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(188,24,136,0.2);
}
.story-circle:active { transform: scale(0.88); }
.story-circle.seen { background: #bbb; box-shadow: none; }
.story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-main, #fff);
    display: block;
}
.story-circle-label {
    font-size: 11px;
    color: var(--text-light, #666);
    max-width: 70px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark .story-circle img { border-color: #0a0a0a; }

/* ================================================================
   نمایش‌دهنده تمام‌صفحه
   ================================================================ */
.story-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    z-index: 2147483647;
    background: #000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    pointer-events: auto;
    margin: 0; padding: 0; border: none;
}
.story-viewer.is-open {
    display: flex;
    animation: svIn 0.15s ease-out;
}
@keyframes svIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- نوار پیشرفت (JS-driven، بدون animation) --- */
.story-progress-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    gap: 3px;
    padding: 8px 8px 0 8px;
    padding-top: max(8px, env(safe-area-inset-top, 8px));
    z-index: 30;
}
.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
}
.story-progress-segment .fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 3px;
}
.story-progress-segment.done .fill {
    width: 100% !important;
    transition: none !important;
}

/* هدر */
.story-viewer-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top, 10px));
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.25) 60%, transparent 100%);
}
.story-viewer-avatar-wrap {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.8);
    flex-shrink: 0;
}
.story-viewer-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-viewer-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.story-viewer-title { color: #fff; font-size: 14px; font-weight: bold; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.story-viewer-time { color: rgba(255,255,255,0.6); font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,0.3); direction: ltr; text-align: right; }
.story-viewer-close {
    background: none; border: none; color: #fff; cursor: pointer;
    padding: 8px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0; z-index: 25;
}
.story-viewer-close:active { background: rgba(255,255,255,0.15); }

/* تصویر */
.story-viewer-image-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
}
.story-viewer-image-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}
.story-image-gradient-top {
    position: absolute; top: 0; left: 0; right: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    pointer-events: none; z-index: 2;
}
.story-image-gradient-bottom {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 160px;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
    pointer-events: none; z-index: 2;
}

/* نواحی لمسی */
.story-tap-zone {
    position: absolute; top: 0; bottom: 0; z-index: 10; cursor: pointer;
}
.story-tap-left { left: 0; width: 28%; }
.story-tap-right { right: 0; width: 72%; }

/* دکمه لینک */
.story-link-btn {
    position: absolute;
    bottom: max(28px, env(safe-area-inset-bottom, 28px));
    left: 50%; transform: translateX(-50%);
    z-index: 25;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    color: #fff; padding: 11px 24px; border-radius: 26px;
    text-decoration: none; font-size: 14px; font-weight: bold;
    display: flex; align-items: center; gap: 8px;
    border: 1.5px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.story-link-btn:active { background: rgba(255,255,255,0.3); transform: translateX(-50%) scale(0.96); }

/* دکمه لایک */
.story-like-btn {
    position: absolute;
    bottom: max(28px, env(safe-area-inset-bottom, 28px));
    right: 18px;
    z-index: 25;
    background: none; border: none; cursor: pointer;
    padding: 8px; color: #fff;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.story-like-btn:active { transform: scale(0.75); }
.story-like-btn.liked #sv-heart-outline { display: none; }
.story-like-btn.liked #sv-heart-filled { display: block; }

/* نشانگر توقف */
.story-paused-indicator {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: #fff; font-size: 13px; font-weight: bold;
    background: rgba(0,0,0,0.5);
    padding: 14px 22px; border-radius: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.story-paused-indicator.visible { opacity: 1; }

/* انیمیشن قلب */
.story-heart-float {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 50; pointer-events: none; opacity: 0;
}
.story-heart-float.animate {
    animation: svHeart 0.85s cubic-bezier(0.17,0.89,0.32,1.28) forwards;
}
@keyframes svHeart {
    0%   { transform: translate(-50%,-50%) scale(0); opacity: 0; }
    10%  { transform: translate(-50%,-50%) scale(0.3); opacity: 1; }
    25%  { transform: translate(-50%,-50%) scale(1.35); opacity: 1; }
    40%  { transform: translate(-50%,-50%) scale(0.95); opacity: 1; }
    55%  { transform: translate(-50%,-50%) scale(1.05); opacity: 1; }
    70%  { transform: translate(-50%,-55%) scale(1); opacity: 1; }
    100% { transform: translate(-50%,-80%) scale(0.7); opacity: 0; }
}

/* قفل اسکرول */
body.story-open {
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.story-open > *:not(#story-viewer):not(#stories-bar) {
    overflow: hidden !important;
    -webkit-overflow-scrolling: none !important;
    touch-action: none !important;
}
/* فقط عناصر خارج از استوری قفل شوند — استوری لمس‌پذیر بماند */
body.story-open > *:not(#story-viewer):not(#stories-bar) {
    overflow: hidden !important;
    -webkit-overflow-scrolling: none !important;
    touch-action: none !important;
}
/* جلوگیری از سلکت و منوی کپی/پیست روی استوری */
.story-viewer,
.story-viewer * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}
/* ===== مودال نسخه جدید ===== */
#update-modal-box {
    background: var(--glass, #fff);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    border-radius: 20px;
    padding: 2rem 1.8rem 1.6rem;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: updateModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes updateModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.update-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.update-modal-spinning {
    animation: modalSpin 1.5s linear infinite;
}
@keyframes modalSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: var(--text, #111);
}

.update-modal-desc {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-light, #666);
    margin-bottom: 1.5rem;
}

.update-modal-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 15px rgba(34,197,94,0.3);
    font-family: inherit;
}
.update-modal-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}

.update-modal-later {
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-light, #888);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-family: inherit;
}
.update-modal-later:active {
    opacity: 0.6;
}

/* نوار پیشرفت داخل مودال */
.update-modal-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.update-modal-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 10px;
    transition: width 2.8s linear;
}

/* حالت تاریک */
.dark .update-modal-icon {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.05));
    border-color: rgba(34,197,94,0.3);
}
.dark .update-modal-progress-track {
    background: rgba(255,255,255,0.08);
}

/* موبایل */
@media (max-width: 768px) {
    #update-modal-box {
        padding: 1.8rem 1.5rem 1.4rem;
        max-width: 290px;
        border-radius: 18px;
    }
    .update-modal-icon {
        width: 64px;
        height: 64px;
    }
    .update-modal-title {
        font-size: 1.1rem;
    }
}/* ================= استایل کارت گسترش‌یافقی (Edge Swipe) ================= */
.list-item-row {
    touch-action: pan-y pinch-zoom; /* حالت عادی: اجازه اسکرول عمودی */
}

/* وقتی از لبه کشیده می‌شود، جلوی اسکرول را می‌گیرد */
.list-item-row.edge-swiping {
    touch-action: none; 
}

/* وقتی کارت باز می‌شود کل ردیف را می‌گیرد */
.list-item-row.card-expanded-side {
    width: 100% !important;
    grid-column: 1 / -1 !important;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    touch-action: none; /* جلوگیری از اسکرول هنگام باز بودن کارت */
}

/* تغییر چیدمان داخلی کارت به افقی (هم برای کارت عادی هم کریپتو) */
.list-item-row.card-expanded-side > .card-row,
.list-item-row.card-expanded-side > .crypto-card-content {
    display: flex !important;
    flex-direction: row-reverse; /* در RTL محتوا راست می‌ماند، نمودار چپ باز می‌شود */
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap; /* جلوگیری از افتادن نمودار به خط پایین */
}

/* کانتینر نمودار کناری */
.card-chart-side-container {
    width: 0;
    opacity: 0;
    height: 85px; /* ارتفاع نمودار */
    min-width: 0; /* بسیار مهم برای انیمیشن */
    transition: width 0.35s ease, opacity 0.35s ease, min-width 0.35s ease;
    position: relative;
    flex-shrink: 0;
}

/* وقتی کارت باز شد، نمودار کناری ظاهر می‌شود */
.list-item-row.card-expanded-side .card-chart-side-container {
    width: 45%;
    min-width: 130px; /* حداقل عرض برای خواندن نمودار */
    opacity: 1;
}

.card-chart-side-container canvas {
    width: 100% !important;
    height: 100% !important;
}
/* ========================================================================= */
.main-card {
    transition: width 0.3s ease, transform 0.2s ease;
    position: relative;
}

.main-card.chart-expanded {
    grid-column: span 2;
    width: 100%;
}

.main-card.chart-expanded .card-chart {
    display: block;
    width: 100%;
    margin-top: 15px;
}

.main-card .card-chart {
    display: none;
}

.card-chart-wrapper {
    width: 100%;
    height: 280px;
    margin-top: 15px;
    position: relative;
}

.card-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}
/* ===== کارت بازشونده با نمودار ===== */
/* ========================================== */
/* ✅ استایل نمودار مینی (هماهنگ با تم و وسط‌چین) */
/* ========================================== */

.card-expanded {
    grid-column: 1 / -1 !important;
    /* ✅ بسیار مهم: لغو مربعی بودن تا نمودار در وسط قرار بگیرد */
    aspect-ratio: auto !important; 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    overflow: visible !important;
    /* ✅ حفظ حاشیه‌های کارت */
    padding: clamp(0.7rem, 2vw, 1.2rem) !important;
}

.mini-chart-wrap {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease,
                margin 0.35s ease;
    margin-top: 0;
    position: relative;
}

.mini-chart-wrap.open {
    max-height: 280px;
    opacity: 1;
    margin-top: 0; /* ✅ فاصله بالا صفر شد چون جاوااسکریپت فاصله ایجاد کرده */
    z-index: 5;
    
    /* ✅ هماهنگی کامل با پس‌زمینه شیشه‌ای کارت */
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px 4px 0 4px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

/* ✅ مرکز کردن دقیق نمودار */
.mini-chart-inner {
    width: 100%;
    height: 180px; /* کمی کوچکتر برای اینکه بهتر در کارت جا شود */
    position: relative;
    padding: 0 4px;
    max-width: 600px;
    margin: 0 auto;
}

.mini-chart-inner canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ✅ استایل لودینگ (اسپینر) */
.mini-chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.85rem;
    gap: 8px;
    z-index: 2;
}

.mini-chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--positive, #27ae60);
    border-radius: 50%;
    animation: miniSpin 0.7s linear infinite;
}

@keyframes miniSpin {
    to { transform: rotate(360deg); }
}

/* ✅ جلوگیری از بریده شدن نمودار در لیست‌ها */
.list:has(.card-expanded) {
    overflow: visible !important;
}

.grid:has(.card-expanded) {
    overflow: visible !important;
}

.list-item-row.card-expanded {
    position: relative;
    z-index: 10;
    overflow: visible !important;
}

/* ========================================== */
/* ✅ بهینه‌سازی تم تاریک برای نمودار */
/* ========================================== */
.dark .mini-chart-wrap.open {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.light .mini-chart-wrap.open {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}