/* =========================
   GLOBAL
========================= */

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;

    background:
        radial-gradient(circle at 30% 30%, rgba(120, 0, 255, 0.15), transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(255, 0, 80, 0.12), transparent 40%),
        #0b0b0f;

    animation: bgMove 25s ease-in-out infinite alternate;
}

@keyframes bgMove {
    0% {
        background-position: 0% 0%, 100% 100%;
    }

    100% {
        background-position: 20% 10%, 80% 90%;
    }
}

/* =========================
   CONTAINER
========================= */

.container {
    text-align: center;
    background: #111;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.2);
    transition: 0.4s ease;
}

.container.live-mode {
    box-shadow:
        0 0 60px rgba(255, 50, 120, 0.35),
        0 0 140px rgba(255, 0, 150, 0.12);
}

/* =========================
   TITRE LIVE (PRÉSENCE STABLE)
========================= */

.container.live-mode h1 {
    text-shadow:
        0 0 12px rgba(255, 0, 90, 0.7),
        0 0 28px rgba(255, 0, 120, 0.5),
        0 0 45px rgba(255, 0, 150, 0.22);
}

/* =========================
   AUDIO & STATUS
========================= */

#radio-status,
#liveStatus {
    min-height: 22px;
}

audio {
    width: 100%;
    margin: 15px 0;
}

/* =========================
   led en live
========================= */
.live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    transition: 0.3s ease;
}

/* OFF = LED vitrée sombre */
.live-dot.off {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 45, 45, 0.15), rgba(0, 0, 0, 0.5));
    border: 1px solid rgba(255, 45, 45, 0.35);
    box-shadow:
        inset 0 0 4px rgba(0, 0, 0, 0.6),
        0 0 4px rgba(0, 0, 0, 0.5);
}

/* LIVE */
.live-dot.active {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 40%),
        #ff2d2d;
    border: 1px solid #ff2d2d;
    box-shadow:
        0 0 8px rgba(255, 45, 45, 0.9),
        0 0 18px rgba(255, 45, 45, 0.6);
    animation: livePulsePublic 1.4s infinite ease-in-out;
}

@keyframes livePulsePublic {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* =========================
   BOUTON PLAY HARMONISÉ
========================= */

#playBtn {
    margin-top: 15px;
    padding: 14px 30px;
    border-radius: 50px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6a00ff, #c400ff);
    color: white;

    box-shadow:
        0 0 12px rgba(138, 43, 226, 0.6),
        0 0 25px rgba(196, 0, 255, 0.35);
}

#playBtn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    pointer-events: none;
}

#playBtn.playing::after {
    animation: shineMove 4s infinite ease-in-out;
}

@keyframes shineMove {
    0% {
        left: -100%;
    }

    50% {
        left: 130%;
    }

    100% {
        left: -100%;
    }
}

#playBtn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 18px rgba(138, 43, 226, 0.8),
        0 0 35px rgba(196, 0, 255, 0.45);
}

#playBtn:active {
    transform: scale(0.96);
}

#playBtn.playing {
    background: linear-gradient(135deg, #5f00d4, #8a2be2);
    box-shadow:
        inset 0 0 6px rgba(255, 255, 255, 0.15),
        0 0 15px rgba(138, 43, 226, 0.7),
        0 0 30px rgba(138, 43, 226, 0.35);
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    }

    50% {
        box-shadow: 0 0 18px rgba(138, 43, 226, 0.75);
    }

    100% {
        box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    }
}

#playBtn.playing {
    animation: glowPulse 3.5s infinite ease-in-out;
}

/* =========================
   MODE LIVE - PLAY BUTTON
========================= */

.container.live-mode #playBtn.playing {
    background: linear-gradient(135deg, #8a003f, #ff007a);
    box-shadow:
        inset 0 0 8px rgba(255, 255, 255, 0.2),
        0 0 20px rgba(255, 0, 120, 0.7),
        0 0 45px rgba(255, 0, 150, 0.4);
}

