/*
Theme Name: sQuareindia-Professional
Theme URI: https://www.squareindia.com
Author: sQuareindia Advisory
Description: sQuareindia-Professional — Live International Gold & Silver Rates with News, mobile-first dark gold theme
Version: 2.0
Text Domain: squareindia-professional
*/

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --sq-dark:       #0a0f1e;
  --sq-card:       #111827;
  --sq-card2:      #0d1526;
  --sq-gold:       #d4af37;
  --sq-gold-light: #f0c840;
  --sq-green:      #00c853;
  --sq-red:        #ff1744;
  --sq-text:       #e2e8f0;
  --sq-muted:      #7a8499;
  --sq-border:     #1e2d45;
  --sq-nav-bg:     #070c18;
  --sq-ticker-bg:  #050a14;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--sq-dark);
  color: var(--sq-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--sq-gold); text-decoration: none; }
a:hover { color: var(--sq-gold-light); }

/* ── Ticker Bar ─────────────────────────────────────────────── */
#sq-ticker {
  background: var(--sq-ticker-bg);
  border-bottom: 1px solid var(--sq-border);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.ticker-label {
  flex-shrink: 0;
  background: var(--sq-gold);
  color: #000;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  text-transform: uppercase;
}

.ticker-track {
  display: flex;
  gap: 0;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid var(--sq-border);
}

.ticker-sym { color: var(--sq-muted); font-size: 11px; }
.ticker-price { color: var(--sq-text); }
.ticker-change.up   { color: var(--sq-green); }
.ticker-change.down { color: var(--sq-red); }
.ticker-change.flat { color: var(--sq-muted); }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Navigation ─────────────────────────────────────────────── */
#sq-nav {
  background: var(--sq-nav-bg);
  border-bottom: 1px solid var(--sq-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

#sq-nav .navbar-brand img { height: 42px; }

#sq-nav .navbar-toggler {
  border-color: var(--sq-border);
  color: var(--sq-gold);
}
#sq-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23d4af37' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#sq-nav .nav-link {
  color: var(--sq-text) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px !important;
  transition: color 0.2s;
}
#sq-nav .nav-link:hover,
#sq-nav .nav-link.active { color: var(--sq-gold) !important; }

#sq-nav .dropdown-menu {
  background: var(--sq-card);
  border: 1px solid var(--sq-border);
  border-radius: 8px;
  padding: 6px 0;
}
#sq-nav .dropdown-item {
  color: var(--sq-text);
  font-size: 13px;
  padding: 8px 16px;
}
#sq-nav .dropdown-item:hover { background: var(--sq-border); color: var(--sq-gold); }

.btn-whatsapp {
  background: #25D366;
  color: #fff !important;
  border-radius: 20px;
  padding: 6px 16px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.btn-whatsapp:hover { background: #1eb855; color: #fff !important; }
.btn-whatsapp i { margin-right: 5px; }

/* ── Section Titles ─────────────────────────────────────────── */
.sq-section { padding: 32px 0; }

.sq-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.sq-section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--sq-gold);
  margin: 0;
}
.sq-section-title .title-line {
  flex: 1;
  height: 1px;
  background: var(--sq-border);
}
.sq-section-title .live-badge {
  background: var(--sq-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  animation: pulse-badge 2s ease infinite;
}
@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.refresh-info {
  color: var(--sq-muted);
  font-size: 11px;
  margin-top: -16px;
  margin-bottom: 20px;
}
.refresh-info span { color: var(--sq-gold); font-weight: 600; }

/* ── Live Rate Cards ────────────────────────────────────────── */
.rate-card {
  background: var(--sq-card);
  border: 1px solid var(--sq-border);
  border-radius: 12px;
  padding: 20px;
  height: 100%;
  transition: border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.rate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sq-gold);
  border-radius: 12px 12px 0 0;
}
.rate-card:hover { border-color: var(--sq-gold); }

.rate-card .rc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.rate-card .rc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sq-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rate-card .rc-icon {
  font-size: 20px;
  opacity: 0.3;
}
.rate-card .rc-exchange {
  font-size: 10px;
  color: var(--sq-muted);
  background: var(--sq-card2);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 3px;
}

.rate-card .rc-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 6px;
  transition: color 0.3s;
}
.rate-card .rc-change {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.rate-card .rc-hl {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--sq-muted);
  border-top: 1px solid var(--sq-border);
  padding-top: 10px;
  margin-top: 4px;
}
.rate-card .rc-hl span { flex: 1; }
.rate-card .rc-hl .h-val { color: var(--sq-red); }
.rate-card .rc-hl .l-val { color: var(--sq-green); }

.price-up   { color: var(--sq-green) !important; }
.price-down { color: var(--sq-red) !important; }
.price-flat { color: var(--sq-text) !important; }

