/* ======= FONT FACE ======= */
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #121418;
  --bg-elev: #181B20;
  --surface: #1E2229;
  --border: #2C313A;
  --text: #F3F4F6;
  --text-soft: #9CA3AF;
  --muted: #6B7280;
  --up: #10B981;
  --down: #EF4444;
  --gold: #FBBF24;
  --silver: #E2E8F0;
  --radius: 12px;
  --maxw: 800px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: 'Geist', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh;
}

body { display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }

/* ======= TOPBAR ======= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 20, 24, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.brand-icon { width: 24px; height: 24px; border-radius: 6px; opacity: 0.9; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }

.hero-meta { display: flex; align-items: center; gap: 12px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--up); padding: 4px 10px; border: 1px solid rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.05); border-radius: 999px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-timestamp { font-size: 12px; color: var(--muted); }

/* ======= MAIN & HERO ======= */
.main { flex: 1; padding: 32px 16px 80px; max-width: var(--maxw); width: 100%; margin: 0 auto; }

.hero-section { margin-bottom: 48px; scroll-margin-top: 80px; }
.hero-text-wrap { margin-bottom: 24px; }
.hero-text-wrap h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.hero-text-wrap h1 em { font-style: normal; color: var(--silver); }
.hero-text-wrap p { font-size: 14px; color: var(--text-soft); line-height: 1.5; max-width: 500px; }

/* Kartu Antam Premium */
.antam-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.antam-card {
  position: relative; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.antam-card.gold { border-top: 3px solid var(--gold); background: linear-gradient(180deg, rgba(251, 191, 36, 0.05) 0%, var(--bg-elev) 100%); }
.antam-card.silver { border-top: 3px solid var(--silver); background: linear-gradient(180deg, rgba(226, 232, 240, 0.05) 0%, var(--bg-elev) 100%); }

.ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ac-badge { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.ac-title { font-size: 13px; font-weight: 700; color: var(--text-soft); }

.ac-price { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.ac-price .unit { font-size: 11px; font-weight: 500; color: var(--muted); }
.ac-foot { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.ac-trend { font-weight: 700; }
.ac-trend.up { color: var(--up); }
.ac-trend.down { color: var(--down); }

/* ======= SUPPLIER SECTION ======= */
.supplier-section { scroll-margin-top: 80px; }
.section-head {
  display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px;
}
.section-head h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.section-head p { font-size: 13px; color: var(--muted); }

/* Dropdown Sortir */
.sort-wrapper {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 8px; width: 100%;
}
.sort-label { font-size: 12px; font-weight: 500; color: var(--text-soft); white-space: nowrap; }
.sort-select {
  width: 100%; background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700;
  outline: none; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239CA3AF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat; background-position: right 0 center; background-size: 10px;
  padding-right: 20px;
}

/* PERBAIKAN: Agar teks di dalam opsi dropdown terlihat */
.sort-select option {
  background-color: var(--bg-elev);
  color: var(--text);
  font-weight: 500;
}

/* Supplier Cards */
.supplier-list { display: flex; flex-direction: column; gap: 12px; }
.supplier-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.2s, border-color 0.2s;
}
.supplier-card:hover { border-color: var(--muted); transform: translateY(-1px); }

.sc-header { display: flex; align-items: center; justify-content: space-between; }
.sc-name { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sc-rank { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.sc-rank.top-1 { background: var(--gold); color: #000; border-color: var(--gold); }
.sc-rank.top-2 { background: var(--silver); color: #000; border-color: var(--silver); }
.sc-rank.top-3 { background: #D97706; color: #000; border-color: #D97706; }

.sc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge.primary { background: rgba(16, 185, 129, 0.15); color: var(--up); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.gold { background: rgba(251, 191, 36, 0.15); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.3); }
.badge.silver { background: rgba(226, 232, 240, 0.15); color: var(--silver); border: 1px solid rgba(226, 232, 240, 0.3); }

.sc-prices {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  background: var(--surface); padding: 12px; border-radius: 8px;
}
.sc-p { display: flex; flex-direction: column; }
.sc-p-label { font-size: 10px; font-weight: 500; color: var(--muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.sc-p-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-p-val.buy { color: var(--text); }
.sc-p-val.buyback { color: var(--text-soft); }
.sc-p-val.spread { color: var(--muted); }

/* ======= INFO SECTION ======= */
.info-section { margin-top: 48px; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.info-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.info-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.info-card p { font-size: 13px; color: var(--text-soft); line-height: 1.5; }

/* ======= FLOATING VELDION ======= */
.floating-veldion {
  position: fixed; bottom: 20px; right: 20px; z-index: 99;
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: var(--bg); text-decoration: none;
  padding: 12px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4); transition: transform 0.2s, background 0.2s;
}
.floating-veldion:hover { transform: translateY(-2px); background: #FFF; }
.fv-icon { width: 16px; height: 16px; }

/* ======= FOOTER ======= */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); padding: 24px 16px; margin-top: auto; text-align: center; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; margin-bottom: 16px; }
.footer-source { font-size: 12px; color: var(--muted); }
.footer-source a { color: var(--text-soft); text-decoration: none; border-bottom: 1px solid var(--border); }

.developer-credit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; color: var(--muted); padding-top: 16px; border-top: 1px dashed var(--border);
  max-width: var(--maxw); margin: 0 auto;
}
.dev-logo { width: 16px; height: 16px; opacity: 0.5; filter: grayscale(100%); transition: all 0.3s; }
.developer-credit:hover .dev-logo { opacity: 1; filter: grayscale(0%); }
.dev-brand { font-weight: 700; color: var(--text-soft); }

/* Skeleton Loading */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; color: transparent !important; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.error-box { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--down); padding: 12px; border-radius: 8px; font-size: 12px; text-align: center; }

/* ======= RESPONSIVE ======= */
@media (max-width: 380px) {
  .antam-hero-grid { grid-template-columns: 1fr; }
  .ac-price { font-size: 22px; }
  .sc-prices { grid-template-columns: 1fr 1fr; }
  .sc-p.spread-col { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
}

@media (min-width: 640px) {
  .main { padding: 48px 24px 80px; }
  .hero-text-wrap h1 { font-size: 36px; }
  .ac-price { font-size: 32px; }
  .antam-card { padding: 24px; }
  
  .section-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .sort-wrapper { width: auto; min-width: 240px; }
  
  .supplier-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .info-grid { grid-template-columns: 1fr 1fr 1fr; }
}