/* =======================================================
   assets/css/player.css (FULL - ALIGNMENT FIXED + HEART FIXED)
   - Fixed Stop Button Alignment (No longer "hiwi")
   - ✅ Favorites Heart turns RED when JS sets fa-solid
   - ✅ FIX: Play button no longer "bounces / drops" on tap (mobile safe)
   - ✅ NEW: Desktop-only logo/text shift (mobile not affected)
   ======================================================= */

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* ---------------- TOPBAR LAYOUT ---------------- */
.topbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  overflow: visible;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  overflow: visible;
}

/* Brand */
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111827;
  font-weight: 800;
  white-space: nowrap;
}
.app-brand i { font-size: 18px; }
.app-brand span { font-size: 14px; }

/* ---------------- PLAYER CAPSULE ---------------- */
.player-capsule {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

/* Left info */
.pi-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 320px;
  padding-right: 10px;
  overflow: hidden;
  position: relative;
}

/* ✅ DESKTOP ONLY: isbog pa left (MOBILE dili maapil) */
@media (min-width: 769px){
  .pi-info{
    margin-left: -22px; /* ✅ tune: -20 -30 -40 */
  }
}

.pi-logo {
  width: 45px;
  height: 45px;
  background: #ffffff;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  flex-shrink: 0;
}

.pi-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.pi-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1F2937;
  margin: 0;
  line-height: 1.3;
  height: 1.3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(0);
}

.pi-text h4.scrolling {
  text-overflow: unset;
  overflow: visible;
  animation: marquee-exact var(--anim-dur) linear infinite;
}

.pi-text span {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes marquee-exact {
  0% { transform: translateX(var(--anim-start)); }
  100% { transform: translateX(var(--anim-end)); }
}

/* Controls center */
.pi-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  flex: 1;
  overflow: visible;
}

.btn-prev, .btn-next {
  color: #4B5563;
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-prev:hover, .btn-next:hover { color: #111827; }

/* =========================
   Play button (NO BOUNCE FIX)
   ========================= */
.btn-play-circle {
  width: 45px;
  height: 45px;
  background: #1F2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  /* ❌ remove transform transition (conflicts with mobile translateY) */
  transition: background 0.18s ease, opacity 0.12s ease;

  position: relative;
  overflow: visible;
  color: #E50914; /* Buffer ring color */
}

.btn-play-circle .buffer-ring-base { opacity: 0.25; }
.btn-play-circle:hover { background: #E50914; }

/* ✅ Instead of transform scale, use opacity only (no position jump) */
.btn-play-circle:active { opacity: 0.88; }

/* --- ✅ ALIGNMENT FIX START --- */
.btn-play-circle i {
  font-size: 20px;
  color: #fff;
  position: relative;
  z-index: 6;
}

/* Iduso gamay ang PLAY (Triangle) para visual center */
.btn-play-circle i.fa-play {
  margin-left: 3px;
}

/* Ang STOP (Square) dapat walay margin para center jud */
.btn-play-circle i.fa-stop {
  margin-left: 0;
}
/* --- ✅ ALIGNMENT FIX END --- */

/* Right actions */
.pi-actions {
  width: 320px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  color: #4B5563;
  font-size: 18px;
  padding-right: 18px;
}

.pi-actions i { cursor: pointer; }
.pi-actions i:hover { color: #111827; }

/* Volume */
.vol-container { display: flex; align-items: center; gap: 10px; }
.vol-slider {
  width: 56px;
  min-width: 44px;
  height: 4px;
  cursor: pointer;
  accent-color: #E50914;
}

/* ---------------- BUFFER RING ---------------- */
.btn-play-circle .buffer-ring-svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%) translateY(-0.50px);
  z-index: 5;
  pointer-events: none;
  display: none;
}

.btn-play-circle.is-loading .buffer-ring-svg { display: block; }
.btn-play-circle .buffer-ring-spin {
  transform-origin: 50% 50%;
  animation: buffer-spin 0.85s linear infinite;
}

@keyframes buffer-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================================
   ✅ FAVORITES HEART FIX (WORKS WITH YOUR JS)
   ========================================= */

/* Default heart (not favorite) */
.btn-fav i.fa-heart {
  color: #4B5563;
  transition: transform 0.12s, color 0.12s;
}

/* When favorite: fa-solid heart becomes red */
.btn-fav i.fa-solid.fa-heart {
  color: #ef4444 !important;
}

/* hover still looks nice */
.btn-fav:hover i.fa-heart {
  color: #111827;
}
.btn-fav:hover i.fa-solid.fa-heart {
  color: #ef4444 !important;
}

/* click pop */
.btn-fav:active {
  transform: scale(1.15);
}

/* =======================================================
   MOBILE TOPBAR PLAYER FIX
   - Hide prev/next + volume on mobile
   - Move play button to right corner
   - Move LOGO slightly to the right
   ======================================================= */
@media (max-width: 768px) {

  /* ✅ MOBILE RESET: dili maapil ang desktop isbog */
  .pi-info{
    margin-left: 0 !important; /* ✅ important para sure */
  }

  /* player capsule himoon relative para pwede i-absolute ang play */
  .player-capsule {
    position: relative;
    padding-right: 58px; /* space para sa play button sa right */
  }

  /* left info: mo stretch, ayaw putla */
  .pi-info {
    width: auto;
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    padding-left: 2px;   /* ✅ LOGO + TEXT PA RIGHT */
  }

  /* hide prev/next */
  .btn-prev,
  .btn-next {
    display: none !important;
  }

  /* hide volume */
  .vol-container {
    display: none !important;
  }

  /* controls area dili na mo kaon ug space */
  .pi-controls {
    flex: 0;
    width: 0;
    padding: 0;
    margin: 0;
    position: static;
  }

  /* play button */
  .btn-play-circle {
    position: absolute;
    right: 15px;
    top: 50%;

    /* ✅ KEEP translateY ALWAYS (no override anymore) */
    transform: translateY(-50%);

    width: 42px;
    height: 42px;
    z-index: 50;
  }

  /* buffer ring follow size */
  .btn-play-circle .buffer-ring-svg {
    width: 52px;
    height: 52px;
  }

  /* heart + share spacing */
  .pi-actions {
    width: auto;
    padding-right: 0;
    gap: 12px;
    margin-right: 60px; /* ✅ gamay nalang, para di kaayo mo “push left” */
  }
}
