/* Dahabsouria.com — altin.in inspired dark financial palette */
:root {
  --bg-primary: #121212;
  --bg-secondary: #1C1C1E;
  --bg-card: #1C1C1E;
  --border-color: #2c2c2e;
  --border-grid: #2c2c2e;
  --text-main: #E8E8E8;
  --text-muted: #9A9A9A;
  --accent-gold: #D6A94D;
  --accent-gold-glow: rgba(214, 169, 77, 0.15);
  --accent-buy: #4CAF50;
  --accent-sell: #D9534F;
  --accent-green: #4CAF50;
  --accent-red: #D9534F;
  --accent-blue: #5B9BD5;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Cairo, sans-serif;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
}

[data-theme="light"] {
  --bg-primary: #f2f2f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e5e5ea;
  --border-grid: #d1d1d6;
  --text-main: #1c1c1e;
  --text-muted: #6e6e73;
  --accent-gold: #b8860b;
  --accent-buy: #2e7d32;
  --accent-sell: #c62828;
  --accent-green: #2e7d32;
  --accent-red: #c62828;
}

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

body {
  direction: rtl;
  text-align: right;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.4;
  padding-bottom: 60px;
}

.container {
  width: 100%;
  max-width: 680px; /* Focused mobile-first view */
  margin: 0 auto;
  padding: 0 12px;
}

/* Header Navbar */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Top Ticker Ribbon (Sticky below header) */
.ticker-ribbon {
  background: #151517;
  border-bottom: 1px solid var(--border-grid);
  padding: 8px 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  position: sticky;
  top: 52px; /* Cascades right below header */
  z-index: 999;
  overflow: hidden;
  width: 100%;
}

.ticker-content-wrapper {
  overflow: hidden;
  width: 100%;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-marquee 30s linear infinite;
}

.ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker-marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.ticker-item {
  display: inline-block;
  margin-inline-end: 30px;
}

.ticker-item strong {
  color: #fff;
  margin-inline-start: 4px;
}

.ticker-val-green {
  color: var(--accent-green);
  margin-inline-start: 4px;
}


.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.main-logo-img {
  height: 52px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.logo-brand:hover .main-logo-img {
  transform: scale(1.03);
}

@media (max-width: 480px) {
  .main-logo-img {
    height: 32px;
    max-width: 120px;
  }
}

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

/* Toggle buttons styling */
.lira-toggle-wrapper {
  display: flex;
  background: #262628;
  padding: 2px;
  border-radius: var(--radius-sm);
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent-gold);
  color: #000;
  font-weight: 800;
}

#toggle-lang {
  border: 1px solid var(--border-color);
  background: #262628;
  color: var(--accent-gold);
  font-weight: bold;
}

/* Altin.in Table Layout */
.altin-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-grid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Header bar with updated timestamp */
.altin-table-header {
  background: #1c1c1e;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-grid);
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.altin-table-header span {
  color: var(--accent-gold);
}

/* Navigation toolbar under headers */
.altin-toolbar {
  display: flex;
  gap: 12px;
  background: #151517;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-grid);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.altin-toolbar a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.altin-toolbar a:hover {
  color: var(--accent-gold);
}

/* Table columns labels row */
.altin-labels-row {
  display: flex;
  background: #181819;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-grid);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

.col-label-name { flex: 2; }
.col-label-buy { flex: 1.2; text-align: center; }
.col-label-sell { flex: 1.2; text-align: center; }
.col-label-status { flex: 0.8; text-align: center; }

/* Financial Row Group */
.altin-row-group {
  border-bottom: 1px solid var(--border-grid);
}

.altin-row-group:last-child {
  border-bottom: none;
}

.altin-main-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
}

.col-name {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gold-icon-img {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  flex-shrink: 0;
}

.gold-icon-img img, .instrument-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.instrument-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.col-buy {
  flex: 1.2;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-buy);
  text-align: center;
}

.col-sell {
  flex: 1.2;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-sell);
  text-align: center;
}

.col-status {
  flex: 0.8;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* FAQ Accordion & Guides (SEO & UX) */
.faq-section {
  margin-top: 24px;
}

.faq-title {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 800;
  margin-bottom: 14px;
}

.faq-accordion details {
  background: var(--bg-secondary);
  border: 1px solid var(--border-grid);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.faq-accordion details[open] {
  border-color: var(--accent-gold);
  background: #141416;
}

.faq-accordion summary {
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-accordion summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--accent-gold);
  font-weight: 900;
  margin-left: 10px;
}

.faq-accordion details[open] summary::after {
  content: "−";
}

.faq-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.guide-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-grid);
  border-radius: 8px;
  padding: 16px;
}

.guide-card h3 {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.4;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.arrow-up img, .arrow-down img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.arrow-up svg {
  color: #00a34a;
  fill: #00a34a;
}

.arrow-down svg {
  color: #ff0000;
  fill: #ff0000;
}

.altin-comment-row {
  background: #111112;
  padding: 6px 14px 10px 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.02);
  font-size: 0.72rem;
  line-height: 1.4;
  color: #8e8e93;
  display: block;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.altin-comment-row:hover {
  background: #1a1a1c;
  color: var(--text-main);
}

.comment-user {
  color: var(--accent-gold);
  font-weight: 800;
  margin-left: 6px;
}

.comment-arrow {
  color: #8c7c59;
  margin-left: 4px;
}

/* Pushed down calculator */
.converter-container {
  background: var(--bg-card);
  border: 1px solid var(--border-grid);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.converter-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-muted);
  margin-bottom: 12px;
  border-right: 3px solid var(--accent-gold);
  padding-right: 6px;
}

.preset-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  background: #262628;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.converter-inputs {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  margin-bottom: 12px;
}

.input-wrapper input {
  width: 100%;
  height: 38px;
  background: #0d0d0d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  outline: none;
}

.copy-btn {
  width: 100%;
  height: 38px;
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* City Links Grid */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  margin-top: 24px;
}

.city-link {
  background: var(--bg-card);
  border: 1px solid var(--border-grid);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.city-link:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 40px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

footer a {
  color: var(--accent-gold);
  text-decoration: none;
}

/* Pulsating Green Breathing Live Indicator */
.live-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: pulse-green 1.8s infinite;
  vertical-align: middle;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

/* Price Flashing Animations */
.flash-up {
  animation: flash-green 1.2s ease-out;
  border-radius: 4px;
}
.flash-down {
  animation: flash-red 1.2s ease-out;
  border-radius: 4px;
}

@keyframes flash-green {
  0% {
    background-color: rgba(46, 204, 113, 0.25);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes flash-red {
  0% {
    background-color: rgba(255, 69, 58, 0.25);
  }
  100% {
    background-color: transparent;
  }
}
