/* =========================================================
   Dheeraj Gold — Live Rates
   Premium luxury gold-trading UI clone
   ========================================================= */

:root {
  --bg: #041f25;
  --card-dark: #072d39;
  --card-darker: #051b22;
  --gold: #d8af47;
  --gold-light: #f3d36a;
  --white: #ffffff;
  --green: #4caf50;
  --red: #ff5252;
  --purple: #5b2b83;
  --teal: #0d4a52;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-full: 999px;

  --shadow-luxury: 0 8px 24px rgba(0, 0, 0, 0.45);
  --glow-gold: 0 0 12px rgba(216, 175, 71, 0.35);
}

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

html {
  overflow-x: hidden;
}

body {
  background: #01090b;
  font-family: 'Poppins', sans-serif;
  color: var(--white);
  overflow-x: hidden;
  max-width: 100vw;
}

#header,
#footer {
  max-width: 100vw;
  overflow-x: hidden;
}

/* =========================================================
   APP SHELL — the live-rates panel, capped at 375px, centered
   under the full-width site header/footer
   ========================================================= */

.app {
  width: 100%;
  max-width: min(375px, calc(100vw - 8px));
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   APP BRAND STRIP (below the site header, above the live-rate content)
   ========================================================= */

.app-brand-strip {
  position: relative;
  padding: 28px 20px 22px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(216, 175, 71, 0.12), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(216, 175, 71, 0.1), transparent 45%),
    linear-gradient(160deg, #06272f 0%, #041f25 55%, #052a30 100%);
  overflow: hidden;
  border-bottom: 1px solid rgba(216, 175, 71, 0.25);
}

.header-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(216, 175, 71, 0.25), transparent 70%);
  pointer-events: none;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.diamond-icon {
  color: var(--gold-light);
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(243, 211, 106, 0.7));
}

.divider {
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
}

.brand-white {
  color: var(--white);
  margin-right: 10px;
}

.brand-gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(216, 175, 71, 0.35);
}

.tagline {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 500;
}

.welcome-capsule {
  position: relative;
  margin: 20px auto 0;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0c3b3f, #0a2e33);
  border: 1px solid var(--gold);
  box-shadow: var(--glow-gold), inset 0 0 10px rgba(216, 175, 71, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.leaf-icon {
  color: var(--gold);
  font-size: 13px;
}

.leaf-icon.flip {
  transform: scaleX(-1);
}

/* =========================================================
   MAIN
   ========================================================= */

.main {
  flex: 1;
  padding: 22px 14px 100px;
  background: var(--bg);
}

/* =========================================================
   TOP MENU
   ========================================================= */

.top-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-dark);
  border: 1px solid rgba(216, 175, 71, 0.2);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  box-shadow: var(--shadow-luxury);
  margin-bottom: 16px;
}

.menu-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  position: relative;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
}

.menu-tab i {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.tab-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.6;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.menu-tab:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -0px;
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.menu-tab.active {
  color: #3fd6c8;
}

.menu-tab.active i {
  color: #3fd6c8;
  filter: drop-shadow(0 0 6px rgba(63, 214, 200, 0.6));
}

.menu-tab.active .tab-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(63, 214, 200, 0.6));
}

/* =========================================================
   LIVE RATE CARDS
   ========================================================= */

.rate-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.rate-card {
  border-radius: var(--radius-md);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  border: 1px solid rgba(216, 175, 71, 0.4);
  box-shadow: var(--shadow-luxury);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rate-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-luxury), var(--glow-gold);
}

/* Card art lifted straight from theme.jpeg (img/Zip/Box3.png, box 2.png,
   box4.png — trimmed of their transparent margin into img/liverate/), each
   already includes its own gold/teal/purple border, so the shared
   .rate-card border is turned off for these three. */
.gold-card {
  background-image: url('img/liverate/card-bg-green.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: none;
}

.inr-card {
  background-image: url('img/liverate/card-bg-teal.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: none;
}

.costing-card {
  background-image: url('img/liverate/card-bg-purple.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: none;
}

.rate-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-light);
}

.rate-icon {
  font-size: 18px;
  color: var(--gold-light);
  margin: 2px 0;
}

img.rate-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.rate-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
}

