/* BestMom Motivation Audio — Frontend v7 */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,700;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Variables ───────────────────────────────── */
#bma-root {
  --p:        #6B4EFF;
  --p-dark:   #5539E0;
  --p-light:  #EDE9FF;
  --p-glow:   rgba(107,78,255,0.15);
  --rose:     #F472B6;
  --rose-l:   rgba(244,114,182,0.13);
  --bg:       #F6F4FF;
  --card:     #FFFFFF;
  --text:     #1C1040;
  --muted:    #7A6E9A;
  --border:   rgba(107,78,255,0.10);
  --r:        16px;
  --shadow:   0 4px 24px rgba(107,78,255,0.10);
  --shadow-h: 0 10px 40px rgba(107,78,255,0.20);
  --font:     'Plus Jakarta Sans', system-ui, sans-serif;
  --serif:    'Cormorant Garamond', Georgia, serif;

  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
}
#bma-root * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tabs ───────────────────────────────────── */
.bma-nav {
  display: flex;
  gap: 4px;
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.bma-nav::-webkit-scrollbar { display: none; }

.bma-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  transition: all .18s;
  white-space: nowrap;
}
.bma-nav-tab:hover { color: var(--p); background: var(--p-glow); }
.bma-nav-tab.is-active {
  color: var(--p);
  border-bottom-color: var(--p);
  background: var(--p-glow);
}

.bma-nav-badge {
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
  display: none;
}
.bma-nav-badge.visible { display: inline-block; }

/* ── Panels ─────────────────────────────────── */
.bma-tab-panel          { display: none; padding: 0 16px; }
.bma-tab-panel.is-active { display: block; }

/* ── Hero ───────────────────────────────────── */
.bma-hero {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  margin: 16px 0 20px;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
}

.bma-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,#EDE9FF 0%,#F5F0FF 50%,#FFF0F8 100%);
  transition: background .35s;
}

/* Dark overlay so text is always readable */
.bma-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,5,40,.75) 0%, rgba(15,5,40,.10) 65%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.bma-hero-body {
  position: relative;
  z-index: 2;
  padding: 24px;
  width: 100%;
}

.bma-hero-pill {
  display: inline-block;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 13px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.2);
  margin-bottom: 10px;
}

.bma-hero-title {
  font-family: var(--serif);
  font-size: clamp(20px, 4vw, 32px);
  font-style: italic;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}

.bma-hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  line-height: 1.55;
  margin-bottom: 18px;
  max-width: 500px;
}

.bma-hero-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Play circles ───────────────────────────── */
.bma-play-circle {
  border-radius: 50%;
  border: none;
  background: var(--p);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
}
.bma-play-circle:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.bma-play-circle-lg {
  width: 58px; height: 58px;
  box-shadow: 0 6px 24px rgba(107,78,255,.5);
}
.bma-play-circle-sm {
  width: 40px; height: 40px;
  box-shadow: 0 4px 14px rgba(107,78,255,.4);
}
.bma-play-circle-xs {
  width: 34px; height: 34px;
  background: var(--p-light);
  color: var(--p);
  box-shadow: none;
}
.bma-play-circle:hover       { transform: scale(1.08); }
.bma-play-circle.is-playing  { background: var(--p-dark); }
.bma-play-circle-xs.is-playing { background: var(--p); color: #fff; }
.bma-play-circle-lg:hover    { box-shadow: 0 10px 32px rgba(107,78,255,.6); }

/* ── Progress bar ───────────────────────────── */
.bma-progress {
  height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.bma-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 100px;
  transition: width .1s linear;
  pointer-events: none;
}
/* Dot handle on hover */
.bma-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(107,78,255,.5);
  opacity: 0;
  transition: opacity .15s;
}
.bma-progress:hover .bma-progress-fill::after { opacity: 1; }

