/* Radio Syariah web — tokens copied 1:1 from app res (colors.xml, colors_revamp.xml, drawables) */
:root {
  --colorPrimary: #37903b;
  --colorPrimaryDark: #1c5d1f;
  --colorAccent: #FF6600;
  --surface-bg: #F4F7F4;
  --surface-card: #FFFFFF;
  --card-outline: #E3EAE3;
  --green-container: #DCEFDD;
  --on-surface: #1B1F1B;
  --on-surface-muted: #6B746B;
  --live-bg: #FFECE0;
  --player-start: #1c5d1f;
  --player-end: #0f3a12;
  --nav-inactive: #7A857A;
  --pendengar-bg: #E8F5E9;
  --pendengar-fg: #37903b;
  --pendengar-num: #2E7D32;
  --pendengar-off: #616161;
  --bg-login: #0b745d;

  --bottom-nav-height: 64px;
  --player-above-nav: 76px;
  --list-bottom-clearance: 168px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface-bg);
  color: var(--on-surface);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.screen { min-height: 100vh; }
/* display:flex classes would override the hidden attribute without this */
[hidden] { display: none !important; }

/* ================= LOGIN (login.xml) ================= */
.screen-login {
  background: linear-gradient(135deg, var(--player-start), var(--player-end));
  min-height: 100vh;
}
.login-scroll {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px;
  min-height: 100vh;
}
.login-logo { width: 96px; height: 96px; margin-top: 24px; object-fit: contain; }
.login-appname { margin-top: 12px; color: #fff; font-size: 24px; font-weight: 700; width: 100%; text-align: center; }
.login-versi { color: rgba(255,255,255,.7); width: 100%; text-align: center; font-size: 12px; }
.login-row { display: flex; align-items: center; width: 100%; margin-top: 24px; }
/* bg_input.xml: white, 14dp radius, 1dp outline */
.login-input, .login-select {
  height: 54px;
  background: var(--surface-card);
  border: 1px solid var(--card-outline);
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--on-surface);
  outline: none;
}
.login-select { width: 72px; padding: 8px; appearance: auto; }
.login-hp { flex: 1; margin-left: 10px; min-width: 0; }
.login-pass { width: 100%; margin-top: 12px; }
.login-showpass {
  margin-top: 4px; align-self: flex-start;
  color: #fff; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.login-showpass input { accent-color: #fff; }
/* bg_btn_primary.xml: orange, 14dp radius */
.login-btn {
  width: 100%; height: 54px; margin-top: 16px;
  background: var(--colorAccent);
  border: 0; border-radius: 14px;
  color: #fff; font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer;
}
.login-btn:active { filter: brightness(1.1); }
.login-lupa {
  margin-top: 24px; padding: 8px;
  background: none; border: 0;
  color: rgba(255,255,255,.9); font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer;
}

/* ================= REQ RESET (req_reset.xml) ================= */
.screen-reqreset {
  background: linear-gradient(135deg, var(--player-start), var(--player-end));
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.reqreset-card { width: 100%; max-width: 360px; text-align: center; }
.reqreset-title { color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 32px; }
.reqreset-sub { color: #fff; font-size: 12px; margin-bottom: 16px; }
.reqreset-input { width: 100%; text-align: center; }
.reqreset-btn { margin-top: 32px; width: auto; padding: 0 24px; }
.reqreset-note { margin-top: 24px; color: rgba(255,255,255,.85); font-size: 13px; white-space: pre-line; }

/* ================= MAIN: collapsing header (CollapsingToolbarLayout port) =================
 * #bar is sticky with top:-184px: the LAST 56px stay pinned when fully scrolled.
 * Layout height NEVER changes on scroll (Android CoordinatorLayout does the same),
 * so there is no height->scrollY->height feedback loop (the old "shaking" bug).
 * Parallax + fades are transform/opacity only. */
#bar {
  position: sticky;
  top: -184px;                     /* 240 - 56: pins last 56px */
  z-index: 10;
  height: 240px;
  /* overflow:clip not hidden: hidden would make #bar a scroll container,
   * which disables position:sticky on the .toolbar-pin child */
  overflow: clip;
  background: var(--colorPrimaryDark);
}
#header-img {
  position: absolute;             /* layered behind sticky toolbar */
  inset: 0;
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  will-change: transform;
}
.header-scrim {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, transparent 50%, rgba(0,0,0,.4) 100%);
}
/* pinned toolbar (collapseMode=pin): sticky INSIDE the sticky bar so it rides
 * at viewport top across the whole collapse. The single morphing title lives
 * here (it just gets translated down to the expanded-title spot at rest);
 * background scrims transparent -> colorPrimaryDark (contentScrim) over last 40%. */
