
@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 ===================== */
header {
  position: sticky;
  z-index: 1000;
  padding: 1rem 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;
  }
}
@media (max-width: 768px) {

  /* مخفی در حالت عادی */
  .converter-card {
    display: none !important;
  }

  /* وقتی داخل drawer قرار گرفت، نمایش داده شود */
  #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: 500;                /* بولد */
    gap: 1rem;  
  
 
}
/* فاصله مناسب با اندازه بزرگ‌تر */
  
}

/* اگر می‌خواهی فقط تاریخ بولدتر یا بزرگ‌تر باشد (اختیاری) */
#home-date {
  font-weight: 600;                  /* خیلی بولد */
  /* font-size: 0.96rem; */         /* اگر می‌خواهی تاریخ کمی بزرگ‌تر از ساعت باشد */
}

/* اگر می‌خواهی ساعت کمی متفاوت باشد (اختیاری) */
#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)
    );
}
