/* ============================================================
   INSIGHTVIET — Giá Vàng  |  Luxury Dark Gold Theme v4
   ============================================================ */

:root {
  --gold:         #f5c842;
  --gold-mid:     #c9922a;
  --gold-glow:    rgba(245, 200, 66, 0.15);
  --green:        #2ecc80;
  --red:          #e05454;
  --bg:           #07090d;
  --bg-card:      #0f1219;
  --bg-card2:     #0d1120;
  --border:       rgba(245, 200, 66, 0.12);
  --border-h:     rgba(245, 200, 66, 0.32);
  --text:         #ede8d8;
  --text-2:       #8a8070;
  --text-3:       #4a4540;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.topbar {
  height: 64px;
  background: rgba(7,9,13,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 99;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.5px;
}
.logo span { color: var(--gold); }

.menu, .search {
  font-size: 24px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s;
}
.menu:hover, .search:hover { color: var(--gold); }

/* ── HERO ── */
.hero {
  background: url("images/gold-bg.jpg") center/cover no-repeat;
  position: relative;
}

.hero-overlay {
  padding: 36px 22px 72px;
  background: linear-gradient(
    110deg,
    rgba(4,5,10,0.96) 0%,
    rgba(6,8,16,0.78) 55%,
    rgba(6,8,16,0.2) 100%
  );
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.2;
}

.hero h1 span {
  font-family: 'DM Sans', sans-serif;
  background: var(--red);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 5px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.hero p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px;
}

.time {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.time::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.time b { color: var(--gold); font-weight: 600; }

/* ── CONTAINER ── */
.container {
  padding: 0 16px 24px;
  max-width: 960px;
  margin: auto;
}

/* ── CARDS ── */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: -52px;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.25s, box-shadow 0.3s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(0,0,0,0.55), 0 0 28px var(--gold-glow);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-2);
}

.price {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  color: var(--gold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}
.price small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
  margin-left: 3px;
}

.up {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

.green {
  background: linear-gradient(145deg, #071a0f, #040c08);
  border-color: rgba(46,204,128,0.14);
}
.green::before {
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.35;
}
.green .price { color: var(--green); }

/* ── BOX ── */
.box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  margin-top: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
}

.box-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}
.box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.box-title span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }

th {
  padding: 8px 12px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 12px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
  transition: background 0.15s;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(245,200,66,0.03); }

td:first-child {
  color: var(--text-2);
  font-weight: 400;
  white-space: normal;
  min-width: 110px;
}
td:nth-child(2) { color: var(--gold); font-weight: 600; }
td:nth-child(3) { color: #e0d090; font-weight: 600; }
td.up { font-size: 11px; font-weight: 700; }

.note {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.auto-update-row td {
  color: var(--green) !important;
  font-size: 13px;
  font-weight: 600;
  padding-top: 18px;
  border-bottom: none !important;
  white-space: normal;
}

/* Mobile: ẩn cột Thay đổi */
@media (max-width: 480px) {
  th:last-child, td:last-child { display: none; }
  th, td { padding: 12px 10px; font-size: 13px; }

  .auto-update-row td {
    display: table-cell !important;
    font-size: 12px;
    padding-top: 16px;
  }
}

/* ── TRADINGVIEW ── */
.tradingview-widget-container {
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0d1018;
}

/* ── TIPS ── */
.tips {
  margin-top: 14px;
  padding: 20px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.tips b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.tips p {
  font-size: 12px;
  color: var(--text-3);
  margin: 0;
  line-height: 1.6;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 68px;
  background: rgba(8,10,18,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}
.bottom-nav a {
  color: var(--text-3);
  text-decoration: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.2s, transform 0.2s;
  padding: 6px 10px;
}
.bottom-nav a:hover { transform: translateY(-2px); color: var(--text-2); }
.bottom-nav a.active { color: var(--gold); }
.bottom-nav span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── ANIMATION ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cards { animation: fadeUp 0.45s ease both; }
.box   { animation: fadeUp 0.5s ease both; }
.tips  { animation: fadeUp 0.55s ease both; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .logo { font-size: 21px; }
  .hero h1 { font-size: 26px; }
  .hero-overlay { padding: 28px 18px 62px; }
  .cards { grid-template-columns: 1fr; margin-top: -46px; gap: 10px; }
  .price { font-size: 24px; }
  .box { padding: 16px 14px; }
  .box h2 { font-size: 16px; }
  .tips { grid-template-columns: 1fr; gap: 14px; }
}
.related-links{
    margin-top:25px;
    padding:22px;
    background:#08102b;
    border:1px solid rgba(245,200,66,.12);
    border-radius:22px;
}

.related-links h2{
    color:#f5c842;
    font-size:24px;
    margin-bottom:10px;
    font-family:Georgia,serif;
}

.related-links p{
    color:#cfcfcf;
    font-size:14px;
    margin-bottom:15px;
}

.related-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:10px;
    margin-bottom:12px;
}

.related-box{
    display:flex;
    align-items:center;
    min-height:54px;
    padding:0 16px;
    border-radius:14px;
    border:1px solid rgba(245,200,66,.12);
    background:#091126;
    color:#f5c842;
    font-size:15px;
    font-weight:600;
    text-decoration:none;
    transition:.2s;
}

.related-box:hover{
    border-color:#f5c842;
}

.related-links small{
    color:#888;
    font-size:12px;
}

@media(max-width:768px){

    .related-links{
        padding:18px;
    }

    .related-links h2{
        font-size:22px;
    }

    .related-grid{
        grid-template-columns:1fr 1fr;
    }

    .related-box{
        min-height:48px;
        font-size:14px;
    }
}
}