.toolbar-pin {
  position: sticky;
  top: 0;
  z-index: 2;
  height: calc(56px + env(safe-area-inset-top));
  display: flex; align-items: flex-start;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  color: #fff;
  background: transparent;
  overflow: visible;              /* title escapes downward into the image area */
  will-change: background-color;
}
.toolbar-pin #toolbar-title {
  /* single morphing title (CollapsingToolbarLayout): 26sp bold at bottom-left
   * when expanded; JS moves+scales it into the pinned toolbar slot on scroll */
  font-size: 26px;
  font-weight: 700;
  transform-origin: left top;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  will-change: transform;
}

#content { padding: 12px 12px var(--list-bottom-clearance); }
.station-list { display: flex; flex-direction: column; gap: 10px; }
.pad16 { padding: 16px; padding-bottom: var(--list-bottom-clearance); }

/* bg_card.xml */
.card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface-card);
  border: 1px solid var(--card-outline);
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(55,144,59,.1);
}
.card:active { background: rgba(55,144,59,.1); }
.card.playing { border-color: var(--colorPrimary); }

/* thumbox */
.thumbox { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.thumb {
  width: 64px; height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--green-container);
}
.info-chip {
  margin-top: 6px;
  max-width: 64px;
  padding: 1px 6px;
  background: var(--green-container);
  color: var(--colorPrimaryDark);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}