/* Dark variant (used inside track rows) */
.bma-progress-dark { background: rgba(107,78,255,.12); }
.bma-progress-dark .bma-progress-fill {
  background: linear-gradient(90deg, var(--p), #A78BFA);
}
.bma-progress-dark .bma-progress-fill::after {
  background: var(--p);
  box-shadow: 0 0 0 2px #fff;
}

.bma-hero-progress-wrap { flex: 1; min-width: 0; }

.bma-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.bma-time-row span {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  font-variant-numeric: tabular-nums;
}

/* ── Heart button ───────────────────────────── */
.bma-heart-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.bma-heart-btn:hover   { background: var(--rose-l); border-color: var(--rose); color: var(--rose); }
.bma-heart-btn.is-fav  { background: var(--rose-l); border-color: var(--rose); color: var(--rose); }
.bma-heart-btn:focus   { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ── List header ────────────────────────────── */
.bma-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bma-list-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
}
.bma-list-count { font-size: 12px; color: var(--muted); }

/* ── Track list ─────────────────────────────── */
.bma-list { display: flex; flex-direction: column; gap: 6px; }

/* ── Single track row ───────────────────────── */
.bma-track {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  user-select: none;
}
.bma-track:hover {
  border-color: rgba(107,78,255,.28);
  box-shadow: var(--shadow);
  transform: translateX(3px);
}
.bma-track.is-active {
  border-color: var(--p);
  background: var(--p-light);
  box-shadow: 0 4px 18px var(--p-glow);
}

/* Thumb */
.bma-track-thumb {
  width: 46px; height: 46px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--p-light);
  overflow: hidden;
  position: relative;
}
.bma-track-thumb img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Info */
.bma-track-info { flex: 1; min-width: 0; }
.bma-track-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.bma-track.is-active .bma-track-title { color: var(--p-dark); }
.bma-track-sub { font-size: 11px; color: var(--muted); }

/* Mini progress (only shows when active) */
.bma-track-progress-row {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.bma-track.is-active .bma-track-progress-row { display: flex; }
.bma-track-progress-row .bma-progress { flex: 1; }
.bma-track-time {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Right controls */
.bma-track-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.bma-track-dur { font-size: 11px; color: var(--muted); font-weight: 600; }

/* Small heart */
.bma-heart-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  flex-shrink: 0;
}
.bma-heart-sm:hover { border-color: var(--rose); color: var(--rose); }
.bma-heart-sm.is-fav { background: var(--rose-l); border-color: var(--rose); color: var(--rose); }

/* ── Favorites empty ────────────────────────── */
.bma-empty-favs {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.bma-empty-icon  { font-size: 48px; display: block; margin-bottom: 14px; opacity: .5; }
.bma-empty-title { font-family: var(--serif); font-size: 20px; font-style: italic; color: var(--text); margin-bottom: 6px; }
.bma-empty-sub   { font-size: 13px; line-height: 1.6; }

/* ── Floating player ────────────────────────── */
.bma-float {
  position: fixed;
  bottom: 12px;
  left: 12px; right: 12px;
  z-index: 99999;
  border-radius: 18px;
  background: rgba(20,10,52,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(167,139,250,.18);
  box-shadow: 0 -4px 40px rgba(0,0,0,.28);
  overflow: hidden;
  animation: bmaFloatIn .32s cubic-bezier(.34,1.56,.64,1);
}
@keyframes bmaFloatIn {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.bma-float-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px 8px;
}

.bma-float-thumb {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p), #A78BFA);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.bma-float-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

.bma-float-info { flex: 1; min-width: 0; overflow: hidden; }
.bma-float-title {
  font-size: 13px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bma-float-sub {
  font-size: 10px; color: rgba(255,255,255,.45); margin-top: 1px;
}

.bma-float-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.bma-float-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: none;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all .18s;
}
.bma-float-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Thin progress bar at very bottom of float */
.bma-float-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,.08);
  margin: 0;
}
.bma-float-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--p), #A78BFA);
  transition: width .1s linear;
}

/* ── Heart burst ────────────────────────────── */
@keyframes bma-burst {
  0%   { opacity: 1; transform: scale(1)   translateY(0); }
  100% { opacity: 0; transform: scale(1.6) translateY(-44px); }
}
.bma-burst-el {
  position: fixed;
  pointer-events: none;
  z-index: 999999;
  font-size: 20px;
  animation: bma-burst .65s ease forwards;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 520px) {
  .bma-hero { min-height: 200px; }
  .bma-hero-title { font-size: 20px; }
  .bma-float { bottom: 0; left: 0; right: 0; border-radius: 18px 18px 0 0; }
  #bma-root { padding-bottom: 80px; }
  .bma-track-dur { display: none; }
}
