/* Radio Marina sticky player bar — injected on radiomarina.net (RTL Arabic).
   All rules are namespaced under #rmp-bar / .rmp- to avoid theme collisions. */

body.rmp-has-player { padding-bottom: 76px; }

/* Phase 2 seamless-navigation progress bar */
#rmp-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 0;
  height: 3px;
  z-index: 99995;
  background: linear-gradient(90deg, #0909f1, #359cd7);
  box-shadow: 0 0 8px rgba(53, 156, 215, 0.7);
  opacity: 0;
  transition: width 0.25s ease;
}
#rmp-progress.rmp-active { opacity: 1; }
#rmp-progress.rmp-done { transition: width 0.2s ease, opacity 0.35s ease 0.15s; opacity: 0; }

#rmp-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 99990;
  height: 64px;
  background: rgba(6, 9, 18, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-block-start: 3px solid #ec1c1c;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
  font-family: 'Tajawal', 'Segoe UI', system-ui, Arial, sans-serif;
  color: #f2f4fb;
  direction: rtl;
}

#rmp-bar * { box-sizing: border-box; }

#rmp-bar .rmp-inner {
  width: min(1180px, 100% - 24px);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Play button */
#rmp-bar .rmp-play {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(140deg, #0909f1, #359cd7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  padding: 0;
}
#rmp-bar .rmp-play:hover { transform: scale(1.07); }
#rmp-bar .rmp-play svg { width: 20px; height: 20px; fill: currentColor; }
#rmp-bar .rmp-i-pause, #rmp-bar .rmp-i-spin { display: none; }
#rmp-bar[data-state="playing"] .rmp-i-play { display: none; }
#rmp-bar[data-state="playing"] .rmp-i-pause { display: block; }
#rmp-bar[data-state="loading"] .rmp-i-play { display: none; }
#rmp-bar[data-state="loading"] .rmp-i-spin { display: block; animation: rmp-spin 0.9s linear infinite; }
@keyframes rmp-spin { to { transform: rotate(360deg); } }

/* Equalizer (animates only while playing) */
#rmp-bar .rmp-eq {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  width: 26px;
}
#rmp-bar .rmp-eq span {
  width: 4px;
  height: 25%;
  border-radius: 2px;
  background: linear-gradient(180deg, #359cd7, #0909f1);
  opacity: 0.35;
  animation: rmp-eq 1s ease-in-out infinite;
  animation-play-state: paused;
}
#rmp-bar[data-state="playing"] .rmp-eq span { opacity: 0.95; animation-play-state: running; }
@keyframes rmp-eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
#rmp-bar .rmp-eq span:nth-child(1) { animation-delay: -0.2s; animation-duration: 1.1s; }
#rmp-bar .rmp-eq span:nth-child(2) { animation-delay: -0.6s; animation-duration: 0.85s; }
#rmp-bar .rmp-eq span:nth-child(3) { animation-delay: -0.35s; animation-duration: 1.25s; }
#rmp-bar .rmp-eq span:nth-child(4) { animation-delay: -0.8s; animation-duration: 0.95s; }
#rmp-bar .rmp-eq span:nth-child(5) { animation-delay: -0.15s; animation-duration: 1.15s; }

/* Now playing */
#rmp-bar .rmp-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
#rmp-bar .rmp-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ff6a6a;
}
#rmp-bar .rmp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ec1c1c;
  animation: rmp-pulse 1.6s ease-in-out infinite;
}
#rmp-bar.rmp-off .rmp-dot { background: rgba(226,232,250,.5); animation: none; }
#rmp-bar.rmp-off .rmp-label { color: rgba(226,232,250,.6); }
@keyframes rmp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(236,28,28,.55); } 50% { box-shadow: 0 0 0 6px rgba(236,28,28,0); } }
#rmp-bar .rmp-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
  unicode-bidi: plaintext;
}

/* Volume (pushed to the far end) */
#rmp-bar .rmp-vol {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 160px;
  color: rgba(226, 232, 250, 0.6);
}
#rmp-bar .rmp-vol svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
#rmp-bar .rmp-vol-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.14); outline: none; cursor: pointer;
}
#rmp-bar .rmp-vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #359cd7; border: 2px solid #fff; cursor: pointer;
}
#rmp-bar .rmp-vol-range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #359cd7; border: 2px solid #fff; cursor: pointer;
}
#rmp-bar .rmp-vol-range:focus-visible { outline: 2px solid #359cd7; outline-offset: 4px; }

/* Pop-out */
#rmp-bar .rmp-popout {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex; align-items: center; justify-content: center;
  color: #f2f4fb;
  transition: background 0.2s, border-color 0.2s;
}
#rmp-bar .rmp-popout:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.3); }
#rmp-bar .rmp-popout svg { width: 18px; height: 18px; fill: currentColor; }

/* Mobile */
@media (max-width: 680px) {
  body.rmp-has-player { padding-bottom: 68px; }
  #rmp-bar { height: 58px; }
  #rmp-bar .rmp-inner { gap: 10px; width: calc(100% - 16px); }
  #rmp-bar .rmp-eq { display: none; }
  #rmp-bar .rmp-vol { display: none; }
  #rmp-bar .rmp-title { max-width: 58vw; }
}