.rate-range {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.rate-range .lo {
  color: var(--green);
}

.rate-range .hi {
  color: var(--red);
}

/* =========================================================
   TICK COLORING — applied by js/liverate-live.js whenever a
   live value moves up/down since the previous poll, same as
   LiveRates3.js's green/red buy-sell coloring
   ========================================================= */

.val-up {
  color: var(--green) !important;
}

.val-down {
  color: var(--red) !important;
}

/* =========================================================
   BUY / SELL SEGMENT CONTROL
   ========================================================= */

.segment-control {
  display: flex;
  align-items: center;
  background: var(--card-dark);
  border: 1px solid rgba(216, 175, 71, 0.25);
  border-radius: var(--radius-full);
  padding: 5px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-luxury);
}

.segment {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-full);
}

/* Wider than buy/sell so it stays proportional to the product-table's
   col-product, which needs the extra room to keep names like "SILVER 999
   WITH GST" on one line. */
.segment.product {
  flex: 1.45;
}

.segment[data-buysell] {
  cursor: pointer;
  user-select: none;
}

.segment.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1204;
  box-shadow: var(--glow-gold);
}

/* =========================================================
   RATE SWIPER (Gold / Silver / Coins slides)
   ========================================================= */

.rate-swiper {
  width: 100%;
}

.rate-swiper .swiper-wrapper {
  align-items: flex-start;
}

/* =========================================================
   PRODUCT LIST
   ========================================================= */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.product-card {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  background: linear-gradient(135deg, #0a2540, #071a2e);
  border: 1px solid rgba(216, 175, 71, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-luxury);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-table tbody tr[data-live-key] {
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-luxury), var(--glow-gold);
}

.product-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #0f4a52, #0a343a);
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  font-size: 15px;
}

