/* ══════════════════════════════════════════
   SERENITY RADIO — moat.css
   Score, channels, companion, toast styles
   ══════════════════════════════════════════ */

/* ── Channel tabs ── */
#channel-tabs {
  display: flex; gap: 7px; justify-content: center;
  flex-wrap: wrap; margin: 1rem 0 0;
  /* No bottom margin — moat-panel snaps flush below when open */
}
.ch-tab {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 15px; font-size: 13px;
  color: var(--text-muted); cursor: pointer;
  transition: all .2s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  flex-direction: column; line-height: 1.25; text-align: center;
}
.ch-tab:hover { border-color: var(--sage); color: var(--text); }
.ch-tab.active {
  background: var(--sage); color: #fff;
  border-color: var(--sage);
  box-shadow: 0 0 14px rgba(122,158,126,.3);
  /* When active, square off bottom corners so panel feels attached */
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}
/* Tier badge inside the channel tab */
.ch-tier-badge {
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  opacity: .55; font-weight: 600;
}
.ch-tab.active .ch-tier-badge { opacity: .75; }
/* Ambient toggle — sits left of channel tabs, slightly separated */
.ch-ambient {
  margin-right: 6px;
  border-right: 1px solid rgba(255,255,255,.08);
  padding-right: 18px;
  color: rgba(255,255,255,.38);
}
.ch-ambient:hover { color: rgba(180,220,160,.9); border-color: rgba(140,200,120,.3); }

/* ── Moat panel visual connection ── */
/* Spacer between tabs row and panel collapses to 0 when panel open */
#channel-tabs {
  transition: margin-bottom 0.42s cubic-bezier(0.4,0,0.2,1);
}
/* A thin sage accent bar below the tabs row that only shows when panel is open */
#channel-tabs::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -1px; left: 6%; right: 6%;
  height: 2px;
  background: var(--sage);
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#channel-tabs { position: relative; }
/* When panel is open, show the connector and compress gap */
body.moat-open #channel-tabs { margin-bottom: -1px; }
body.moat-open #channel-tabs::after { opacity: 0.55; }

/* ── Channel switch toast ── */
#ch-toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: .85rem 1.4rem;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; opacity: 0; transition: all .35s;
  pointer-events: none; z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
#ch-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Check-in toast ── */
#checkin-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg2); border: 1px solid rgba(122,158,126,.4);
  border-radius: 12px; padding: .75rem 1rem;
  display: flex; align-items: center; font-size: 13px;
  color: var(--text-muted); z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: fadeUp .4s ease both;
}

/* ── Score badge in header ── */
#score-badge {
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 20px;
  transition: all .3s;
}
#score-badge:hover { transform: scale(1.05); }

/* ── Modal base ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,12,20,.7); backdrop-filter: blur(4px);
  z-index: 300;
}
.modal-box {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  width: min(520px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.75rem;
  z-index: 301; opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
.modal-box.visible {
  opacity: 1; transform: translate(-50%, -50%);
}
.modal-wide { width: min(680px, 94vw); }
.modal-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: .5rem;
}
.modal-title { font-size: 1.1rem; color: var(--sage-light); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 18px; line-height: 1;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Sliders ── */
.slider-row { margin-bottom: 1.1rem; }
.slider-label {
  display: flex; justify-content: space-between;
  font-size: 14px; margin-bottom: 4px;
}
.slider-val {
  font-weight: 600; color: var(--sage-light);
  min-width: 20px; text-align: right;
}
.score-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 4px;
  background: var(--bg3); outline: none; cursor: pointer;
  margin-top: 6px;
}
.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--sage-light); cursor: pointer;
}
.btn-checkin {
  width: 100%; padding: 12px; border-radius: 10px;
  background: var(--sage); color: #fff; border: none;
  font-size: 15px; font-weight: 500; cursor: pointer;
  margin-top: 1rem; transition: opacity .2s;
  font-family: inherit;
}
.btn-checkin:disabled { opacity: .5; cursor: not-allowed; }

