/* =========================================================
   AI TRADING PARTNER — Dark Gold Theme (mengacu referensi GoldLQ)
   Tokens: Navy-black (bg), Surface (card), Gold/Amber (brand+CTA),
   Blue (info/tip), Buy/Sell (signal), dashed border (quote/trust)
   Type: Space Grotesk (display) + Manrope (body) + IBM Plex Mono (data)
   ========================================================= */

:root{
  --bg:            #10172B;
  --bg-soft:       #131C36;
  --surface:       #1A2440;
  --surface-2:     #141D34;
  --border:        #2B3553;
  --border-soft:   #212A47;

  --ink:           #F2F4F9;
  --ink-muted:     #9AA3BA;
  --ink-faint:     #5E6779;

  --gold:          #FFC22E;
  --gold-2:        #FF9F1C;
  --gold-soft:     rgba(255,194,46,.12);
  --gold-ink:      #1A1304;

  --blue:          #4C8DFF;
  --blue-soft:     rgba(76,141,255,.10);
  --blue-ink:      #8FB6FF;

  --buy:           #22C55E;
  --buy-soft:      rgba(34,197,94,.14);
  --sell:          #F43F5E;
  --sell-soft:     rgba(244,63,94,.14);
  --neutral:       #9AA3BA;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 14px 30px -18px rgba(0,0,0,.6);
  --shadow-gold: 0 6px 20px -6px rgba(255,194,46,.35);

  --font-display: "Space Grotesk", -apple-system, sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; max-width:100%; overflow-x:hidden; }

