/* ════════════════════════════════════════════════════════════════════
   SATIA FOLIO — widget.css
   Styling untuk embed.html (portfolio card widget)
   ════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables (Dark theme default) ────────────────────────────── */
:root {
  --up:               #00c076;
  --down:             #ff5b5b;
  --text-main:        #ffffff;
  --text-muted:       #8e9ab0;
  --bg-toggle:        #252830;
  --bg-toggle-active: #363a45;
  --border-color:     #2a2d35;
}

/* ── Base ─────────────────────────────────────────────────────────── */
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  font-family: 'Inter', sans-serif;
  background: transparent;
  overflow: hidden;
}

/* ── Card Container ───────────────────────────────────────────────── */
.card {
  width: 100%; height: 100%;
  max-width: 560px; margin: 0 auto;
  border-radius: 24px; padding: 24px;
  position: relative; overflow: hidden;
  box-sizing: border-box;
  color: var(--text-main);
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

/* ── Theme Variants ───────────────────────────────────────────────── */
.theme-dark {
  background: linear-gradient(145deg, #1e2026 0%, #151619 100%);
  border: 1px solid #2a2d35;
}
.theme-light {
  --text-main:        #111111;
  --text-muted:       #666666;
  --bg-toggle:        #e5e7eb;
  --bg-toggle-active: #d1d5db;
  --border-color:     #e5e7eb;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Aurora — gradient mesh dark dengan warna ungu/teal/pink */
.theme-aurora {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.08);
}
.theme-aurora::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%,   rgba(100,60,220,0.38) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 85% 100%,  rgba(0,180,150,0.32)  0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 65% 45%,   rgba(220,80,180,0.15) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

/* Neon — pure black dengan accent hijau neon */
.theme-neon {
  --text-muted:       rgba(0,240,160,0.45);
  --bg-toggle:        rgba(0,240,160,0.07);
  --bg-toggle-active: rgba(0,240,160,0.16);
  --border-color:     rgba(0,240,160,0.18);
  background: #000000;
  border: 1px solid rgba(0,240,160,0.35);
}
.theme-neon::before {
  content: '';
  position: absolute;
  top: -1px; left: 18%; right: 18%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,160,0.85), transparent);
  z-index: 0;
  pointer-events: none;
}
/* Neon: nama aset pakai warna accent */
.theme-neon .brand-name  { color: #00f0a0; }
.theme-neon .hero-value  { text-shadow: 0 0 24px rgba(0,240,160,0.25); }
/* Neon: badge warna accent */
.theme-neon .type-badge.crypto { background: rgba(0,240,160,0.1); color: #00f0a0; border-color: rgba(0,240,160,0.3); }
.theme-neon .type-badge.stock  { background: rgba(0,240,160,0.1); color: #00f0a0; border-color: rgba(0,240,160,0.3); }
.theme-neon .type-badge.forex  { background: rgba(0,240,160,0.1); color: #00f0a0; border-color: rgba(0,240,160,0.3); }
/* Neon: stats box pakai border accent tipis */
.theme-neon .stats { border: 1px solid rgba(0,240,160,0.1); }

/* ── Header Row ───────────────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  text-transform: capitalize;
  min-width: 0;
}
.brand-logo {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge tipe aset */
.type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.type-badge.crypto { background: rgba(247,147,26,0.15); color: #f7931a; border: 1px solid rgba(247,147,26,0.3); }
.type-badge.stock  { background: rgba(59,130,246,0.15); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.type-badge.forex  { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }

/* ── Period Toggle ────────────────────────────────────────────────── */
.toggles {
  background: var(--bg-toggle);
  padding: 4px;
  border-radius: 12px;
  display: inline-flex;
  flex-shrink: 0;
}
.toggles span {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.toggles span.active {
  background: var(--bg-toggle-active);
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ── Hero (nilai total) ───────────────────────────────────────────── */
.hero {
  text-align: center;
  position: relative;
  z-index: 2;
}
.hero-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.hero-value {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  white-space: nowrap;
}
.hero-qty {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-feature-settings: "tnum";
}

/* ── Stats Row ────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(125,125,125,0.05);
  padding: 14px;
  border-radius: 16px;
  position: relative;
  z-index: 2;
}
.stat-item { text-align: left; }
.stat-item:last-child { text-align: right; }
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.stat-value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

/* ── Color helpers ────────────────────────────────────────────────── */
.text-up      { color: var(--up);      }
.text-down    { color: var(--down);    }
.text-neutral { color: var(--text-muted); }

/* ── Skeleton loading ─────────────────────────────────────────────── */
.skeleton {
  background: var(--bg-toggle);
  color: transparent !important;
  border-radius: 4px;
  animation: skel-pulse 1.5s infinite;
  display: inline-block;
  min-width: 60px;
}
@keyframes skel-pulse {
  0%   { opacity: 0.6; }
  50%  { opacity: 1;   }
  100% { opacity: 0.6; }
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 18px; border-radius: 20px; }
  .hero-value { font-size: clamp(20px, 6vw, 28px); }
}