/* ── Score reveal ── */
.score-reveal { text-align: center; padding-top: 1rem; }
.score-circle {
  width: 100px; height: 100px; border-radius: 50%;
  border: 3px solid; margin: 0 auto 1rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  animation: scoreIn .6s ease both;
}
@keyframes scoreIn {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.score-number { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.score-denom  { font-size: 12px; opacity: .6; }
.score-insight {
  font-size: 15px; line-height: 1.6;
  color: var(--text); margin-bottom: .5rem;
  font-style: italic;
}
.score-rec { font-size: 12px; color: var(--text-muted); margin-bottom: .5rem; }

/* ── Companion message in DJ card ── */
#dj-quote { transition: opacity .4s ease; }

/* ══════════════════════════════════════════
   AUTH UI
   ══════════════════════════════════════════ */
#auth-area { display: flex; align-items: center; }
.auth-login-btn {
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 7px 18px; border-radius: 50px;
  border: 1px solid rgba(122,158,126,.4);
  background: transparent; color: #b8d4bb; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.auth-login-btn:hover { background: rgba(122,158,126,.15); border-color: #7a9e7e; }
.auth-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 12px; border-radius: 50px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); transition: background .2s;
}
.auth-user:hover { background: rgba(255,255,255,.08); }
.auth-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--sage); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.auth-name { font-size: 13px; color: var(--text); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-badge { font-size: 10px; background: var(--gold,#d4a843); color: #1a1000; padding: 1px 6px; border-radius: 8px; font-weight: 600; }

/* Auth modal — high contrast, no backdrop-filter dependency */
#auth-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; pointer-events: none;
  opacity: 0; transition: opacity .25s ease;
}
#auth-modal.visible { opacity: 1; pointer-events: all; }
.auth-overlay-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.75);
}
.auth-dialog {
  position: relative; z-index: 1;
  background: #ffffff; color: #1a1e2e;
  border-radius: 20px; padding: 2.5rem 2rem;
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: translateY(24px); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#auth-modal.visible .auth-dialog { transform: translateY(0); }
.auth-dialog h2 { color: #1a1e2e !important; }
.auth-dialog-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; cursor: pointer;
  color: #888; font-size: 18px; line-height: 1;
  transition: color .2s, transform .2s;
}
.auth-dialog-close:hover { color: #333; transform: rotate(90deg); }
.modal-msg { font-size: 13px; margin-top: .75rem; min-height: 1.2em; }
.modal-msg.ok { color: #2e7d32; }
.modal-msg.error { color: #c62828; }

/* Auth dropdown menu */
#auth-menu {
  position: fixed; z-index: 400; background: #1e2538;
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: .5rem; min-width: 170px;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#auth-menu.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.auth-menu-item {
  padding: 9px 14px; font-size: 13px; cursor: pointer;
  border-radius: 8px; color: #e8e0d5; transition: background .15s;
}
.auth-menu-item:hover { background: rgba(255,255,255,.07); }
.auth-menu-sep { height: 1px; background: rgba(255,255,255,.07); margin: .3rem 0; }

/* Upgrade modal */
.upgrade-box { max-width: 560px !important; }
.upgrade-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media(max-width:500px) { .upgrade-plans { grid-template-columns: 1fr; } }
.upgrade-plan {
  background: #f5f7f5; border: 1px solid #ddd;
  border-radius: 14px; padding: 1.5rem; position: relative;
}
.upgrade-plan.featured { border-color: #c9a840; background: #fffbef; }
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: #d4a843; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 12px; border-radius: 10px; white-space: nowrap;
}
.plan-name { font-size: .9rem; color: #666; margin-bottom: .25rem; }
.plan-price { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 400; color: #3d5c40; margin-bottom: 1rem; }
.plan-price span { font-size: 1rem; color: #888; }
.plan-feats { list-style: none; font-size: 13px; color: #333; text-align: left; margin-bottom: 1.5rem; }
.plan-feats li { padding: 4px 0; }
.plan-btn {
  width: 100%; padding: 10px; border-radius: 50px;
  background: #7a9e7e; color: #fff; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: opacity .2s;
}
.plan-btn:hover { opacity: .88; }
.btn-gold { background: #d4a843; color: #fff; }

/* ══════════════════════════════════════════
   FAVORITES
   ══════════════════════════════════════════ */
/* Heart buttons — fully transparent, no box */
.fav-btn {
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  color: rgba(255,255,255,.28); transition: color .2s, transform .15s;
  line-height: 1; font-size: 16px;
}
.fav-btn.active { color: #c96a6a; }
.fav-btn:hover  { color: #e89a9a; transform: scale(1.2); }
.fav-btn svg    { pointer-events: none; }

/* Schedule heart — smaller, sits flush in row */
.sched-fav-btn {
  background: none !important; border: none !important;
  padding: 2px 5px; font-size: 15px; flex-shrink: 0;
}

/* Favorites panel queue buttons */
.fav-queue-btns {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem;
}
.fav-q-btn {
  flex: 1; min-width: 90px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: #d4cfc9; border-radius: 20px; padding: 7px 12px;
  font-size: 13px; cursor: pointer; transition: background .2s, color .2s;
}
.fav-q-btn:hover:not(:disabled) {
  background: rgba(122,158,126,.25); border-color: rgba(122,158,126,.4); color: #b8d4bb;
}
.fav-q-btn:disabled, .fav-q-disabled {
  opacity: .35; cursor: default;
}

/* Row checkboxes */
.fav-check {
  accent-color: #7a9e7e; width: 15px; height: 15px;
  cursor: pointer; flex-shrink: 0;
}

#fav-panel {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
#fav-panel.visible { opacity: 1; pointer-events: all; }
.fav-panel-backdrop { position: absolute; inset: 0; background: rgba(8,10,20,.7); }
.fav-panel-inner {
  position: relative; background: #1e2538;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px 20px 0 0; padding: 1.5rem;
  width: 100%; max-width: 500px; max-height: 70vh; overflow-y: auto;
  transform: translateY(40px); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#fav-panel.visible .fav-panel-inner { transform: translateY(0); }
.fav-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.fav-panel-header h3 { font-family: 'Playfair Display', serif; font-weight: 400; }
.fav-panel-header button { background: none; border: none; cursor: pointer; color: #9a9590; font-size: 18px; }
.fav-empty { color: #9a9590; font-size: 14px; text-align: center; padding: 2rem 0; line-height: 1.8; }
.fav-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.fav-row:last-child { border-bottom: none; }
.fav-row-info { flex: 1; }
.fav-row-title { font-size: 14px; }
.fav-row-artist { font-size: 12px; color: #9a9590; }
.fav-play-btn, .fav-remove-btn {
  background: none; border: none; cursor: pointer;
  color: #9a9590; font-size: 14px; padding: 4px 8px; border-radius: 6px;
  transition: color .2s, background .2s;
}
.fav-play-btn:hover { color: #7a9e7e; background: rgba(122,158,126,.1); }
.fav-remove-btn:hover { color: #c96a6a; background: rgba(201,106,106,.1); }

/* Generic toast for upgrade notices */
.sr-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: #7a9e7e; color: #fff; padding: 12px 28px;
  border-radius: 50px; font-size: 14px; z-index: 500;
  animation: toastIn .4s ease both;
}
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