body{
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

:focus-visible{
  outline: 2.5px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===== TOP BAR ===== */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(10,13,22,.85);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top:0; z-index: 50;
  backdrop-filter: blur(10px);
}
.brand{ display:flex; align-items:center; gap:11px; }
.brand-mark{
  width:38px; height:38px; border-radius:11px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(150deg, var(--gold), var(--gold-2));
  color: var(--gold-ink);
  box-shadow: var(--shadow-gold);
}
.brand-text{ white-space: nowrap; }
.brand-text strong{
  display:block; font-family: var(--font-display); font-size:16px; font-weight:700;
  letter-spacing:.1px; color: var(--ink);
}
.brand-text small{
  color: var(--ink-faint); font-size:11px; letter-spacing:.4px; text-transform:uppercase;
  font-weight: 600;
}

.topbar-controls{ display:flex; align-items:center; gap:12px; flex-wrap: wrap; }

.select-control{
  background: var(--surface);
  border:1.5px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.select-control:hover{ border-color: var(--border); }
.select-control:focus{ border-color: var(--gold); }

.tf-group{
  display:flex; background: var(--surface); border:1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow:hidden;
}
.tf-btn{
  background:transparent; border:none; color: var(--ink-muted);
  padding: 8px 14px; font-size:12.5px; font-weight:700; cursor:pointer;
  font-family: var(--font-mono);
  transition: background .15s, color .15s;
}
.tf-btn + .tf-btn{ border-left:1.5px solid var(--border); }
.tf-btn:hover{ background: var(--surface-2); color: var(--ink); }
.tf-btn.active{ background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--gold-ink); }

.live-indicator{
  display:flex; align-items:center; gap:6px;
  font-size: 11px; font-weight:800; letter-spacing: .6px; color: var(--buy);
  font-family: var(--font-mono);
}
.live-indicator .dot{
  width:7px; height:7px; border-radius:50%; background: var(--buy);
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
  70%{ box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100%{ box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ===== PROMO / QUOTA BANNER ===== */
.promo-banner{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  max-width: 900px; margin: 22px auto 0; padding: 13px 18px;
  background: var(--blue-soft); border:1px solid rgba(76,141,255,.28);
  border-radius: var(--radius-md); flex-wrap: wrap;
}
.promo-text{ display:flex; align-items:flex-start; gap:10px; font-size:12.5px; color: var(--ink-muted); line-height:1.5; }
.promo-icon{ font-size:16px; flex-shrink:0; }
.promo-text strong{ color: var(--gold); font-weight:800; }
.promo-text a{ color: var(--blue-ink); text-decoration: underline; margin-left:4px; white-space: nowrap; }
.btn-compact{ width:auto; padding: 9px 16px; font-size:12.5px; flex-shrink:0; }
.btn-gold-compact{
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--gold-ink); font-weight:700; font-size: 12.5px; font-family: var(--font-body);
  border:none; border-radius: var(--radius-sm); padding: 9px 16px; cursor:pointer;
}

.activate-panel{
  display:flex; align-items:center; gap:10px; flex-wrap: wrap;
  max-width: 900px; margin: 10px auto 0; padding: 0 18px;
}
.activate-panel input{ flex:1; min-width: 180px; }
.activate-msg{ font-size:12px; font-weight:700; }
.activate-msg.ok{ color: var(--buy); }
.activate-msg.err{ color: var(--sell); }

.promo-banner.unlocked{ background: var(--buy-soft); border-color: rgba(34,197,94,.3); }

/* ===== HERO ===== */
.hero{ max-width: 680px; margin: 0 auto; padding: 44px 24px 6px; text-align:center; }
.hero-badge{
  display:inline-flex; align-items:center; gap:7px; padding:6px 16px; border-radius:30px;
  background: var(--surface); border:1px solid var(--border);
  font-family: var(--font-mono); font-size:11px; font-weight:700; letter-spacing:.3px;
  color: var(--gold); margin-bottom:18px;
}
.hero h1{
  font-family: var(--font-display); font-weight:700; line-height:1.18;
  font-size: clamp(26px, 5vw, 40px); color: var(--ink); margin:0 0 14px;
}
.hero h1 .accent{
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero p{ color: var(--ink-muted); font-size:14px; line-height:1.65; max-width:540px; margin:0 auto; }
.hero p b{ color: var(--gold); font-weight:700; }

/* ===== LAYOUT (dashboard: chart + hasil, satu kolom, rata tengah) ===== */
.layout{
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap: 20px; padding: 30px 28px; max-width: 760px; width:100%; margin:0 auto;
  min-width: 0;
}
.layout > *{ width:100%; }

/* ===== CHART PANEL ===== */
.chart-panel{
  background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card);
  display:flex; flex-direction:column; min-height: 580px;
  min-width: 0;
}
/* Grid 2x2 — berlaku SAMA untuk laptop & HP (cuma ukuran teks yg beda
   per breakpoint di bawah). Urutan elemen di HTML: price-readout, select
   (pair), live-indicator, tf-group -> otomatis mengisi:
     [ Harga        ] [ Pair      ]
     [ Sinyal/LIVE   ] [ Timeframe ]
   Row-gap (jarak Pair ke Timeframe / Harga ke Sinyal) dibuat TIPIS (4px).
   Column-gap (jarak kiri-kanan) dibuat lebih lega (16px). */
.chart-panel-head{
  display:grid; grid-template-columns: 1fr 1fr;
  align-items:center; gap: 4px 16px; margin-bottom: 18px;
}
.chart-panel-head .select-control{ justify-self:end; width:100%; max-width: 260px; }
.chart-panel-head .live-indicator{ justify-self:start; }
.chart-panel-head .tf-group{ justify-self:end; width:100%; max-width: 260px; }
.chart-panel-head .tf-btn{ flex:1; }

.price-readout{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.price-value{ font-family: var(--font-mono); font-size: 20px; font-weight:600; letter-spacing: -.3px; color: var(--ink); }
.price-change{ font-family: var(--font-mono); font-size: 11.5px; font-weight:600; color: var(--ink-faint); }
.price-change.up{ color: var(--buy); }
.price-change.down{ color: var(--sell); }

.btn-primary{
  display:flex; align-items:center; gap:8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--gold-ink); font-weight:700; font-size: 13.5px; font-family: var(--font-body);
  border:none; border-radius: var(--radius-sm);
  padding: 11px 20px; cursor:pointer;
  transition: transform .12s, box-shadow .12s, opacity .12s;
  box-shadow: var(--shadow-gold);
  white-space: nowrap;
}
.btn-primary:hover{ transform: translateY(-1px); }
.btn-primary:disabled{ opacity:.55; cursor:wait; transform:none; }

/* ===== Gaya Trading selector (Scalping/Swing) ===== */
.style-group{ display:flex; gap:8px; margin-bottom: 14px; }
.style-btn{
  flex:1; display:flex; align-items:center; justify-content:center; gap:7px;
  background: var(--surface-2); border:1.5px solid var(--border); color: var(--ink-muted);
  padding: 10px; border-radius: var(--radius-sm); font-weight:700; font-size:12.5px;
  font-family: var(--font-body); cursor:pointer; transition: all .15s;
}
.style-btn:hover{ border-color: var(--border); color: var(--ink); }
.style-btn.active{
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--gold-ink); border-color: transparent;
}

.chart-container{
  position: relative;
  height: 460px; border-radius: var(--radius-md);
  overflow:hidden; background: var(--surface-2); border:1px solid var(--border);
  min-width: 0; max-width: 100%; width: 100%; flex: 0 0 auto;
}

/* Kotak kecil O/H/L/C di pojok kiri-atas chart — sengaja ditaruh sebagai
   anak elemen #chartContainer (bukan elemen lepas di luar), supaya ikut
   ter-capture saat html2canvas screenshot chart utk dikirim ke AI. */
.ohlc-legend{
  position:absolute; top:10px; left:10px; z-index:5;
  display:flex; gap:10px; align-items:center;
  background: rgba(15,19,32,0.78); border:1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 5px 10px;
  font-family: var(--font-mono); font-size: 11px; color:#C9CEDA;
  pointer-events:none; backdrop-filter: blur(2px);
}
.ohlc-legend b{ color:#fff; font-weight:600; }

/* Baris tombol "Analisa Sekarang" — sekarang ditaruh di bawah chart, rata tengah */
.run-analysis-row{
  display:flex; justify-content:center; margin-top: 22px;
}

.chart-disclaimer{
  margin: 14px 2px 4px; font-size: 11.5px; color: var(--ink-faint); line-height:1.5;
  text-align:center;
}

/* ===== STRUCTURAL DEVICE: tick-divider (echoes a chart axis tick) ===== */
.tick-divider{
  display:flex; align-items:center; gap:8px;
  margin: 4px 0 -2px;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight:700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-faint);
}
.tick-divider::before{
  content:""; width: 14px; height:1.5px; background: var(--border); flex-shrink:0;
}
.tick-divider::after{
  content:""; flex:1; height:1px; background: var(--border-soft); margin-left: 8px;
}

/* ===== RESULTS PANEL ===== */
.results-panel{ display:flex; flex-direction:column; gap:10px; min-width:0; }

.judge-card{
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--gold-soft);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card);
  overflow: hidden;
}
.judge-card.placeholder{ border-color: var(--border); }