/* =========================
   LISTENERS
========================= */

.stats {
    margin-top: 22px;
    font-size: 14px;
    opacity: 0.9;
}

.listeners-label {
    opacity: 0.7;
    letter-spacing: 0.4px;
}

.separator {
    opacity: 0.3;
    margin: 0 4px;
}

.listeners-count {
    font-size: 18px;
    font-weight: 700;
    color: #ff00aa;
    text-shadow:
        0 0 6px rgba(255, 0, 170, 0.6),
        0 0 12px rgba(255, 0, 170, 0.4);
}

.listeners-count.bump {
    animation: bump 0.4s ease;
}

.ear {
    opacity: 0.6;
}

@keyframes bump {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* =========================
   LIVE MODE STATS
========================= */

.stats {
    margin-top: 25px;
    text-align: center;
}

.live-line {
    font-size: 14px;
    opacity: 0.85;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.live-text {
    font-weight: 600;
}

.listeners-line {
    font-size: 16px;
}

.listeners-count {
    font-size: 22px;
    font-weight: 700;
    color: #ff00aa;
    text-shadow:
        0 0 6px rgba(255, 0, 170, 0.6),
        0 0 14px rgba(255, 0, 170, 0.5);
}

.listeners-dynamic {
    margin-left: 6px;
    opacity: 0.8;
}

/* animation quand ça change */
.listeners-count.bump {
    animation: bump 0.4s ease;
}

/* =========================
   LIVE BADGE
========================= */

.live-badge {
    display: none;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px red;
}

.live-badge.active {
    display: inline-block;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================
   VU METER
========================= */

.vu-container {
    width: 100%;
    height: 100px;
    margin-top: 15px;
}

#vuMeter {
    width: 100%;
    height: 100%;
}

/* =========================
   PUSH BUTTON
========================= */

.push-btn {
    margin-top: 15px;
    padding: 12px 22px;
    border-radius: 30px;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.25s ease;
    background: linear-gradient(135deg, #7b2cff, #d1006b);
}

.push-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(209, 0, 107, 0.5);
}

.push-btn.subscribed {
    background: linear-gradient(135deg, #6a00ff, #a000ff);
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.08),
        0 0 20px rgba(160, 0, 255, 0.6);
    transform: scale(0.98);
}

.push-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   ADMIN
========================= */

.admin-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #222;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: .2s;
}

.admin-btn:hover {
    transform: translateY(-1px);
}

.secret-admin {
    position: fixed;
    bottom: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(138, 43, 226, 0.15);
    box-shadow: 0 0 6px rgba(138, 43, 226, 0.25);
    transition: 0.2s ease;
    opacity: 0.2;
}

.secret-admin:hover {
    background: rgba(138, 43, 226, 0.6);
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.8);
    opacity: 1;
}

/* =========================
   PUSH STATUS
========================= */

.push-status {
    margin-top: 12px;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: rgba(180, 0, 255, 0.7);
}