.product-icon.gst span {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.product-icon img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

/* left column: product name on top, "L :" low value underneath */
.product-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.product-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.product-low {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

.separator {
  flex-shrink: 0;
  align-self: center;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  font-size: 15px;
  padding: 0 6px;
}

/* right column: price on top, "H :" high value underneath — mirrors .product-main */
.product-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.price {
  font-size: 21px;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.product-high {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

/* =========================================================
   BOTTOM WELCOME CARD
   ========================================================= */

.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #0a2e33, #072228);
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  padding: 12px 16px;
  box-shadow: var(--shadow-luxury), var(--glow-gold);
}

.wc-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #0f4a52, #0a343a);
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  font-size: 14px;
}

.wc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.wc-sub {
  font-size: 9.5px;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(180deg, #05262d, #031418);
  border-top: 1px solid rgba(216, 175, 71, 0.3);
  padding: 10px 6px 8px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9.5px;
  font-weight: 600;
}

.nav-item i {
  font-size: 16px;
  color: var(--gold);
}

.nav-item.active {
  color: #3fd6c8;
}

.nav-item.active i {
  color: #3fd6c8;
  filter: drop-shadow(0 0 6px rgba(63, 214, 200, 0.6));
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1a1204;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  padding: 8px 0;
}

/* =========================================================
   PRODUCT TABLE — website / desktop view
   ========================================================= */

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

.product-table-wrap {
  margin-bottom: 18px;
}

.product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

/* Matches the segment-control's three equal flex:1 segments (PRODUCT / BUY /
   SELL) above it, so the buy/sell values line up under those labels. */
.product-table:not(.coins-table) {
  table-layout: fixed;
}

.product-table:not(.coins-table) td.col-product {
  width: 42%;
}

.product-table:not(.coins-table) td.col-buy,
.product-table:not(.coins-table) td.col-sell {
  width: 29%;
}

.product-table thead th {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #1a1204;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 14px 18px;
  text-align: left;
}

.product-table thead th.col-buy,
.product-table thead th.col-sell,
.product-table thead th.col-coins {
  text-align: right;
}

.product-table tbody td {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  height: 74px;
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Each row is its own bordered bar (img/liverate/row-bg*.png, renamed from
   theme.jpeg's img/Zip/box7.png, box8.png, Box6.png — already tight to their
   canvas, no trim needed), same pill treatment as the mobile .product-card
   rows — the PNGs' own transparent rounded corners do the clipping, so no
   CSS border-radius is needed on <tr>. */
.product-table tbody tr {
  position: relative;
  background: transparent;
  transition: background-image 0.2s ease;
}

.product-table tbody tr::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('img/liverate/row-bg.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.product-table tbody tr:hover::before {
  background-image: url('img/liverate/row-bg-hover.png');
}

.product-table tbody tr.gst-row::before {
  background-image: url('img/liverate/row-bg-gst.png');
}

.product-table td.col-product {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.product-table .product-text {
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
}

.product-table td.col-buy,
.product-table td.col-sell,
.product-table td.col-coins {
  text-align: right;
  color: var(--gold-light);
  font-size: 16px;
  font-weight: 800;
}

/* Center, not right-align, buy/sell so the values sit under the
   segment-control's centered "BUY"/"SELL" labels. */
.product-table:not(.coins-table) td.col-buy,
.product-table:not(.coins-table) td.col-sell {
  text-align: center;
}

/* L under Buy, H under Sell — same pairing as LiveRates3.js's buy_sell_label1/
   "L :"/"H :" sub-spans, just for the desktop table's two-column layout */
.table-range {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 2px;
}

.table-range.low {
  color: var(--green);
}

.table-range.high {
  color: var(--red);
}

/* =========================================================
   COINS — two-column layout only (product + single price),
   per LiveRates3.js's OnSuccess_CoinRates (no buy/sell split)
   ========================================================= */

.coins-card {
  justify-content: space-between;
}

.coins-card .product-side {
  justify-content: center;
}

.t-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #0f4a52, #0a343a);
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  font-size: 12px;
}

.t-icon.gst span {
  font-size: 7px;
  font-weight: 800;
}

.t-icon img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

/* =========================================================
   RESPONSIVE — website / desktop view
   ========================================================= */

@media (min-width: 420px) {
  .app {
    min-height: auto;
    border-radius: 28px;
    border: 1px solid rgba(216, 175, 71, 0.25);
  }
}

@media (max-width: 699.98px) {
  .app {
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }

  .main {
    padding-left: 8px;
    padding-right: 8px;
  }

  .rate-swiper,
  .rate-swiper .swiper-wrapper,
  .rate-swiper .swiper-slide {
    max-width: 100%;
  }

  .rate-swiper .swiper-slide {
    width: 100% !important;
  }

  .top-menu,
  .rate-cards,
  .segment-control,
  .product-table-wrap {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    margin-left: 0;
    margin-right: 0;
  }

  .product-table {
    border-spacing: 0 8px;
  }

  .product-table tbody td {
    padding: 14px 6px;
    font-size: 12px;
    height: 72px;
  }

  .product-table:not(.coins-table) td.col-product {
    width: 44%;
  }

  .product-table:not(.coins-table) td.col-buy,
  .product-table:not(.coins-table) td.col-sell {
    width: 28%;
  }

  .product-table td.col-product {
    display: table-cell;
    vertical-align: middle;
    gap: 7px;
    overflow: visible;
    white-space: normal;
    line-height: 1.18;
    word-break: normal;
    overflow-wrap: normal;
  }

  .product-table td.col-product .t-icon {
    display: inline-flex;
    margin-right: 6px;
    vertical-align: middle;
  }

  .product-table .product-text {
    display: inline;
    white-space: normal;
  }

  .product-table td.col-buy,
  .product-table td.col-sell,
  .product-table td.col-coins {
    font-size: 14px;
  }

  .table-range {
    font-size: 9.5px;
  }

  .t-icon {
    width: 28px;
    height: 28px;
  }

  .segment.product {
    flex: 1.57;
  }
}

@media (min-width: 700px) {
  .app {
    max-width: 1040px;
  }

  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }

  .top-menu {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .rate-cards,
  .segment-control,
  .product-table-wrap {
    max-width: 970px;
    margin-left: auto;
    margin-right: auto;
  }

  .rate-cards {
    gap: 16px;
  }

  .main {
    padding: 28px 24px 100px;
  }
}

@media (min-width: 700px) and (max-width: 767.98px) {
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .product-table tbody td {
    padding: 14px 12px;
    font-size: 13px;
    height: 76px;
  }

  .product-table:not(.coins-table) td.col-product {
    width: 48%;
  }

  .product-table:not(.coins-table) td.col-buy,
  .product-table:not(.coins-table) td.col-sell {
    width: 26%;
  }

  .product-table td.col-buy,
  .product-table td.col-sell,
  .product-table td.col-coins {
    font-size: 15px;
  }

  .product-table td.col-product {
    gap: 8px;
    overflow: visible;
    white-space: normal;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
  }

  .product-table .product-text {
    white-space: normal;
  }

  .segment {
    font-size: 11.5px;
  }

  .segment.product {
    flex: 1.85;
  }
}