.judge-card-head{ position:relative; display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.judge-badge{
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight:800; letter-spacing: 1px; color: var(--gold);
  background: var(--gold-soft); padding: 5px 11px; border-radius: 20px;
}
.judge-time{ font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.judge-verdict{ position:relative; display:flex; align-items:center; gap:10px; margin-bottom: 12px; flex-wrap: wrap; }
.verdict-pill{
  font-family: var(--font-display);
  font-size: 14px; font-weight:700; letter-spacing:.3px; padding: 6px 16px; border-radius: 20px;
}
.verdict-pill.buy{ background: var(--buy-soft); color: var(--buy); }
.verdict-pill.sell{ background: var(--sell-soft); color: var(--sell); }
.verdict-pill.neutral{ background: var(--surface-2); color: var(--neutral); }
.verdict-consensus{ font-size: 12.5px; color: var(--ink-muted); font-weight: 600; overflow-wrap: anywhere; }

.judge-levels{ position:relative; display:grid; grid-template-columns: repeat(3,1fr); gap:8px; margin: 12px 0; }
.level-box{
  background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 10px; text-align:center;
}
.level-box .lbl{ font-family: var(--font-mono); font-size:10px; color:var(--ink-faint); letter-spacing:.5px; }
.level-box .val{ font-family: var(--font-mono); font-size:14px; font-weight:600; margin-top:3px; color: var(--ink); }

.judge-summary{ position:relative; font-size: 12.5px; color: var(--ink-muted); line-height:1.6; overflow-wrap: anywhere; word-break: break-word; }
.empty-state{ color: var(--ink-faint); font-size: 12.5px; margin:0; line-height: 1.6; }

.ai-grid{ display:grid; grid-template-columns: 1fr; gap: 10px; }

.ai-card{
  background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 15px;
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--border);
  transition: border-color .15s;
}
.ai-card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:7px; }
.ai-name{ display:flex; align-items:center; gap:8px; font-family: var(--font-display); font-weight:700; font-size:13.5px; color: var(--ink); }
.ai-dot{ width:7px; height:7px; border-radius:50%; background: var(--ink-faint); flex-shrink:0; }
.ai-card.buy{ border-left-color: var(--buy); }
.ai-card.buy .ai-dot{ background: var(--buy); }
.ai-card.sell{ border-left-color: var(--sell); }
.ai-card.sell .ai-dot{ background: var(--sell); }
.ai-card.error{ border-left-color: var(--sell); }
.ai-card.error .ai-dot{ background: var(--sell); }
.ai-card.loading{ border-left-color: var(--gold); }
.ai-card.loading .ai-dot{ background: var(--gold); animation: pulse-gold 1.4s infinite; }
@keyframes pulse-gold{
  0%{ box-shadow: 0 0 0 0 rgba(255,194,46,.5); }
  70%{ box-shadow: 0 0 0 5px rgba(255,194,46,0); }
  100%{ box-shadow: 0 0 0 0 rgba(255,194,46,0); }
}

