/* ======= FONTS ======= */
@font-face { font-family: 'Geist'; src: url('assets/fonts/Geist-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('assets/fonts/Geist-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('assets/fonts/Geist-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ======= VARIABLES ======= */
:root {
  --bg-base: #0B0E14;
  --bg-surface: #151A23;
  --bg-elevated: #1E2430;
  --border: #2A3241;
  --border-hover: #3B4556;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  
  --gold: #FCD34D;
  --gold-glow: rgba(252, 211, 77, 0.08);
  --silver: #E2E8F0;
  --silver-glow: rgba(226, 232, 240, 0.08);
  
  --up: #10B981;
  --up-bg: rgba(16, 185, 129, 0.12);
  --down: #EF4444;
  --down-bg: rgba(239, 68, 68, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.2);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(252, 211, 77, 0.03);
  
  --font: 'Geist', -apple-system, sans-serif;
}

/* ======= RESET & BASE ======= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg-base); color: var(--text-main);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom);
  background-image: 
    radial-gradient(circle at 15% 20%, var(--gold-glow) 0%, transparent 40%),
    radial-gradient(circle at 85% 50%, var(--silver-glow) 0%, transparent 40%);
  background-attachment: fixed;
}

/* ======= TOPBAR ======= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(42, 50, 65, 0.5);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); }
.brand-icon { width: 24px; height: 24px; border-radius: 6px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.5px; }
.header-meta { display: flex; align-items: center; gap: 16px; }

/* Navbar Link Simpel */
.nav-link {
  font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: 0.2s;
}
.nav-link:hover { color: var(--text-main); }

.live-indicator {
  display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--up); background: var(--up-bg); padding: 4px 10px; border-radius: 99px; border: 1px solid rgba(16,185,129,0.2);
}
.dot { width: 6px; height: 6px; background: var(--up); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--up-bg); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.timestamp { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ======= LAYOUT (MOBILE) ======= */
.main-layout {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 24px;
}
.mobile-only-panduan { display: block; margin-top: 24px; }
.desktop-only-panduan { display: none; }

/* ======= PANEL KIRI (LIVE) ======= */
.spotlight-card {
  background: linear-gradient(145deg, var(--bg-surface) 0%, #11151C 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-md), var(--shadow-glow);
  height: 100%; display: flex; flex-direction: column;
}
.hero-text h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 6px; }
.hero-text h1 em { font-style: normal; color: var(--gold); }
.hero-text p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.live-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; position: relative; overflow: hidden; transition: 0.3s;
}
.live-card.gold { border-top: 3px solid var(--gold); background: linear-gradient(180deg, var(--gold-glow) 0%, var(--bg-elevated) 100%); }
.live-card.silver { border-top: 3px solid var(--silver); background: linear-gradient(180deg, var(--silver-glow) 0%, var(--bg-elevated) 100%); }
.live-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-hover); }

.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-badge { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; background: var(--bg-base); color: var(--text-muted); }
.card-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.card-price { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.card-price span { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.card-foot { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }

/* ======= PANEL KANAN (SUPPLIER) ======= */
.supplier-header { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.supplier-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.supplier-header p { font-size: 13px; color: var(--text-muted); }

.sort-wrapper { position: relative; width: 100%; }
.sort-select {
  width: 100%; appearance: none; background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-main); font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; transition: 0.2s;
}
.sort-select:hover { border-color: var(--border-hover); }
.sort-select option { background-color: var(--bg-elevated); color: var(--text-main); }

.supplier-list { display: flex; flex-direction: column; gap: 12px; }
.s-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.s-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.s-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 10px; }
.s-name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.s-rank { font-size: 11px; background: var(--bg-elevated); color: var(--text-muted); padding: 2px 6px; border-radius: 4px; }
.s-rank.top-1 { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(252, 211, 77, 0.4); }
.s-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; letter-spacing: 0.5px; }
.badge.best-buy { background: var(--up-bg); color: var(--up); border: 1px solid rgba(16,185,129,0.3); }
.badge.best-buyback { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(252,211,77,0.3); }
.badge.best-spread { background: var(--silver-glow); color: var(--silver); border: 1px solid rgba(226,232,240,0.3); }