.teks { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row1 { display: flex; align-items: center; }
.nama {
  flex: 1; min-width: 0;
  font-size: 16px; font-weight: 700; color: var(--on-surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* bg_live_pill.xml + bling.xml blink */
.live-pill {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 3px 9px 3px 8px;
  background: var(--live-bg);
  border-radius: 999px;
  flex-shrink: 0;
}
.live-pill.on { display: flex; animation: bling 600ms linear infinite alternate; }
@keyframes bling { from { opacity: 0; } to { opacity: 1; } }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--colorAccent); }
.live-pill span { font-size: 10px; font-weight: 700; color: var(--colorAccent); letter-spacing: .5px; }

.judul {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--on-surface-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.judul.expanded { -webkit-line-clamp: unset; display: block; }
.chevron { width: 22px; height: 22px; padding: 4px; margin-top: 1px; color: var(--on-surface-muted); display: none; background: none; border: 0; cursor: pointer; }
.chevron.on { display: block; }

.row3 { display: flex; align-items: center; margin-top: 4px; }
/* simprop = fa-map-marker; 11sp muted */
.simprop { font-size: 11px; color: var(--on-surface-muted); margin-right: 4px; }
.kabprop {
  flex: 1; min-width: 0;
  font-size: 11px; color: var(--on-surface-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* pendengar_pill.xml; count>0 -> green pair, 0 -> gray desaturated (RadioAdapter) */
.pendengar {
  display: flex; align-items: center;
  margin-left: 6px;
  padding: 3px 6px;
  background: var(--pendengar-bg);
  border-radius: 999px;
  flex-shrink: 0;
}
.pendengar .fa { font-size: 12px; color: var(--pendengar-fg); }
.pendengar b { margin-left: 3px; font-size: 12px; color: var(--pendengar-num); font-weight: 700; }
.pendengar.zero .fa { color: var(--pendengar-off); }
.pendengar.zero b { color: var(--pendengar-off); }

.btn-bookmark {
  margin-left: 6px;
  width: 36px; height: 36px;
  border: 0; padding: 7px;
  background: transparent;
  cursor: pointer;
  color: var(--on-surface-muted);
}
.btn-bookmark svg { width: 100%; height: 100%; fill: currentColor; }
.btn-bookmark.marked { color: var(--colorAccent); }

/* ================= mini player (bg_player_floating) ================= */
.mini-player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottom-nav-height) + var(--player-above-nav) - 64px);
  width: min(456px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  padding: 10px;
  background: linear-gradient(90deg, var(--player-start), var(--player-end));
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 20;
}
.mini-player[hidden] { display: none; }
.mp-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #fff; }
.mp-text { flex: 1; min-width: 0; margin: 0 12px; }
.mp-nama { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-judul { margin-top: 2px; font-size: 13px; color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-play {
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--colorAccent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mp-play:active { background: #ff8534; }
.mp-play svg { width: 24px; height: 24px; fill: #fff; }

/* ================= bottom nav ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100vw);
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--surface-card);
  border-top: 1px solid var(--card-outline);
  z-index: 30;
}
.bottom-nav[hidden] { display: none; }
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: 0; background: transparent;
  color: var(--nav-inactive);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.nav-item svg { width: 22px; height: 22px; fill: currentColor; }
.nav-item.active { color: var(--colorPrimary); font-weight: 700; }

/* bookmark rows + info chip + empty state (activity_bookmark.xml + item_bookmark.xml) */
.bm-info {
  display: flex; align-items: center; gap: 10px;
  margin: 12px;
  background: var(--green-container);
  color: var(--colorPrimaryDark);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
}
.bm-info .fa { font-size: 18px; }
.bm-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; padding-bottom: var(--list-bottom-clearance); }
/* item_bookmark.xml: card bg, star drawableStart, bold 15sp, 56dp min height */
.bm-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--surface-card);
  border: 1px solid var(--card-outline);
  border-radius: 16px;
  cursor: pointer;
}
.bm-row:active { background: rgba(55,144,59,.1); }
.bm-star { width: 24px; height: 24px; color: var(--colorAccent); flex-shrink: 0; }
.bm-label { font-size: 15px; font-weight: 700; color: var(--on-surface); }
/* kosongBookmark: centered star icon + hint text */
.bm-kosong {
  text-align: center;
  padding: 24px;
  color: var(--on-surface-muted);
  font-size: 14px;
}
.bm-kosong svg { width: 24px; height: 24px; color: var(--nav-inactive); margin-bottom: 8px; }

/* ================= sub-screens shared: toolbar ================= */
.subappbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--colorPrimaryDark);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  min-height: calc(56px + env(safe-area-inset-top));
  justify-content: center;
}
.subappbar-title { font-size: 20px; font-weight: 500; }

/* info tabs (TabLayout) */
.info-tabs-bar { padding-bottom: 0; }
.tablayout { display: flex; margin-top: 6px; }
.tab {
  flex: 1;
  padding: 12px 0;
  background: none; border: 0;
  color: rgba(255,255,255,.7);
  font-size: 14px; font-family: inherit;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.tab.active { color: #fff; font-weight: 700; border-bottom-color: var(--colorAccent); }
.tab-page { padding: 0; }
.card-text {
  margin: 16px;
  background: var(--surface-card);
  border: 1px solid var(--card-outline);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.card-text a { color: var(--colorPrimaryDark); }
.card-text b { font-weight: 700; }

/* ================= PROFIL ================= */
.profil-scroll { padding: 16px; padding-bottom: var(--list-bottom-clearance); }
/* bg_profile_header.xml gradient */
.profile-header {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--player-start), var(--player-end));
  border-radius: 16px;
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  padding: 18px;
  object-fit: contain;
  filter: invert(1);
}
.profile-nama { margin-top: 10px; color: #fff; font-size: 20px; font-weight: 700; }
.profile-uid { color: rgba(255,255,255,.7); font-size: 12px; }
/* bg_profile_card.xml */
.profile-card {
  margin-top: 16px;
  background: var(--surface-card);
  border: 1px solid var(--card-outline);
  border-radius: 16px;
  padding: 16px;
}
.pc-label { font-size: 12px; color: var(--on-surface-muted); }
.pc-value { margin-top: 2px; font-size: 16px; font-weight: 700; color: var(--on-surface); }
.pc-muted { margin-top: 2px; font-size: 12px; color: var(--on-surface-muted); }
.pc-divider { height: 1px; background: var(--card-outline); margin-top: 14px; }
.btn-secondary {
  display: block; width: 100%; margin-top: 16px;
  height: 54px;
  background: var(--green-container);
  border: 0; border-radius: 14px;
  color: var(--colorPrimaryDark);
  font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer;
}
.btn-logout {
  display: block; width: 100%; margin-top: 12px;
  height: 54px;
  background: var(--colorAccent);
  border: 0; border-radius: 14px;
  color: #fff; font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer;
}

/* ================= EDIT PROFIL / ganti password (edit_profil.xml: #212121 bg) ================ */
.screen-edit { background: #212121; }
.screen-edit .edit-scroll { padding: 16px; }
.edit-note { color: #fff; text-align: center; margin: 24px 0 32px; font-size: 14px; }
.edit-input { width: 100%; }
.edit-input::placeholder { color: var(--on-surface-muted); }
.edit-btnrow { display: flex; gap: 0; margin-top: 32px; }
.edit-btn-no, .edit-btn-yes {
  flex: 1; height: 50px;
  border: 0; font-family: inherit; cursor: pointer;
  background: var(--green-container); color: var(--colorPrimaryDark);
  font-size: 15px;
  text-transform: none;
}
.edit-btn-yes { background: var(--colorPrimary); color: #fff; }

/* ================= misc ================= */
.empty { text-align: center; padding: 40px 16px; color: var(--on-surface-muted); }
.empty-title { font-size: 14px; }
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  background: var(--colorPrimary); color: #fff;
  border: 0; border-radius: 8px;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 24px);
  left: 50%; transform: translateX(-50%);
  max-width: 86%;
  padding: 10px 18px;
  background: #323232;
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.toast[hidden] { display: none; }