.ai-bias{ font-family: var(--font-mono); font-size: 11px; font-weight:800; letter-spacing:.5px; }
.ai-bias.buy{ color: var(--buy); }
.ai-bias.sell{ color: var(--sell); }
.ai-bias.neutral{ color: var(--neutral); }

.ai-meta{ font-size: 12px; color: var(--ink-muted); line-height:1.55; overflow-wrap: anywhere; word-break: break-word; }
.ai-meta b{ color: var(--ink); font-weight: 700; }
.ai-status{ font-size:12px; color: var(--ink-faint); font-style: italic; overflow-wrap: anywhere; }
.ai-status.err{ color: var(--sell); font-style: normal; font-weight: 600; }

/* ===== SUPPORT SECTIONS (tip / quote / feature-grid / tutorial) ===== */
.support-sections{
  max-width: 760px; margin: 8px auto 36px; padding: 0 28px;
  display:flex; flex-direction:column; gap:18px;
}

.tip-card{
  background: var(--blue-soft); border:1px solid rgba(76,141,255,.28);
  border-radius: var(--radius-lg); padding: 17px 19px;
}
.tip-card h4{
  margin:0 0 8px; display:flex; align-items:center; gap:7px;
  font-family: var(--font-display); font-size:13.5px; font-weight:700; color: var(--blue-ink);
}
.tip-card p{ margin:0; font-size:12.5px; line-height:1.65; color: var(--ink-muted); }
.tip-card p + p{ margin-top:8px; }
.tip-card strong{ color: var(--gold); font-weight:700; }

.btn-ghost-gold{
  display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
  background: transparent; border:1.5px solid var(--gold-soft); color: var(--gold);
  font-weight:700; padding: 13px; border-radius: var(--radius-md); font-size:13.5px;
  cursor:pointer; text-decoration:none; font-family: var(--font-body);
  transition: background .15s, border-color .15s;
}
.btn-ghost-gold:hover{ background: var(--gold-soft); border-color: var(--gold); }

