/* 
  QUANT AI PREDICTOR - PREMIUM DARK UI
  Author: AI Agent
*/

:root {
  /* Color Palette */
  --bg-dark: #020617;
  --bg-panel: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Accents */
  --accent-bull: #10b981; /* Emerald Green */
  --accent-bear: #f43f5e; /* Rose Red */
  --accent-ai: #8b5cf6;   /* Violet / Purple */
  --accent-ai-glow: rgba(139, 92, 246, 0.4);
  
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* UI Elements */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Glowing Effects */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}
.glow-1 {
  top: -10%;
  left: -5%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, rgba(2,6,23,0) 70%);
}
.glow-2 {
  bottom: -10%;
  right: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(2,6,23,0) 70%);
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------------- Ticker Tape ---------------- */
.ticker-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
}
.ticker-tape {
  display: inline-block;
  animation: ticker 30s linear infinite;
  font-size: 0.85rem;
  font-weight: 500;
}
.ticker-item {
  display: inline-block;
  margin-right: 40px;
  color: var(--text-muted);
}
.ticker-item span {
  margin-left: 6px;
  font-weight: 600;
}
.ticker-item span.up { color: var(--accent-bull); }
.ticker-item span.down { color: var(--accent-bear); }

@keyframes ticker {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ---------------- Layout Container ---------------- */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------------- Header ---------------- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-orb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-ai), #c4b5fd);
  box-shadow: 0 0 15px var(--accent-ai-glow);
}
.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-bull);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.ping-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-bull);
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

/* ---------------- Mini Cards Grid ---------------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.mini-card {
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.mini-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: transparent;
  transition: var(--transition);
}
.mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.2);
}
.mini-card.active {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--accent-ai);
}
.mini-card.active::before {
  background: var(--accent-ai);
  box-shadow: 0 0 10px var(--accent-ai);
}

.mini-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.mini-card .card-header h3 {
  font-size: 1.1rem;
  color: #fff;
}
.mini-card .card-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 4px 8px;
  border-radius: 4px;
}

.mc-price {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 4px;
}
.mc-pred {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.mc-pred.up { color: var(--accent-bull); }
.mc-pred.down { color: var(--accent-bear); }

.mc-indicators {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--glass-border);
  padding-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.mc-indicators b { color: #fff; }

/* ---------------- Main Dashboard Layout ---------------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Left Column: Chart & History ---------------- */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.chart-header {
  margin-bottom: 20px;
}
.chart-header h2 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 4px;
}
.chart-price {
  font-size: 1.1rem;
  color: var(--text-muted);
}
.chart-container {
  width: 100%;
  height: 450px; /* Tinggi canvas yang pas */
  position: relative;
}
.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-box {
  width: 12px; height: 12px; border-radius: 3px;
}
.color-box.realita { background: var(--accent-bull); }
.color-box.ai-pred { background: var(--accent-ai); }

/* History Table */
.history-card {
  padding: 24px;
}
.history-card .card-header h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-responsive {
  overflow-x: auto;
}
.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.modern-table th {
  text-align: left;
  padding: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 500;
}
.modern-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.modern-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.err-val {
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* ---------------- Right Column: Analytics, News, Macro ---------------- */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* AI Analytics Panel */
.analytics-panel {
  padding: 24px;
  background: linear-gradient(180deg, rgba(30,41,59,0.8) 0%, rgba(15,23,42,0.8) 100%);
  border-top: 2px solid var(--accent-ai);
}
.analytics-panel .card-header h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #fff;
}
.prediction-big {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.prediction-big h2 {
  font-size: 2.5rem;
  color: var(--accent-ai);
  text-shadow: 0 0 20px var(--accent-ai-glow);
}
.trend-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.trend-badge.bullish { background: rgba(16,185,129,0.1); color: var(--accent-bull); border: 1px solid rgba(16,185,129,0.2); }
.trend-badge.bearish { background: rgba(244,63,94,0.1); color: var(--accent-bear); border: 1px solid rgba(244,63,94,0.2); }

.ai-insight-box {
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--glass-border);
}
.ai-insight-box h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ai-insight-box p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.indicators-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ind-box {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ind-label { font-size: 0.75rem; color: var(--text-muted); }
.ind-value { font-size: 1.1rem; font-weight: 600; font-family: var(--font-heading); }

/* List Panels (News & Macro) */
.list-panel {
  padding: 24px;
  flex: 1; /* Biar mengisi ruang kosong jika ada */
  display: flex;
  flex-direction: column;
}
.list-panel .card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}
.list-panel .card-header h3 {
  font-size: 1.1rem;
}
.list-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 300px;
  padding-right: 8px;
}
/* Scrollbar Styling */
.list-body::-webkit-scrollbar { width: 4px; }
.list-body::-webkit-scrollbar-track { background: transparent; }
.list-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.list-item {
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  transition: var(--transition);
}
.list-item:hover {
  background: rgba(255,255,255,0.05);
}
.list-item .date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.list-item .title {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.list-item .title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
}
.list-item .title a:hover {
  color: var(--accent-ai);
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.tag.pos { background: rgba(16,185,129,0.1); color: var(--accent-bull); }
.tag.neg { background: rgba(244,63,94,0.1); color: var(--accent-bear); }
.tag.net { background: rgba(148,163,184,0.1); color: var(--text-muted); }