.push-status.subscribed {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

.push-status.unsubscribed {
    color: rgba(255, 0, 140, 0.7);
}

.push-status .checkmark {
    margin-left: 6px;
    font-weight: bold;
    color: #00ffcc;
}

/* =========================
   PUSH STATUS (DEBUG)
========================= */

.push-debug {
    margin-top: 10px;
    font-size: 13px;
    letter-spacing: 0.4px;
    transition: 0.2s ease;
}

/* NON ABONNÉ */
.push-debug.unsubscribed {
    color: rgba(255, 0, 140, 0.7);
}

/* ABONNÉ */
.push-debug.subscribed {
    color: #a000ff;
    text-shadow: 0 0 8px rgba(160, 0, 255, 0.6);
}

.push-check {
    display: none;
    cursor: pointer;
    margin-top: 6px;
    /* ← ajoute ça */
    font-size: 18px;
    color: #00ffd5;
    transition: 0.2s ease;
}

.push-zone {
    margin-top: 18px;
    text-align: center;
}

/* =========================
   NAVIGATOR STATUS
========================= */

.navigator-status {
    margin-top: 10px;
    font-size: 13px;
    letter-spacing: 0.4px;
    transition: 0.2s ease;
}

/* Non abonné */
.navigator-status.unsubscribed {
    color: rgba(255, 0, 140, 0.7);
}

/* Abonné */
.navigator-status.subscribed {
    color: #a000ff;
    text-shadow: 0 0 8px rgba(160, 0, 255, 0.6);
}

/* Petit check */
.navigator-status .checkmark {
    margin-left: 6px;
    color: #00ffcc;
    text-shadow: 0 0 6px rgba(0, 255, 204, 0.6);
}

#player {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.refresh-btn {
    margin-top: 10px;
    background: transparent;
    border: 1px solid #a020f0;
    color: #a020f0;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
}

.refresh-btn:hover {
    opacity: 1;
}

.volume-wrapper {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.vol-icon {
    font-size: 14px;
    opacity: 0.7;
}

/* Base */
#volumeSlider {
    appearance: none;
    /* Standard */
    -webkit-appearance: none;
    /* Chrome / Safari */
    width: 140px;
    height: 4px;
    border-radius: 10px;
    background: linear-gradient(90deg, #6a00ff, #ff008c);
    outline: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

/* Hover glow */
#volumeSlider:hover {
    opacity: 1;
    box-shadow: 0 0 6px #ff00c8;
}

/* Thumb Chrome */
#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 6px #ff00c8;
}

/* Thumb Firefox */
#volumeSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 6px #ff00c8;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #fff;
    font-size: 14px;
    opacity: 0.9;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #ff00c8;
    border-radius: 50%;
    margin: 0 auto 8px;
    animation: spin 0.8s linear infinite;
}

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

.vol-icon {
    font-size: 22px;
    cursor: pointer;
    color: #ff4fd8;
    text-shadow: 0 0 8px rgba(255, 0, 140, 0.6);
    transition: transform 0.2s ease;
}

.vol-icon:hover {
    transform: scale(1.1);
}

.share-title {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.share-indicator {
    font-size: 14px;
    margin-left: 6px;
    color: rgba(255,255,255,0.75); /* blanc discret au repos */
    transition:
        color 0.25s ease,
        transform 0.25s ease,
        text-shadow 0.25s ease;
    animation: shareGlow 9s ease-in-out infinite;
}

/* Flash blanc pur */
@keyframes shareGlow {

    0%, 92%, 100% {
        text-shadow: none;
        opacity: 0.75;
    }

    94% {
        opacity: 1;
        text-shadow:
            0 0 12px rgba(255,255,255,1),
            0 0 25px rgba(255,255,255,1),
            0 0 45px rgba(255,255,255,1),
            0 0 70px rgba(255,255,255,0.9);
    }

    96% {
        text-shadow:
            0 0 8px rgba(255,255,255,0.9),
            0 0 20px rgba(255,255,255,0.8);
    }
}

/* Hover */
.share-title:hover .share-indicator {
    color: #ff2e9f;
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(255, 46, 159, 0.6);
}

/* Effet tactile */
.share-title:active {
    transform: scale(0.98);
}

/* pwa lien du footer */
.pwa-status {
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.pwa-status.clickable {
    cursor: pointer;
}

.pwa-status.clickable:hover {
    opacity: 1;
}

.pwa-status.needs-install {
    animation: installGlow 9s ease-in-out infinite;
}

@keyframes installGlow {

    0%, 92%, 100% {
        text-shadow: none;
    }

    94% {
        text-shadow:
            0 0 10px rgba(255,255,255,1),
            0 0 20px rgba(255,255,255,1),
            0 0 35px rgba(255,255,255,0.9);
    }

    96% {
        text-shadow: none;
    }
}