/* =====================================================
   CONTAINER PLAYER
===================================================== */
#radio-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    z-index: 9999;
}

/* =====================================================
   PLAYER INNER (COLONNE)
===================================================== */
#radio-player .player-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px 18px;
    border-radius: 35px;

    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18),
        rgba(255, 255, 255, 0.06)
    );

    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);

    border: 1px solid rgba(255, 255, 255, 0.25);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 10px 30px rgba(0, 0, 0, 0.3);

    color: white;
}

/* =====================================================
   LIGNE HAUTE (BOUTONS + TEXTE)
===================================================== */
#radio-player .top-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* =====================================================
   POCHETTE
===================================================== */

#radio-player .player-cover {
  max-width: 50px;
  max-height: 50px;
  flex-shrink: 0;
  margin-left: 2px; /* espace après play */
  border-radius: 6px; /* optionnel */
  overflow: hidden;
  background: #000; /* fallback */
}

#radio-player .player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* très important */
  display: block;
}

/* =====================================================
   SVG WAVE
===================================================== */

  .bar {
    transform-origin: bottom;
    transform: scaleY(0.3);
  }

  /* Animation UNIQUEMENT quand .playing est présent */
  .playing .bar {
    animation: bounce 2.0s infinite ease-in-out;
  }

  .playing .b1 { animation-delay: 0s; }
  .playing .b2 { animation-delay: .15s; }
  .playing .b3 { animation-delay: .3s; }
  .playing .b4 { animation-delay: .45s; }
  .playing .b5 { animation-delay: .6s; }

  @keyframes bounce {
    0%   { transform: scaleY(0.3); }
    25%  { transform: scaleY(1); }
    50%  { transform: scaleY(0.5); }
    75%  { transform: scaleY(0.8); }
    100% { transform: scaleY(0.3); }
  }


/* =====================================================
   BOUTONS
===================================================== */
#radio-player button {
    width: 50px;
    height: 50px;
    flex-shrink: 0;

    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    color: white;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

#radio-player button:hover {
    transform: scale(1.12);
    background: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

/* État lecture */
#radio-player button.playing {
    background: rgba(34, 197, 94, 0.35);
    color: #22c55e;
}

.seek-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.seek-btn:disabled:hover {
  opacity: 0.35;
  transform: none;
}
/* =====================================================
   ICÔNES SVG
===================================================== */
#radio-player svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* =====================================================
   TITRE
===================================================== */
#radio-player .title {
    flex: 1;
    text-align: center;

    font-size: 14px;
    opacity: 0.9;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radioMobile {
  display: none; /* caché par défaut (desktop) */
}

@media (max-width: 768px) {
  .radioMobile {
    display: flex;
    justify-content: center; /* centrage horizontal */
    align-items: center;
    width: 100%;
    font-size: 14px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #radio-player .title {
    display: none;
  }
}

/* =====================================================
   TIMER
===================================================== */

.playerTimer {
  display: none;
}
/* =====================================================
   BARRE DE PROGRESSION (EN DESSOUS)
===================================================== */
#radio-player .progress {
    width: 100%;
    height: 3px;

    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    overflow: hidden;
}

/* Barre animée LIVE */
#radio-player .progress-bar {
    display: block;
    height: 100%;
    width: 40%;
    animation-play-state: paused;
    background: linear-gradient(
        90deg,
        rgba(34,197,94,0),
        rgba(34,197,94,0.9),
        rgba(34,197,94,0)
    );

    animation: liveProgress 1.4s linear infinite;
}

@keyframes liveProgress {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(260%); }
}

/* PODCAST */
#radio-player.podcast .progress-bar {
    animation: none;
    transform: translateX(0);
    width: 0%;
    background: #22c55e;
    transition: width 0.25s linear;
}

/* Par défaut (live) */
#radio-player.live .progress {
    cursor: default;
}

/* Podcast = interactif */
#radio-player.podcast .progress {
    cursor: pointer;
}

/* =====================================================
   MOBILE
===================================================== */
@media (max-width: 768px) {

    /* Marge de sécurité page */
    body {
        padding-bottom: 110px;
    }

    /* Player full width */
    #radio-player {
        left: 0;
        transform: none;
        width: 100%;
        padding: 0 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* Player inner */
    #radio-player .player-inner {
        padding: 12px 16px;
        border-radius: 18px;
    }

    /* Ligne haute */
    #radio-player .top-row {
        justify-content: center;
    }

    /* Play plus visible */
    #radio-player button#playBtn {
        width: 54px;
        height: 54px;
    }

    /* Volume masqué */
    #radio-player button[aria-label="Volume down"],
    #radio-player button[aria-label="Volume up"] {
        display: none;
    }

    /* Texte plus compact */
    #radio-player .title {
        font-size: 13px;
        padding: 0 10px;
    }

    .playerTimer {
      display: flex;
      justify-content: center;
    }
}