.s-data { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; background: var(--bg-base); padding: 12px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.02); }
.s-col { display: flex; flex-direction: column; gap: 4px; }
.s-col-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.s-col-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.s-col-val.buy { color: var(--text-main); }
.s-col-val.buyback { color: var(--up); }
.s-col-val.spread { color: var(--text-muted); }

/* ======= PANDUAN CARD ======= */
.panduan-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px;
}
.panduan-card h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 16px; }
.panduan-grid { display: flex; flex-direction: column; gap: 16px; }
.panduan-grid strong { display: block; font-size: 13px; color: var(--text-main); margin-bottom: 4px; }
.panduan-grid p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ======= FLOATING BUTTONS (BULAT) ======= */
.fab-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 99;
  display: flex; flex-direction: column; gap: 12px;
}
.fab {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 32px rgba(0,0,0,0.6); }
.fab svg { width: 22px; height: 22px; }

/* Tombol Blog (Warna Gelap Elegan) */
.fab-blog {
  background: var(--bg-elevated); color: var(--gold); border: 1px solid var(--border-hover);
}
.fab-blog:hover { background: var(--gold); color: #000; border-color: var(--gold); }

/* Tombol Toko (Warna Putih Kontras) */
.fab-store {
  background: var(--text-main); color: var(--bg-base);
}
.fab-store:hover { background: var(--silver); color: #000; }

/* ======= FOOTER SIMPEL ======= */
.site-footer {
  margin-top: auto; border-top: 1px solid var(--border); padding: 20px; text-align: center;
  background: rgba(11,14,20,0.5);
}
.footer-content {
  max-width: 1280px; margin: 0 auto; font-size: 12px; color: var(--text-muted);
}
.footer-content a { color: var(--text-main); text-decoration: none; font-weight: 600; transition: 0.2s; }
.footer-content a:hover { color: var(--gold); }

/* ======= SKELETON & ERROR ======= */
.skeleton { height: 120px; background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.error-box { grid-column: 1/-1; padding: 16px; background: var(--down-bg); border: 1px solid rgba(239,68,68,0.2); color: var(--down); border-radius: var(--radius-md); text-align: center; font-size: 13px; }

/* ======= MOBILE TWEAKS ======= */
@media (max-width: 480px) {
  .live-grid { grid-template-columns: 1fr; }
  .card-price { font-size: 28px; }
  .s-data { grid-template-columns: 1fr 1fr; }
  .s-col.spread-col { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
  .s-head { flex-direction: column; }
  .s-badges { justify-content: flex-start; margin-top: 4px; }
  .header-meta .nav-link { display: none; }
  .fab-container { bottom: 20px; right: 20px; gap: 10px; }
  .fab { width: 46px; height: 46px; }
}

/* ======= DESKTOP FULL-SCREEN BENTO LAYOUT ======= */
@media (min-width: 1024px) {
  body { height: 100vh; overflow: hidden; }
  
  .main-layout {
    display: grid; 
    grid-template-columns: 420px 1fr; 
    grid-template-rows: 1fr; 
    gap: 24px;
    padding: 24px 32px; 
    height: calc(100vh - 65px - 65px); 
  }
  
  .left-panel { height: 100%; }
  .right-panel { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

  .mobile-only-panduan { display: none; }
  .desktop-only-panduan { display: flex; flex-direction: column; flex: 1; justify-content: center; margin-top: 12px; }

  .hero-text h1 { font-size: 32px; }
  .live-grid { grid-template-columns: 1fr; gap: 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .live-card { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .card-price { font-size: 36px; }

  .supplier-header { 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 16px; 
    flex-shrink: 0;
  }
  .sort-wrapper { width: 240px; }
  
  #supplier-section, #supplier-content { display: contents; }
  
  .right-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr 1fr 1fr; 
    gap: 16px;
    align-content: stretch;
  }

  .supplier-header { grid-column: 1 / -1; }
  
  .s-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .panduan-card {
    grid-column: 1 / -1;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .panduan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
  }

  .fab-container { bottom: 32px; right: 32px; gap: 14px; }
  .fab { width: 54px; height: 54px; }
  .fab svg { width: 24px; height: 24px; }
}