/* Precious metals pages — silver / emas
   Aligns with bursa design tokens (--panel, --text, --muted, etc.) */

/* Fallback if reveal observer fails: keep content readable */
@media (prefers-reduced-motion: reduce) {
  body.metal-gold .reveal,
  body.metal-silver .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

:root {
  --metal-card: var(--panel, rgba(8, 16, 30, 0.72));
  --metal-text: var(--text, #f4f7fb);
  --metal-muted: var(--muted, #93a4be);
  --metal-border: var(--border, rgba(255, 255, 255, 0.10));
  --metal-gold: var(--gold, #f5b942);
  --metal-cyan: var(--cyan, #6ad9ff);
  --metal-accent: var(--cyan, #6ad9ff);
  --metal-mint: var(--mint, #5fe3c1);
  --metal-rose: var(--rose, #ff7b9c);
}

/* Layout primitives missing from current bursa.css */
.bursa-section {
  padding: 36px 0;
  position: relative;
  z-index: 1;
}

.bursa-section .container,
#main-content .container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

/* Align standard AINNA footer strip with metal page layout */
body.metal-gold .ainna-page-footer-strip,
body.metal-silver .ainna-page-footer-strip,
body.metal-gold .ainna-page-footer,
body.metal-silver .ainna-page-footer {
  position: relative;
  z-index: 2;
  margin-top: 28px;
  margin-bottom: 28px;
}

body.metal-gold .btn.lang-switch,
body.metal-silver .btn.lang-switch {
  white-space: nowrap;
}

/* Hero */
.brent-hero {
  padding: 48px 0 28px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.brent-hero .hero-kicker {
  color: var(--metal-gold);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}

.brent-hero .hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f5b942, #ef4444, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brent-hero .hero-desc {
  color: var(--metal-muted);
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.brent-hero .hero-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.brent-hero .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  text-decoration: none;
}

.brent-hero .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.32);
}

.brent-hero .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--metal-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--metal-text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.brent-hero .btn-secondary:hover {
  border-color: rgba(106, 217, 255, 0.4);
  background: rgba(106, 217, 255, 0.08);
  transform: translateY(-1px);
}

/* Price card */
.brent-price-card {
  background: var(--metal-card);
  border: 1px solid var(--metal-border);
  border-radius: 22px;
  padding: 28px 32px;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brent-price-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.brent-price-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--metal-text);
  letter-spacing: -0.02em;
}

.brent-price-ticker {
  font-size: 13px;
  color: var(--metal-muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.brent-alert-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.brent-alert-actions .btn-secondary {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid var(--metal-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--metal-text);
  cursor: pointer;
  font-weight: 600;
}

.brent-alert-actions .btn-secondary:hover {
  border-color: rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.08);
}

.brent-price-value {
  text-align: right;
}

.brent-price-num {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brent-price-change {
  font-size: 15px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.brent-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.brent-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.brent-stat-label {
  font-size: 11px;
  color: var(--metal-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.brent-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--metal-text);
  font-variant-numeric: tabular-nums;
}

/* Main chart card */
.brent-chart-card {
  background: var(--metal-card);
  border: 1px solid var(--metal-border);
  border-radius: 22px;
  padding: 22px 24px;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.brent-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--metal-text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.brent-chart-body {
  height: 360px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.14);
}

.brent-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 360px;
}

/* Notes + FAQ */
.brent-note {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 24px;
  background: var(--metal-card);
  border: 1px solid var(--metal-border);
  border-radius: 18px;
  position: relative;
  z-index: 1;
}

.brent-note h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--metal-gold);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brent-note p {
  font-size: 14px;
  color: var(--metal-muted);
  line-height: 1.7;
  margin: 0;
}

.brent-note a {
  color: var(--metal-cyan);
  text-decoration: none;
}

.brent-note a:hover {
  text-decoration: underline;
}

.brent-faq {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.brent-faq h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--metal-text);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.brent-faq details {
  background: var(--metal-card);
  border: 1px solid var(--metal-border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.brent-faq summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--metal-text);
  cursor: pointer;
  list-style: none;
}

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

.brent-faq details[open] summary {
  color: var(--metal-gold);
}

.brent-faq details p {
  font-size: 13px;
  color: var(--metal-muted);
  line-height: 1.65;
  margin: 12px 0 0;
}

/* News ticker + section (Brent method, reuse bursa news styles) */
.metal-ticker-wrap {
  padding-top: 18px;
  position: relative;
  z-index: 2;
}

.metal-ticker-wrap .news-ticker {
  margin: 0;
}

.metal-news-section .section-heading {
  margin-bottom: 16px;
}

.metal-news-section .news-tabs {
  margin-bottom: 14px;
}

.metal-news-section .news-grid {
  margin-bottom: 10px;
}

/* Category badges for precious metals */
.ticker-item .cat.cat-gold,
.news-badge.gold {
  background: rgba(245, 185, 66, 0.14);
  color: var(--gold, #f5b942);
}

.ticker-item .cat.cat-silver,
.news-badge.silver {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.ticker-item .cat.cat-politics,
.news-badge.politics {
  background: rgba(106, 217, 255, 0.14);
  color: var(--cyan, #6ad9ff);
}

.ticker-item .cat.cat-geopolitics,
.news-badge.geopolitics {
  background: rgba(255, 123, 156, 0.14);
  color: var(--rose, #ff7b9c);
}

html[data-theme='light'] .ticker-item .cat.cat-silver,
html[data-theme='light'] .news-badge.silver {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

/* Forecast + history section */
.metal-forecast-section {
  margin-top: 4px;
}

.metal-forecast-section .section-heading {
  margin-bottom: 18px;
}

.metal-forecast-section .kpi-grid {
  margin-bottom: 18px;
}

.metal-forecast-note {
  max-width: none;
  margin: 0 0 22px;
  padding: 20px 22px;
  background: var(--metal-card);
  border: 1px solid var(--metal-border);
  border-radius: 18px;
  position: relative;
  z-index: 1;
}

.metal-forecast-note h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--metal-gold);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metal-forecast-note p {
  font-size: 14px;
  color: var(--metal-muted);
  line-height: 1.7;
  margin: 0;
}

.metal-forecast-note #confidence-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--metal-text);
  font-variant-numeric: tabular-nums;
}

/* Chart grid + canvas (missing from bursa.css) */
.metal-forecast-section .chart-grid,
.metal-history-section .chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.metal-forecast-section .chart-card,
.metal-history-section .chart-card {
  border-radius: 20px;
  min-height: 0;
}

.metal-forecast-section .chart-span-2,
.metal-history-section .chart-span-2 {
  grid-column: span 2;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

html[data-theme='light'] .chart-canvas-wrap,
html[data-theme='light'] .brent-chart-body {
  background: rgba(12, 23, 41, 0.04);
  border-color: rgba(12, 20, 35, 0.06);
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--metal-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 99px;
}

.chart-legend .lg-hist { background: var(--metal-cyan); }
.chart-legend .lg-base { background: var(--metal-gold); }
.chart-legend .lg-band { background: rgba(106, 217, 255, 0.45); }

/* Metal theme accents */
body.metal-gold .brent-hero .hero-title {
  background: linear-gradient(135deg, #f5b942, #ff9f1c, #facc15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.metal-gold .brent-price-card {
  border-color: rgba(245, 185, 66, 0.22);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(245, 185, 66, 0.06);
}

body.metal-gold .brent-hero .btn-primary {
  background: linear-gradient(135deg, #f5b942, #ff9f1c);
}

body.metal-silver .brent-hero .hero-title {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af, #6ad9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.metal-silver .brent-price-card {
  border-color: rgba(106, 217, 255, 0.2);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(106, 217, 255, 0.06);
}

body.metal-silver .brent-hero .btn-primary {
  background: linear-gradient(135deg, #94a3b8, #6ad9ff);
}

/* Light theme readability */
html[data-theme='light'] .brent-price-card,
html[data-theme='light'] .brent-chart-card,
html[data-theme='light'] .brent-note,
html[data-theme='light'] .brent-faq details,
html[data-theme='light'] .metal-forecast-note,
html[data-theme='light'] .brent-stat {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme='light'] .brent-stats-row {
  border-top-color: rgba(12, 20, 35, 0.08);
}

/* Responsive */
@media (max-width: 980px) {
  .metal-forecast-section .chart-grid,
  .metal-history-section .chart-grid {
    grid-template-columns: 1fr;
  }

  .metal-forecast-section .chart-span-2,
  .metal-history-section .chart-span-2 {
    grid-column: auto;
  }

  .chart-canvas-wrap {
    height: 240px;
  }

  .brent-chart-body {
    height: 300px;
  }

  .brent-chart-body canvas {
    max-height: 300px;
  }
}

@media (max-width: 720px) {
  .brent-hero {
    padding: 28px 0 16px;
  }

  .bursa-section {
    padding: 24px 0;
  }

  .brent-price-card,
  .brent-chart-card {
    padding: 18px;
    border-radius: 18px;
  }

  .brent-price-value {
    text-align: left;
    width: 100%;
  }

  .brent-price-num {
    font-size: 34px;
  }

  .chart-canvas-wrap {
    height: 220px;
  }

  .brent-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
