/* Frontend player styles - CProjects LS Radio */

.cplsr-player-wrapper {
  --cplsr-primary: #2563eb;
  --cplsr-bg: #ffffff;
  --cplsr-timeline: #e5e7eb;
  --cplsr-wave-high: #4f46e5;
  --cplsr-wave-low: #a5b4fc;
  position: relative;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  width: 100%;
}

.cplsr-player-wrapper.cplsr-player--floating {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 9999;
  padding-inline: 16px;
}

.cplsr-player {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--cplsr-bg);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 14px 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
}

/* Cuando es flotante, limitamos el ancho del card para no tapar todo */
.cplsr-player-wrapper.cplsr-player--floating .cplsr-player {
  max-width: 480px;
  margin-inline: auto;
}

.cplsr-player-logo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  background-color: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}


.cplsr-player-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cplsr-logo-initials {
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Main layout */

.cplsr-player-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.cplsr-player-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.cplsr-player-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cplsr-badge-status {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: #e5e7eb;
  color: #374151;
  flex: 0 0 auto;
}

.cplsr-badge-status.cplsr-status-live {
  background-color: #dcfce7;
  color: #166534;
}

.cplsr-badge-status.cplsr-status-connecting {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.cplsr-badge-status.cplsr-status-error {
  background-color: #fee2e2;
  color: #b91c1c;
}

.cplsr-player-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.cplsr-player-meta-text {
  font-size: 12px;
  color: #6b7280;
}

/* Waveform */

.cplsr-wave-row {
  margin-top: 10px;
}

.cplsr-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0;
  height: 26px;
  width: 100%;
}

/* Cada barra es muy fina y usa dos colores (grave / agudo). 120 barras llenando todo el ancho. */
.cplsr-wave-bar {
  --cplsr-bar-scale: 0.6;
  flex: 0 0 2px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(
    to top,
    var(--cplsr-wave-low) 0%,
    var(--cplsr-wave-low) 45%,
    var(--cplsr-wave-high) 45%,
    var(--cplsr-wave-high) 100%
  );
  height: 24px;
  transform-origin: bottom;
  /* Altura base visible incluso en pausa */
  transform: scaleY(calc(0.25 + var(--cplsr-bar-scale) * 0.35));
  opacity: 0.95;
}

/* Perfil orgánico: más alto al centro, más bajo en los extremos (pensado para 120 barras) */
.cplsr-wave-bar:nth-child(1), .cplsr-wave-bar:nth-child(120) { --cplsr-bar-scale: 0.18; }
.cplsr-wave-bar:nth-child(2), .cplsr-wave-bar:nth-child(119) { --cplsr-bar-scale: 0.21; }
.cplsr-wave-bar:nth-child(3), .cplsr-wave-bar:nth-child(118) { --cplsr-bar-scale: 0.24; }
.cplsr-wave-bar:nth-child(4), .cplsr-wave-bar:nth-child(117) { --cplsr-bar-scale: 0.27; }
.cplsr-wave-bar:nth-child(5), .cplsr-wave-bar:nth-child(116) { --cplsr-bar-scale: 0.30; }
.cplsr-wave-bar:nth-child(6), .cplsr-wave-bar:nth-child(115) { --cplsr-bar-scale: 0.33; }
.cplsr-wave-bar:nth-child(7), .cplsr-wave-bar:nth-child(114) { --cplsr-bar-scale: 0.36; }
.cplsr-wave-bar:nth-child(8), .cplsr-wave-bar:nth-child(113) { --cplsr-bar-scale: 0.39; }
.cplsr-wave-bar:nth-child(9), .cplsr-wave-bar:nth-child(112) { --cplsr-bar-scale: 0.43; }
.cplsr-wave-bar:nth-child(10), .cplsr-wave-bar:nth-child(111) { --cplsr-bar-scale: 0.46; }
.cplsr-wave-bar:nth-child(11), .cplsr-wave-bar:nth-child(110) { --cplsr-bar-scale: 0.49; }
.cplsr-wave-bar:nth-child(12), .cplsr-wave-bar:nth-child(109) { --cplsr-bar-scale: 0.52; }
.cplsr-wave-bar:nth-child(13), .cplsr-wave-bar:nth-child(108) { --cplsr-bar-scale: 0.55; }
.cplsr-wave-bar:nth-child(14), .cplsr-wave-bar:nth-child(107) { --cplsr-bar-scale: 0.58; }
.cplsr-wave-bar:nth-child(15), .cplsr-wave-bar:nth-child(106) { --cplsr-bar-scale: 0.61; }
.cplsr-wave-bar:nth-child(16), .cplsr-wave-bar:nth-child(105) { --cplsr-bar-scale: 0.64; }
.cplsr-wave-bar:nth-child(17), .cplsr-wave-bar:nth-child(104) { --cplsr-bar-scale: 0.67; }
.cplsr-wave-bar:nth-child(18), .cplsr-wave-bar:nth-child(103) { --cplsr-bar-scale: 0.70; }
.cplsr-wave-bar:nth-child(19), .cplsr-wave-bar:nth-child(102) { --cplsr-bar-scale: 0.73; }
.cplsr-wave-bar:nth-child(20), .cplsr-wave-bar:nth-child(101) { --cplsr-bar-scale: 0.76; }
.cplsr-wave-bar:nth-child(21), .cplsr-wave-bar:nth-child(100) { --cplsr-bar-scale: 0.79; }
.cplsr-wave-bar:nth-child(22), .cplsr-wave-bar:nth-child(99) { --cplsr-bar-scale: 0.82; }
.cplsr-wave-bar:nth-child(23), .cplsr-wave-bar:nth-child(98) { --cplsr-bar-scale: 0.85; }
.cplsr-wave-bar:nth-child(24), .cplsr-wave-bar:nth-child(97) { --cplsr-bar-scale: 0.88; }
.cplsr-wave-bar:nth-child(25), .cplsr-wave-bar:nth-child(96) { --cplsr-bar-scale: 0.91; }
.cplsr-wave-bar:nth-child(26), .cplsr-wave-bar:nth-child(95) { --cplsr-bar-scale: 0.95; }
.cplsr-wave-bar:nth-child(27), .cplsr-wave-bar:nth-child(94) { --cplsr-bar-scale: 0.98; }
.cplsr-wave-bar:nth-child(28), .cplsr-wave-bar:nth-child(93) { --cplsr-bar-scale: 1.01; }
.cplsr-wave-bar:nth-child(29), .cplsr-wave-bar:nth-child(92) { --cplsr-bar-scale: 1.04; }
.cplsr-wave-bar:nth-child(30), .cplsr-wave-bar:nth-child(91) { --cplsr-bar-scale: 1.07; }
.cplsr-wave-bar:nth-child(31), .cplsr-wave-bar:nth-child(90) { --cplsr-bar-scale: 1.10; }
.cplsr-wave-bar:nth-child(32), .cplsr-wave-bar:nth-child(89) { --cplsr-bar-scale: 1.13; }
.cplsr-wave-bar:nth-child(33), .cplsr-wave-bar:nth-child(88) { --cplsr-bar-scale: 1.16; }
.cplsr-wave-bar:nth-child(34), .cplsr-wave-bar:nth-child(87) { --cplsr-bar-scale: 1.19; }
.cplsr-wave-bar:nth-child(35), .cplsr-wave-bar:nth-child(86) { --cplsr-bar-scale: 1.22; }
.cplsr-wave-bar:nth-child(36), .cplsr-wave-bar:nth-child(85) { --cplsr-bar-scale: 1.25; }
.cplsr-wave-bar:nth-child(37), .cplsr-wave-bar:nth-child(84) { --cplsr-bar-scale: 1.28; }
.cplsr-wave-bar:nth-child(38), .cplsr-wave-bar:nth-child(83) { --cplsr-bar-scale: 1.31; }
.cplsr-wave-bar:nth-child(39), .cplsr-wave-bar:nth-child(82) { --cplsr-bar-scale: 1.34; }
.cplsr-wave-bar:nth-child(40), .cplsr-wave-bar:nth-child(81) { --cplsr-bar-scale: 1.37; }
.cplsr-wave-bar:nth-child(41), .cplsr-wave-bar:nth-child(80) { --cplsr-bar-scale: 1.40; }
.cplsr-wave-bar:nth-child(42), .cplsr-wave-bar:nth-child(79) { --cplsr-bar-scale: 1.43; }
.cplsr-wave-bar:nth-child(43), .cplsr-wave-bar:nth-child(78) { --cplsr-bar-scale: 1.46; }
.cplsr-wave-bar:nth-child(44), .cplsr-wave-bar:nth-child(77) { --cplsr-bar-scale: 1.50; }
.cplsr-wave-bar:nth-child(45), .cplsr-wave-bar:nth-child(76) { --cplsr-bar-scale: 1.53; }
.cplsr-wave-bar:nth-child(46), .cplsr-wave-bar:nth-child(75) { --cplsr-bar-scale: 1.56; }
.cplsr-wave-bar:nth-child(47), .cplsr-wave-bar:nth-child(74) { --cplsr-bar-scale: 1.59; }
.cplsr-wave-bar:nth-child(48), .cplsr-wave-bar:nth-child(73) { --cplsr-bar-scale: 1.62; }
.cplsr-wave-bar:nth-child(49), .cplsr-wave-bar:nth-child(72) { --cplsr-bar-scale: 1.65; }
.cplsr-wave-bar:nth-child(50), .cplsr-wave-bar:nth-child(71) { --cplsr-bar-scale: 1.68; }
.cplsr-wave-bar:nth-child(51), .cplsr-wave-bar:nth-child(70) { --cplsr-bar-scale: 1.71; }
.cplsr-wave-bar:nth-child(52), .cplsr-wave-bar:nth-child(69) { --cplsr-bar-scale: 1.74; }
.cplsr-wave-bar:nth-child(53), .cplsr-wave-bar:nth-child(68) { --cplsr-bar-scale: 1.77; }
.cplsr-wave-bar:nth-child(54), .cplsr-wave-bar:nth-child(67) { --cplsr-bar-scale: 1.80; }
.cplsr-wave-bar:nth-child(55), .cplsr-wave-bar:nth-child(66) { --cplsr-bar-scale: 1.83; }
.cplsr-wave-bar:nth-child(56), .cplsr-wave-bar:nth-child(65) { --cplsr-bar-scale: 1.86; }
.cplsr-wave-bar:nth-child(57), .cplsr-wave-bar:nth-child(64) { --cplsr-bar-scale: 1.89; }
.cplsr-wave-bar:nth-child(58), .cplsr-wave-bar:nth-child(63) { --cplsr-bar-scale: 1.92; }
.cplsr-wave-bar:nth-child(59), .cplsr-wave-bar:nth-child(62) { --cplsr-bar-scale: 1.95; }
.cplsr-wave-bar:nth-child(60), .cplsr-wave-bar:nth-child(61) { --cplsr-bar-scale: 1.98; }

/* Animación: solo cuando está reproduciendo, la onda respira un poco más. */
.cplsr-is-playing .cplsr-wave-bar {
  animation: cplsr-wave 1.3s ease-in-out infinite;
}

.cplsr-is-playing .cplsr-wave-bar:nth-child(2n) {
  animation-duration: 1.05s;
}

.cplsr-is-playing .cplsr-wave-bar:nth-child(3n) {
  animation-duration: 1.6s;
}

@keyframes cplsr-wave {
  0%, 100% {
    transform: scaleY(calc(0.25 + var(--cplsr-bar-scale) * 0.35));
  }
  50% {
    transform: scaleY(calc(0.40 + var(--cplsr-bar-scale) * 0.55));
  }
}

/* Controls */

.cplsr-player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.cplsr-btn-play {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: var(--cplsr-primary) !important;
  color: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.45);
  background-image: none !important;
}

