/* ================================================
   DailyGoldPrice.today — Mobile-First Gold Theme
   ================================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Core Palette */
  --bg-body: #080a0f;
  --bg-surface: #0f1219;
  --bg-card: #151a28;
  --bg-card-alt: #1b2136;
  --bg-input: #111725;
  --border: #1f2940;
  --border-gold: rgba(212, 175, 55, 0.35);

  /* Text */
  --text-primary: #f4f6fb;
  --text-secondary: #8f9bb3;
  --text-muted: #5f6d87;

  /* Gold Palette */
  --gold-50: #fff9e6;
  --gold-100: #ffeeb3;
  --gold-200: #ffe280;
  --gold-300: #ffd64d;
  --gold-400: #ffcc26;
  --gold-500: #ffd700;
  --gold-600: #d4af37;
  --gold-700: #b8941e;
  --gold-800: #8c6e14;
  --gold-900: #5c470d;
  --gold-glow: rgba(255, 215, 0, 0.12);
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #d4af37 50%, #b8941e 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);

  /* Accents */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;

  /* Layout */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-gold: 0 4px 30px rgba(212, 175, 55, 0.12);
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 68px;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.gold-icon { color: var(--gold-500); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- NAVBAR ---------- */
.navbar {
  background: rgba(15, 18, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 10px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  min-width: 0;
}

.logo-icon {
  font-size: 1.1rem;
  color: var(--gold-500);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: baseline;
  color: #ffffff;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .brand-name {
    font-size: 1.2rem;
  }
}

.brand-name .gold {
  color: var(--gold-500);
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-500);
  margin-left: 2px;
  opacity: 0.85;
}

.header-datetime {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-400);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.22);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .header-datetime {
    font-size: 0.74rem;
    padding: 5px 10px;
  }
}

.header-datetime .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.btn-refresh-inline {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--gold-500);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.btn-refresh-inline:active {
  transform: scale(0.9);
}

.btn-refresh-inline.spinning i {
  animation: spin 0.8s linear infinite;
}

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

.btn-refresh:active {
  background: var(--bg-card-alt);
  transform: scale(0.94);
}

.btn-refresh.spinning i {
  animation: spin 0.8s linear infinite;
}

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

/* ---------- QUICK GLANCE BAR ---------- */
.quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.quick-item {
  flex: 1;
  text-align: center;
}

.q-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.q-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-400);
}

.q-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---------- PAGE TITLE ---------- */
.page-title-wrap {
  margin: 14px 0 12px 0;
}

.page-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.page-main-title .gold {
  color: var(--gold-400);
}

/* ---------- PRICE CARDS ---------- */
.cards-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .cards-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-section {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gold-card {
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.gold-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.1);
}

.gold-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-karat {
  font-size: 1.2rem;
  font-weight: 800;
}

.card-purity {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.card-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

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

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

/* Hero Price inside Card */
.card-hero-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 14px;
}

.hero-rupee {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-500);
}

.hero-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: -1px;
  line-height: 1;
}

.hero-per {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

/* Card Weight Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 215, 0, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.18);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.grid-item:hover {
  background: rgba(255, 215, 0, 0.14);
  border-color: var(--gold-500);
}

.grid-item span {
  font-size: 0.68rem;
  color: var(--gold-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.grid-item strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- PANELS (Shared) ---------- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.panel.calc-panel {
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.08);
}

.panel.calc-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gst-toggle-group {
  display: inline-flex;
  background: rgba(14, 20, 32, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.gst-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}

.gst-btn.active {
  background: var(--gold-gradient);
  color: #000000;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.gst-btn:not(.active):hover {
  color: var(--gold-400);
}

/* ---------- CALCULATOR ---------- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.calc-field-full {
  grid-column: span 2;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calc-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.calc-field input,
.calc-field select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.calc-field input:focus,
.calc-field select:focus {
  border-color: var(--gold-600);
}

.calc-field select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Segmented Button Groups */
.segmented-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 9px 4px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  text-align: center;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--gold-gradient);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.25);
}

.seg-btn:not(.active):hover {
  color: var(--gold-400);
  background: rgba(255, 215, 0, 0.06);
}

.calc-output {
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.breakdown-row strong {
  color: var(--text-primary);
  font-weight: 700;
}

.calc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.calc-total span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.calc-total strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-400);
}

/* ---------- CHART ---------- */
.timeframe-btns {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}

.tf-btn.active {
  background: var(--gold-600);
  color: #000;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

@media (min-width: 768px) {
  .chart-container { height: 320px; }
}

/* ---------- TABLE ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  max-width: 180px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 0.82rem;
  font-family: var(--font);
  width: 100%;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.rate-table th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rate-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.rate-table tbody tr:active {
  background: var(--bg-card-alt);
}

/* ---------- WHATSAPP SHARE BUTTON (MOBILE STICKY & DESKTOP FLOATING) ---------- */
.sticky-wa {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 10, 15, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 150;
}

@media (min-width: 768px) {
  .sticky-wa {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: auto;
    background: transparent;
    border-top: none;
    padding: 0;
  }

  .btn-wa-full {
    width: auto;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    font-size: 0.92rem;
  }
}

.btn-wa-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--whatsapp) 0%, var(--whatsapp-dark) 100%);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
  transition: transform var(--transition);
}

.btn-wa-full:active {
  transform: scale(0.97);
}

.btn-wa-full i { font-size: 1.15rem; }

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.footer-brand .gold {
  color: var(--gold-500);
}

.footer-brand .brand-tag {
  color: var(--gold-500);
  font-size: 0.8em;
  opacity: 0.85;
}

.footer-city-links {
  margin: 18px 0 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.footer-links-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.city-links-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  max-width: 720px;
  margin: 0 auto;
}

.footer-city-link {
  color: var(--gold-400);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.footer-city-link:hover {
  color: var(--gold-200);
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.footer-disclaimer {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  margin-top: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ---------- RESPONSIVE TWEAKS ---------- */
@media (max-width: 380px) {
  .brand-name { font-size: 1rem; }
  .btn-text { display: none; }
  .hero-banner h1 { font-size: 1.35rem; }
  .hero-amount { font-size: 1.7rem; }
  .q-price { font-size: 0.92rem; }
  .q-label { font-size: 0.6rem; }
  .calc-grid { grid-template-columns: 1fr; }
}

@media (min-width: 381px) and (max-width: 767px) {
  .hero-amount { font-size: 1.85rem; }
}