.quote-card{
  border:1.5px dashed var(--border); border-radius: var(--radius-lg);
  padding: 26px 24px; text-align:center;
}
.quote-card p{
  font-style: italic; color: var(--ink); font-size:14.5px; line-height:1.65; margin:0 0 10px;
}
.quote-card span{ color: var(--gold); font-size:12px; font-weight:700; font-family: var(--font-mono); }

.feature-teaser h5{
  text-align:center; color: var(--ink-faint); font-size:11px; letter-spacing:.6px;
  text-transform:uppercase; margin:0 0 14px; font-family: var(--font-mono); font-weight:700;
}
.feature-grid-teaser{ display:grid; grid-template-columns: repeat(2,1fr); gap:10px; }
.feature-item{
  display:flex; align-items:center; gap:10px; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px;
  font-size:12.5px; color: var(--ink-muted); font-weight:600;
}
.feature-item .ic{ font-size:16px; flex-shrink:0; }

/* ===== FOOTER ===== */
.footer{
  text-align:center; padding: 20px; color: var(--ink-faint); font-size: 11.5px;
  border-top: 1px solid var(--border-soft);
}
.footer-sep{ margin: 0 8px; }
.footer strong{ color: var(--ink-muted); }
.footer .built-by{ display:block; margin-top:6px; }
.footer .built-by a{ color: var(--gold); text-decoration:none; }

/* Catatan: TIDAK ada lagi override khusus "wide screens" (>=1600px) —
   tampilan sengaja dibuat identik dengan laptop di semua lebar layar
   yang lebih besar dari breakpoint tablet, karena .layout sudah dibatasi
   max-width: 760px (lihat aturan .layout di atas). */

/* ===== SMALL LAPTOP ===== */
@media (max-width: 1280px) and (min-width: 1081px){
  .layout{ gap: 16px; padding: 24px 20px; }
  .chart-panel{ min-height: 460px; }
}

/* ===== LAPTOP / TABLET ===== */
@media (max-width: 1080px){
  .layout{ padding: 22px 20px; gap: 18px; }
  .chart-panel{ min-height: 480px; }
  .ai-grid{ grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
  .support-sections{ padding: 0 20px; }

  .price-value{ font-size: 18px; }
  .price-change{ font-size: 10.5px; }
  .select-control{ padding: 7px 9px; font-size: 12px; }
  .tf-btn{ padding: 7px 9px; font-size: 11.5px; }
  .live-indicator{ font-size: 10.5px; }
}

/* ===== MOBILE — grid 2x2 yg SAMA, cuma teks/padding lebih kecil lagi ===== */
@media (max-width: 640px){
  .topbar{ padding: 12px 16px; flex-wrap:wrap; gap:10px; }

  .hero{ padding: 32px 18px 4px; }

  .layout{ padding: 16px 14px 96px; gap: 14px; } /* bottom padding clears the sticky CTA */
  .chart-panel{ padding: 14px; min-height: 420px; }
  .chart-container{ height: 320px; }
  .chart-panel-head{ gap: 4px 10px; }
  .price-value{ font-size: 17px; }
  .price-change{ font-size: 10px; }
  .select-control{ padding: 6px 8px; font-size: 11.5px; }
  .tf-btn{ padding: 6px 8px; font-size: 11px; }
  .live-indicator{ font-size: 10px; }

  .judge-levels{ grid-template-columns: repeat(3,1fr); gap:6px; }
  .level-box{ padding: 7px 6px; }
  .level-box .val{ font-size: 12.5px; }

  .support-sections{ padding: 0 14px; }
  .feature-grid-teaser{ grid-template-columns: 1fr 1fr; }

  .promo-banner{ flex-direction: column; align-items: stretch; margin: 16px 14px 0; }
  .activate-panel{ margin: 8px 14px 0; padding: 0; }

  /* Primary CTA becomes a thumb-reachable sticky bar instead of shrinking in place */
  .btn-primary{
    position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 60;
    justify-content: center; padding: 14px 20px; font-size: 14.5px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 28px -8px rgba(255,194,46,.45);
  }
}

@media (max-width: 380px){
  .feature-grid-teaser{ grid-template-columns: 1fr; }
}
