/* ================================================================
   LÉGENDE FM — STICKY PLAYER
   ================================================================ */

/* Décalage du contenu pour ne pas masquer le bas de page */
body { padding-bottom: 76px !important; }
.admin-bar body { padding-bottom: 76px !important; }

/* ── BARRE DE PROGRESSION (navigation AJAX) ─────────────────── */
#lfm-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #5DBBFA, #E91E63);
    z-index: 99999;
    transition: width 0.25s ease, opacity 0.4s ease;
    pointer-events: none;
}

#lfm-progress.done { width: 100% !important; opacity: 0; }

/* ── CONTENEUR PRINCIPAL ────────────────────────────────────── */
#lfm-player {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 72px;
    background: #1a2a3a;
    border-top: 1px solid rgba(93, 187, 250, 0.30);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.55);
    z-index: 9999;
    /* Trait cyan en haut */
    background-image: linear-gradient(
        to bottom,
        rgba(93,187,250,0.18) 0px,
        rgba(93,187,250,0) 3px
    ), none;
    background-color: #1a2a3a;
}

/* Barre de progression du flux au chargement */
#lfm-player::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #5DBBFA 0%, #E91E63 100%);
    transition: width 0.6s ease;
    z-index: 1;
}

#lfm-player.loading::before {
    animation: lfm-loading-bar 1.2s ease-in-out infinite;
}

@keyframes lfm-loading-bar {
    0%   { left: 0;    width: 0%;   opacity: 1; }
    40%  { left: 0;    width: 65%;  opacity: 1; }
    60%  { left: 20%;  width: 65%;  opacity: 1; }
    100% { left: 100%; width: 0%;   opacity: 0; }
}

.lfm-player-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 20px;
}

/* ── LOGO ───────────────────────────────────────────────────── */
.lfm-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-right: 20px;
}

.lfm-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 4px;
}

.lfm-logo-name {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255,255,255,0.90);
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lfm-logo-name strong { font-weight: 800; color: #5DBBFA; }

/* Badge EN DIRECT inline */
.lfm-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.55);
    vertical-align: middle;
    line-height: 1;
}

.lfm-live-dot-inner {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
    transition: background 0.3s;
}

#lfm-player.playing .lfm-live-dot-inner {
    background: #E91E63;
    box-shadow: 0 0 6px #E91E63;
    animation: lfm-blink 1.4s ease-in-out infinite;
}

@keyframes lfm-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.lfm-logo-freq {
    font-size: 0.66rem;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── POCHETTE ALBUM (sticky player) ─────────────────────────── */
.lfm-player-cover {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    display: none;
    margin-left: 0;
    margin-right: 12px;
}

/* ── BOUTON PLAY/PAUSE ──────────────────────────────────────── */
.lfm-controls {
    flex-shrink: 0;
    margin-right: 28px;
}

.lfm-play-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: #5DBBFA;
    color: #1a2a3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s, transform 0.18s, box-shadow 0.22s;
    position: relative;
    outline: none;
}

.lfm-play-btn:hover {
    background: #8ECFFC;
    transform: scale(1.07);
    box-shadow: 0 0 20px rgba(93,187,250,0.50);
}

.lfm-play-btn:active { transform: scale(0.96); }

.lfm-play-btn svg {
    width: 24px; height: 24px;
    position: absolute;
    transition: opacity 0.18s, transform 0.18s;
}

/* États des icônes */
.lfm-play-btn .icon-play  { opacity: 1;  transform: scale(1);    }
.lfm-play-btn .icon-pause { opacity: 0;  transform: scale(0.7);  }
.lfm-play-btn .icon-spin  { opacity: 0;  transform: scale(0.8);  animation: none; }

#lfm-player.playing .lfm-play-btn .icon-play  { opacity: 0;  transform: scale(0.7); }
#lfm-player.playing .lfm-play-btn .icon-pause { opacity: 1;  transform: scale(1);   }
#lfm-player.playing .lfm-play-btn .icon-spin  { opacity: 0; }

#lfm-player.loading .lfm-play-btn .icon-play  { opacity: 0; }
#lfm-player.loading .lfm-play-btn .icon-pause { opacity: 0; }
#lfm-player.loading .lfm-play-btn .icon-spin  {
    opacity: 1;
    transform: scale(1);
    animation: lfm-spin 0.9s linear infinite;
}

#lfm-player.loading .lfm-play-btn {
    background: rgba(93,187,250,0.6);
    cursor: wait;
}

@keyframes lfm-spin { to { transform: rotate(360deg); } }