/* Flash animation on price update */
@keyframes flash-green {
  0%,100% { background: transparent; }
  30%      { background: rgba(0,200,83,0.12); }
}
@keyframes flash-red {
  0%,100% { background: transparent; }
  30%      { background: rgba(255,23,68,0.12); }
}
.flash-up   { animation: flash-green 0.6s ease; }
.flash-down { animation: flash-red   0.6s ease; }

.rates-loading {
  text-align: center;
  padding: 40px;
  color: var(--sq-muted);
}
.rates-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--sq-border);
  border-top-color: var(--sq-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── News Section ───────────────────────────────────────────── */
.news-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.news-filter-btn {
  background: var(--sq-card);
  color: var(--sq-muted);
  border: 1px solid var(--sq-border);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.news-filter-btn:hover,
.news-filter-btn.active {
  background: var(--sq-gold);
  color: #000;
  border-color: var(--sq-gold);
}

.news-grid { display: flex; flex-direction: column; gap: 12px; }

.news-card {
  background: var(--sq-card);
  border: 1px solid var(--sq-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}
.news-card:hover {
  border-color: var(--sq-gold);
  transform: translateX(2px);
  text-decoration: none;
}

.news-card .nc-img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--sq-card2);
}
.news-card .nc-body { flex: 1; min-width: 0; }
.news-card .nc-source {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sq-gold);
  margin-bottom: 4px;
}
.news-card .nc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sq-text);
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card:hover .nc-title { color: var(--sq-gold-light); }
.news-card .nc-meta {
  font-size: 11px;
  color: var(--sq-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.news-card .nc-tag {
  background: var(--sq-card2);
  border: 1px solid var(--sq-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--sq-muted);
}
.news-card .nc-tag.gold-tag   { border-color: var(--sq-gold);  color: var(--sq-gold); }
.news-card .nc-tag.silver-tag { border-color: #c0c0c0;         color: #c0c0c0; }

.news-loading, .news-empty {
  text-align: center;
  padding: 48px;
  color: var(--sq-muted);
}

#load-more-news {
  display: block;
  margin: 20px auto 0;
  background: transparent;
  border: 1px solid var(--sq-gold);
  color: var(--sq-gold);
  border-radius: 8px;
  padding: 10px 32px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
#load-more-news:hover { background: var(--sq-gold); color: #000; }

/* ── Advisory Packages ──────────────────────────────────────── */
.pkg-card {
  background: var(--sq-card);
  border: 1px solid var(--sq-border);
  border-radius: 12px;
  padding: 24px;
  height: 100%;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.pkg-card:hover { border-color: var(--sq-gold); transform: translateY(-2px); }
.pkg-card .pkg-icon {
  font-size: 32px;
  color: var(--sq-gold);
  margin-bottom: 12px;
}
.pkg-card h4 { font-size: 16px; font-weight: 700; color: var(--sq-gold); margin-bottom: 10px; }
.pkg-card p  { font-size: 13px; color: var(--sq-muted); margin-bottom: 16px; }
.pkg-card .btn-pkg {
  background: transparent;
  border: 1px solid var(--sq-gold);
  color: var(--sq-gold);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-block;
}
.pkg-card .btn-pkg:hover { background: var(--sq-gold); color: #000; text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────────── */
#sq-footer {
  background: var(--sq-nav-bg);
  border-top: 1px solid var(--sq-border);
  padding: 32px 0 16px;
}
#sq-footer .footer-brand img { height: 38px; margin-bottom: 10px; }
#sq-footer p { font-size: 12px; color: var(--sq-muted); }
#sq-footer .footer-links a {
  color: var(--sq-muted);
  font-size: 12px;
  margin: 0 8px;
  transition: color 0.2s;
}
#sq-footer .footer-links a:hover { color: var(--sq-gold); }
#sq-footer .footer-bottom {
  border-top: 1px solid var(--sq-border);
  margin-top: 20px;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--sq-muted);
}

/* ── WhatsApp Float ─────────────────────────────────────────── */
.wa-float {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
  z-index: 9999;
  transition: transform 0.2s;
  animation: wa-bob 3s ease-in-out infinite;
}
.wa-float:hover { transform: translateY(-3px); color: #fff; }
.wa-float::after {
  content: '';
  position: absolute;
  inset: 0; border-radius: 50%;
  animation: wa-pulse 2.2s ease-out infinite;
}
@keyframes wa-bob   { 0%,100%{transform:translateY(0)}   50%{transform:translateY(-4px)} }
@keyframes wa-pulse { 0%{box-shadow:0 0 0 0 rgba(37,211,102,.5)} 70%{box-shadow:0 0 0 14px rgba(37,211,102,0)} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0)} }

/* ── Utilities ──────────────────────────────────────────────── */
.text-gold  { color: var(--sq-gold) !important; }
.text-muted-sq { color: var(--sq-muted) !important; }
.divider    { border-color: var(--sq-border); opacity: 1; }

@media (max-width: 576px) {
  .rate-card .rc-price { font-size: 22px; }
  .sq-section { padding: 20px 0; }
  #sq-nav .navbar-brand img { height: 34px; }
}
