/* ============================================================
   COINCAST — styles.css
   Gaya: iOS premium. Kartu kaca, tab bar bawah, easing spring.
   Mobile-first (kolom 430px), rapi juga di desktop.
   ============================================================ */

:root {
  --ink: #1c1c2e;
  --ink2: #6d6d7f;
  --ink3: #9d9dae;
  --blue: #0a84ff;
  --green: #1eb454;
  --green-deep: #0f8a3e;
  --red: #ff3b30;
  --red-deep: #d7261c;
  --amber: #ff9500;
  --purple: #8944b8;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --border: rgba(255, 255, 255, 0.75);
  --hairline: rgba(28, 28, 46, 0.07);
  --shadow: 0 12px 32px rgba(30, 34, 60, 0.10);
  --r-card: 24px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #e8ecf6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Latar lembut: gradasi + bintik warna (biar efek kaca kelihatan) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(10, 132, 255, 0.20), transparent 60%),
    radial-gradient(50% 35% at 90% 8%, rgba(191, 90, 242, 0.18), transparent 60%),
    radial-gradient(70% 50% at 50% 100%, rgba(48, 209, 88, 0.14), transparent 60%),
    linear-gradient(180deg, #f3f5fb, #e9edf7);
}

/* Kolom aplikasi (lebar HP), jadi satu pen-scroll */
.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

@media (min-width: 520px) {
  body { display: flex; justify-content: center; align-items: stretch; }
  .app {
    border-left: 1px solid rgba(28, 28, 46, 0.05);
    border-right: 1px solid rgba(28, 28, 46, 0.05);
    box-shadow: 0 24px 64px rgba(28, 28, 46, 0.10);
  }
}

/* ---------------- Header + Dynamic Island ---------------- */

.topbar { padding: 16px 16px 4px; }

.island {
  position: sticky;
  top: 10px;
  z-index: 30;
  margin: 0 auto 14px;
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(17, 17, 20, 0.92);
  color: #fff;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(17, 17, 20, 0.25);
  backdrop-filter: blur(8px);
}

.island-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.island-live {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #d7d7e0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink3);
  flex: none;
  transition: background 0.3s;
}
.dot.live {
  background: var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
.dot.mock { background: var(--amber); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.greeting {
  margin: 2px 4px 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sub {
  margin: 3px 4px 10px;
  color: var(--ink2);
  font-size: 14px;
}

/* ---------------- Views (tab konten) ---------------- */

.views { padding: 6px 14px 10px; flex: 1; }

.view { display: none; }

.view.active {
  display: block;
  animation: viewIn 0.45s var(--spring) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Kartu kaca ---------------- */

.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.card .desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink2);
}

.card-hero .big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 6px 0 2px;
}

.hero-sub {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ink2);
}

.fine {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink3);
}

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.12);
  color: var(--blue);
}

.tag.t-vol { background: rgba(191, 90, 242, 0.16); color: var(--purple); }
.tag.t-new { background: rgba(48, 209, 88, 0.18); color: var(--green-deep); }

/* ---------------- Baris daftar ---------------- */

.rows { margin-top: 2px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--hairline);
}

.rows .row:first-child { border-top: 0; padding-top: 4px; }

.coin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: none;
  letter-spacing: 0;
}

.coin.nft {
  border-radius: 12px;
  background: linear-gradient(135deg, #bf5af2, #5e5ce6);
  font-size: 17px;
}

.row .meta { flex: 1; min-width: 0; }

.t1 {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t1-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
  margin-left: 5px;
}

.t2 {
  font-size: 12px;
  color: var(--ink2);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row .num {
  text-align: right;
  flex: none;
  min-width: 84px;
}

.num .t1 { font-size: 14px; font-weight: 800; letter-spacing: -0.2px; }

.num .t2 { margin-top: 4px; }

/* Chip naik/turun */

.chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  line-height: 1.3;
}

.chip.up { color: var(--green-deep); background: rgba(48, 209, 88, 0.16); }
.chip.down { color: var(--red-deep); background: rgba(255, 59, 48, 0.13); }
.chip.flat { color: var(--ink2); background: rgba(109, 109, 127, 0.12); }

/* Bar volume (paling besar = terpanjang) */

.vbar {
  height: 4px;
  border-radius: 2px;
  background: rgba(28, 28, 46, 0.08);
  margin-top: 7px;
  overflow: hidden;
}

.vbar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), #5ac8fa);
  transition: width 0.9s var(--spring);
}

/* ---------------- Form portfolio ---------------- */

.field {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

input.wallet {
  flex: 1;
  min-width: 180px;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(28, 28, 46, 0.10);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input.wallet:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

input.wallet::placeholder { color: var(--ink3); }

.btn {
  height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(10, 132, 255, 0.30);
  transition: transform 0.3s var(--spring), box-shadow 0.3s, opacity 0.2s;
}

.btn:active { transform: scale(0.96); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--blue);
  border: 1.5px solid rgba(10, 132, 255, 0.35);
  box-shadow: none;
}

.btn.link {
  height: auto;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
}

.btn.link:active { transform: none; opacity: 0.6; }

/* Banner peringatan (mode contoh) */

.banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(255, 149, 0, 0.14);
  border: 1px solid rgba(255, 149, 0, 0.35);
  color: #8a5200;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
}

/* ---------------- Sinyal (tab Alert) ---------------- */

.sig-types {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.sig-types li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.sig {
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  animation: sigIn 0.5s var(--spring) both;
}

.rows.sig-list .sig:first-child { border-top: 0; padding-top: 4px; }

@keyframes sigIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.sig-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sig .asset { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }

.sig .strength {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink2);
}

.sig .strength i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(28, 28, 46, 0.15);
}

.sig .strength i.on { background: var(--green); }

.sig p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.sig-sub {
  font-size: 11.5px !important;
  color: var(--ink2) !important;
  margin-top: 4px !important;
}

/* ---------------- Grafik OHLC ---------------- */

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chart-head h2 { margin-bottom: 0; }

select.sym {
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid rgba(28, 28, 46, 0.10);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

.chart-wrap { position: relative; margin-top: 10px; }

canvas#ohlc-canvas {
  width: 100%;
  height: 190px;
  display: block;
}

/* ---------------- Tab bar (bawah, gaya iOS) ---------------- */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 -10px 30px rgba(28, 28, 46, 0.08);
}

.tabbar button {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink3);
  transition: color 0.2s;
}

.tabbar button svg {
  width: 24px;
  height: 24px;
  transition: transform 0.35s var(--spring);
}

.tabbar button:active { color: var(--blue); }

.tabbar button.active { color: var(--blue); }
.tabbar button.active svg { transform: translateY(-2px) scale(1.1); }

/* ---------------- Footer + toast ---------------- */

.foot {
  padding: 4px 16px 14px;
  font-size: 11px;
  color: var(--ink3);
  line-height: 1.55;
  text-align: center;
}

.foot a { color: var(--ink2); font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  background: rgba(17, 17, 20, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--spring), transform 0.35s var(--spring);
  max-width: 80vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- Skeleton (sedang memuat) ---------------- */

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(28, 28, 46, 0.06) 25%,
    rgba(28, 28, 46, 0.12) 50%,
    rgba(28, 28, 46, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  margin: 12px 0;
}

.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w40 { width: 40%; }

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- Elemen kosong ---------------- */

.empty {
  text-align: center;
  padding: 18px 8px;
  color: var(--ink2);
  font-size: 13.5px;
  line-height: 1.55;
}

.empty .big-emoji {
  font-size: 34px;
  display: block;
  margin-bottom: 8px;
}