.cplsr-btn-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.5);
}

.cplsr-btn-play:active {
  transform: translateY(0);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
}

.cplsr-btn-play:focus,
.cplsr-btn-play:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18), 0 16px 36px rgba(15, 23, 42, 0.45);
}

.cplsr-icon {
  display: block;
}

.cplsr-icon-play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 3px;
}

.cplsr-icon-pause {
  position: relative;
  width: 14px;
  height: 18px;
}

.cplsr-icon-pause::before,
.cplsr-icon-pause::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 2px;
  background-color: #ffffff;
}

.cplsr-icon-pause::before {
  left: 0;
}

.cplsr-icon-pause::after {
  right: 0;
}

/* Volume slider */

.cplsr-volume {
  flex: 1;
}

.cplsr-volume-range {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 999px;
  background-color: var(--cplsr-timeline);
  outline: none;
}

.cplsr-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--cplsr-toggle, var(--cplsr-primary));
  cursor: pointer;
}

.cplsr-volume-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--cplsr-toggle, var(--cplsr-primary));
  cursor: pointer;
}

/* Responsive */

@media (max-width: 480px) {
  .cplsr-player {
    padding: 12px 14px;
  }

  .cplsr-player-title {
    max-width: 140px;
  }
}


/* Toggle button for floating player */
.cplsr-btn-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  box-sizing: border-box;
}

.cplsr-btn-floating-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transform: translateX(0);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

/* Active state when player is floating */
.cplsr-player-wrapper.cplsr-player--floating .cplsr-btn-floating {
  background-color: var(--cplsr-toggle, var(--cplsr-primary));
  border-color: var(--cplsr-toggle, var(--cplsr-primary));
}

.cplsr-player-wrapper.cplsr-player--floating .cplsr-btn-floating-icon {
  transform: translateX(18px);
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