/* ── VISUALISEUR (standalone) ───────────────────────────────── */
/* ── INFO PISTE ─────────────────────────────────────────────── */
.lfm-track-text {
    flex: 1;
    min-width: 0;
    margin: 0 20px;
}

/* Visualiseur audio (barres CSS animées) */
.lfm-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    flex-shrink: 0;
    margin-right: 12px;
}

.lfm-visualizer span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: #5DBBFA;
    height: 4px;
    transition: background 0.3s;
}

/* Animation uniquement quand lecture en cours */
#lfm-player.playing .lfm-visualizer span:nth-child(1) { animation: lfm-bar 0.9s  ease-in-out 0.0s infinite alternate; }
#lfm-player.playing .lfm-visualizer span:nth-child(2) { animation: lfm-bar 0.7s  ease-in-out 0.1s infinite alternate; }
#lfm-player.playing .lfm-visualizer span:nth-child(3) { animation: lfm-bar 1.0s  ease-in-out 0.2s infinite alternate; }
#lfm-player.playing .lfm-visualizer span:nth-child(4) { animation: lfm-bar 0.75s ease-in-out 0.05s infinite alternate; }
#lfm-player.playing .lfm-visualizer span:nth-child(5) { animation: lfm-bar 0.85s ease-in-out 0.15s infinite alternate; }

@keyframes lfm-bar {
    from { height: 4px;  opacity: 0.6; }
    to   { height: 24px; opacity: 1;   }
}

/* .lfm-track-text defined above as standalone flex item */

.lfm-track-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lfm-track-sub {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.48);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ── SÉLECTEUR DE FLUX ──────────────────────────────────────── */
.lfm-quality {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-right: 20px;
}

.lfm-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
}

.lfm-select {
    appearance: none;
    background: rgba(255,255,255,0.07)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%235DBBFA' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E")
        no-repeat right 10px center;
    border: 1px solid rgba(93,187,250,0.28);
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 28px 6px 10px;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.lfm-select:hover, .lfm-select:focus {
    border-color: #5DBBFA;
    background-color: rgba(93,187,250,0.12);
}

.lfm-select option { background: #1a2a3a; color: #fff; }

/* ── VOLUME ─────────────────────────────────────────────────── */
.lfm-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lfm-mute-btn {
    width: 34px; height: 34px;
    border: none !important;
    border-radius: 8px;
    background: transparent !important;
    color: rgba(255,255,255,0.70);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    outline: none;
    flex-shrink: 0;
}

.lfm-mute-btn:hover { background: rgba(93,187,250,0.15); color: #5DBBFA; }
.lfm-mute-btn svg { width: 20px; height: 20px; }
.lfm-mute-btn i { font-size: 18px; color: rgba(255,255,255,0.7); }

.lfm-mute-btn .icon-vol-off { display: none; }
#lfm-player.muted .lfm-mute-btn .icon-vol-on  { display: none; }
#lfm-player.muted .lfm-mute-btn .icon-vol-off { display: inline; }

/* Slider de volume */
.lfm-volume-wrap { width: 88px; }

.lfm-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #5DBBFA var(--vol, 80%), rgba(255,255,255,0.15) var(--vol, 80%));
    border-radius: 2px;
    outline: none;
    border: none;
    cursor: pointer;
}

.lfm-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: #5DBBFA;
    cursor: pointer;
    box-shadow: none;
    border: none;
}

.lfm-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #5DBBFA;
    cursor: pointer;
    box-shadow: none;
    border: none;
}

.lfm-volume-slider::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    height: 4px;
    border-radius: 2px;
}

.lfm-volume-slider::-moz-range-track {
    background: rgba(255,255,255,0.15);
    border: none;
    height: 4px;
    border-radius: 2px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .lfm-quality { display: none; }
    .lfm-logo { margin-right: 12px; }
    .lfm-logo-freq { display: none; }
    .lfm-volume-wrap { width: 70px; }
}

@media (max-width: 640px) {
    #lfm-player { height: 64px; }
    body { padding-bottom: 64px !important; }
    .lfm-play-btn { width: 44px; height: 44px; }
    .lfm-play-btn svg { width: 20px; height: 20px; }
    .lfm-volume-wrap { width: 60px; }
    .lfm-track-text { margin: 0 12px; }
    .lfm-visualizer { display: none; }
    .lfm-controls { margin-right: 12px; }
    .lfm-player-cover { display: none !important; }
}

@media (max-width: 420px) {
    .lfm-logo-text { display: none; }
    .lfm-logo { margin-right: 8px; }
}
