/* RadioFusion Web : interface d'application. Couleurs reglables via les variables --rf-* */
.rf-web {
    --rf-bg: #0f1420;
    --rf-bar: #141a29;
    --rf-panel: #181f30;
    --rf-row: #1f2739;
    --rf-row-hover: #263049;
    --rf-text: #e8ecf5;
    --rf-muted: #8f9bb3;
    --rf-accent: #3d7ee8;
    --rf-accent-soft: #26345a;
    --rf-star: #f2c230;
    --rf-line: rgba(255, 255, 255, .07);
    display: flex;
    flex-direction: column;
    height: var(--rf-height, 640px);
    max-width: 1040px;
    margin: 1.5rem auto;
    background: var(--rf-bg);
    color: var(--rf-text);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--rf-line);
    box-shadow: 0 18px 50px rgba(11, 27, 51, .28);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}
.rf-web *, .rf-web *::before, .rf-web *::after { box-sizing: border-box; }
.rf-web button, .rf-web input { font: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; margin: 0; }
.rf-web svg { display: block; }

/* Barre d'application */
.rf-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--rf-bar); border-bottom: 1px solid var(--rf-line); }
.rf-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.rf-web .rf-brand img { display: block; width: 32px; height: 32px; margin: 0; border-radius: 8px; }
.rf-search { flex: 1; max-width: 360px; margin-left: auto; position: relative; display: block; }
.rf-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; stroke: var(--rf-muted); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.rf-web .rf-search input {
    width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--rf-line); border-radius: 10px;
    background: var(--rf-row); color: var(--rf-text); -webkit-appearance: none; appearance: none;
}
.rf-web .rf-search input::placeholder { color: var(--rf-muted); opacity: 1; }
.rf-web .rf-search input:focus { outline: 2px solid var(--rf-accent); outline-offset: 0; }

/* Bouton « fenetre » et mode fenetre autonome */
.rf-web .rf-popout { flex: none; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; background: var(--rf-accent); color: #fff; text-decoration: none; border: 0; cursor: pointer; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.rf-web .rf-popout[hidden] { display: none; }
.rf-web .rf-popout:hover { background: #4d8bf0; color: #fff; }
.rf-popout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rf-search { margin-left: auto; }
.rf-web.rf-full { width: 100%; max-width: none; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 720px) { .rf-web.rf-full { max-width: none; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; } .rf-web.rf-full .rf-main { flex: 1; min-height: 0; } .rf-web.rf-full .rf-list-pane { max-height: none; flex: 1; } }

.rf-web { position: relative; }
.rf-moved { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(15, 20, 32, .96); text-align: center; padding: 20px; }
.rf-moved p { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--rf-text); }

/* Corps */
.rf-main { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); flex: 1; min-height: 0; }
.rf-list-pane { display: flex; flex-direction: column; min-height: 0; padding: 14px; background: var(--rf-panel); border-right: 1px solid var(--rf-line); }
.rf-tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: var(--rf-bg); border-radius: 12px; }
.rf-web .rf-tab { flex: 1; padding: 9px 8px; border: 0; border-radius: 9px; cursor: pointer; background: none; color: var(--rf-muted); font-weight: 600; }
.rf-web .rf-tab:hover { color: var(--rf-text); }
.rf-web .rf-tab.is-active { background: var(--rf-accent); color: #fff; }
.rf-tab span { opacity: .75; font-weight: 400; margin-left: 4px; }

.rf-web .rf-list { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #39435e transparent; }
.rf-web .rf-item { display: flex; align-items: center; gap: 4px; margin: 0 0 6px; padding: 0; background: var(--rf-row); border-radius: 12px; border: 1px solid transparent; }
.rf-web .rf-item:hover { background: var(--rf-row-hover); }
.rf-web .rf-item.is-current { background: var(--rf-accent-soft); border-color: rgba(61, 126, 232, .55); }
.rf-web .rf-pick { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.rf-web .rf-pick:focus-visible, .rf-web .rf-star:focus-visible, .rf-web .rf-tab:focus-visible,
.rf-web .rf-ctl:focus-visible, .rf-web .rf-play:focus-visible { outline: 3px solid var(--rf-accent); outline-offset: 2px; }
.rf-mini { width: 40px; height: 40px; padding: 8px 3px; flex: none; fill: var(--rf-muted); }
.rf-item.is-current .rf-mini { fill: #9db8ee; }
.rf-texts { min-width: 0; display: flex; flex-direction: column; }
.rf-item-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-item-genre { font-size: .8rem; color: var(--rf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-eq { display: none; flex: none; align-items: flex-end; gap: 2px; height: 14px; margin-right: 2px; }
.rf-eq i { display: block; width: 3px; background: var(--rf-accent); border-radius: 1px; height: 30%; }
.rf-web.is-playing .rf-item.is-current .rf-eq { display: flex; }
.rf-web.is-playing .rf-eq i { animation: rf-eq 0.9s ease-in-out infinite; }
.rf-eq i:nth-child(2) { animation-delay: .2s; } .rf-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes rf-eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.rf-web .rf-star { flex: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 0; display: grid; place-items: center; }
.rf-star svg { width: 22px; height: 22px; fill: none; stroke: #6b7490; stroke-width: 1.8; stroke-linejoin: round; }
.rf-star:hover svg { stroke: var(--rf-star); }
.rf-star.is-on svg { fill: var(--rf-star); stroke: var(--rf-star); }
.rf-empty { padding: 22px 12px; color: var(--rf-muted); text-align: center; list-style: none; }

/* Logos des radios (facultatifs : icone generique a defaut) */
.rf-web .rf-logo { width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; margin: 0; }
.rf-web .rf-radio.has-logo .rf-radio-svg { display: none; }
.rf-web .rf-art-logo { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; margin: 0; padding: 12px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* Panneau de lecture */
.rf-player-pane { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px; text-align: center; background: radial-gradient(120% 80% at 50% 0, #1a2a4d 0, var(--rf-bg) 62%); }
.rf-radio { width: 150px; }
.rf-radio-svg { width: 100%; height: auto; overflow: visible; margin: 0; border-radius: 0; }
.rf-body { fill: #8fa2c4; }
.rf-antenna { stroke: #8fa2c4; stroke-width: 4; stroke-linecap: round; }
.rf-knob, .rf-screen, .rf-dot { fill: #0f1420; }
.rf-waves path { fill: none; stroke: var(--rf-accent); stroke-width: 5; stroke-linecap: round; opacity: .25; }
.rf-web.is-playing .rf-waves path { animation: rf-pulse 1.2s infinite; }
.rf-web.is-playing .rf-waves path:nth-child(2) { animation-delay: .25s; }
.rf-web.is-playing .rf-waves path:nth-child(3) { animation-delay: .5s; }
@keyframes rf-pulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.rf-web .rf-name { margin: 6px 0 0; padding: 0; font-size: 1.6rem; line-height: 1.2; font-weight: 800; color: var(--rf-text); letter-spacing: -.01em; }
.rf-web .rf-genre { display: inline-block; min-height: 1.4em; margin: 0; padding: 2px 12px; border-radius: 99px; background: var(--rf-accent-soft); color: #8fb2f5; font-size: .85rem; }
.rf-genre:empty { visibility: hidden; }
.rf-web .rf-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 4px; min-height: 1.4em; color: var(--rf-muted); }
.rf-web.is-playing .rf-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; animation: rf-live 1.4s infinite; }
@keyframes rf-live { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.rf-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 4px; }
.rf-web .rf-ctl { width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: var(--rf-row); color: var(--rf-text); cursor: pointer; display: grid; place-items: center; }
.rf-web .rf-ctl:hover { background: var(--rf-row-hover); }
.rf-ctl svg { width: 22px; height: 22px; fill: currentColor; }
.rf-web .rf-play { width: 70px; height: 70px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--rf-accent); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(61, 126, 232, .45); }
.rf-web .rf-play:hover { background: #4d8bf0; }
.rf-play svg { width: 30px; height: 30px; fill: currentColor; }
.rf-web .rf-play:disabled { opacity: .45; cursor: default; box-shadow: none; }
.rf-volume { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rf-volume .rf-ctl { width: 38px; height: 38px; }
.rf-volume .rf-ctl svg { width: 19px; height: 19px; }
.rf-web .rf-volume input { width: 150px; accent-color: var(--rf-accent); padding: 0; }
.rf-web .rf-note { margin: 16px 0 0; max-width: 380px; font-size: .74rem; color: var(--rf-muted); }

@media (max-width: 720px) {
    .rf-web { height: auto; }
    .rf-main { display: flex; flex-direction: column; }
    .rf-player-pane { order: 1; padding: 18px 16px; }
    .rf-list-pane { order: 2; max-height: 440px; border-right: 0; border-top: 1px solid var(--rf-line); }
    .rf-radio { width: 104px; }
    .rf-web .rf-name { font-size: 1.35rem; }
    .rf-search { max-width: none; }
    .rf-brand span { display: none; }
    .rf-popout-label { display: none; }
    .rf-web .rf-popout { padding: 0; width: 38px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .rf-web.is-playing .rf-waves path, .rf-web.is-playing .rf-eq i, .rf-web.is-playing .rf-status::before { animation: none; }
    .rf-web.is-playing .rf-waves path { opacity: .8; }
    .rf-eq i { height: 70%; }
}

/* Bouton [radiofusion_lien] */
.rf-linkbtn { display: inline-block; padding: 12px 22px; border-radius: 12px; background: #3d7ee8; color: #fff !important; font-weight: 700; text-decoration: none !important; box-shadow: 0 6px 18px rgba(61, 126, 232, .35); }
.rf-linkbtn:hover { background: #4d8bf0; }

/* Dans la fenetre separee ou l'application installee : plein espace (2 colonnes des 721 px de large) */
.rf-web.rf-full.is-window { max-width: none; width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }

/* Pochette de l'album : prend la place du logo, avec le logo de la radio en petit badge */
.rf-web .rf-radio { position: relative; }
.rf-web .rf-art-cover { padding: 0; object-fit: cover; animation: rf-cover-in .5s ease both; }
.rf-web .rf-art-badge { position: absolute; right: -10px; bottom: -10px; width: 46px; height: 46px; margin: 0; padding: 3px; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); animation: rf-cover-in .5s ease both; }
@media (prefers-reduced-motion: reduce) { .rf-web .rf-art-cover, .rf-web .rf-art-badge { animation: none; } }

/* Bouton de don */
.rf-web .rf-don { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--rf-line); color: var(--rf-text); text-decoration: none; font-size: .85rem; font-weight: 600; }
.rf-web .rf-don:hover, .rf-web .rf-don:focus-visible { background: rgba(229, 72, 77, .18); border-color: rgba(229, 72, 77, .55); color: #fff; }
.rf-don svg { width: 16px; height: 16px; fill: #e5484d; }
.rf-web.rf-kiosk .rf-don { display: none; }
.rf-web .rf-don + .rf-credit { margin-top: 10px; }

/* Petit rappel discret sur le bouton de don : le coeur bat et un halo passe, de temps en temps */
.rf-web .rf-don.is-nudge { animation: rf-don-halo 1.4s ease-out 1; }
.rf-web .rf-don.is-nudge svg { animation: rf-heart 1.1s ease-in-out 1; }
@keyframes rf-heart { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.4); } 30% { transform: scale(1); } 45% { transform: scale(1.3); } 60% { transform: scale(1); } }
@keyframes rf-don-halo { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); } 100% { box-shadow: 0 0 0 16px rgba(229, 72, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .rf-web .rf-don.is-nudge, .rf-web .rf-don.is-nudge svg { animation: none; } }

/* Titre en cours */
.rf-web .rf-now { max-width: 92%; margin: 4px 0 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 1rem; font-weight: 600; color: var(--rf-text); line-height: 1.3; text-align: left; }
.rf-now > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rf-web .rf-cover { flex: none; width: 56px; height: 56px; margin: 0; border-radius: 8px; object-fit: cover; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); animation: rf-cover-in .5s ease both; }
.rf-web .rf-cover[hidden] { display: none; }
@keyframes rf-cover-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rf-web .rf-cover { animation: none; } }
.rf-cast svg { fill: none !important; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rf-web .rf-cast[hidden], .rf-web .rf-sink[hidden] { display: none; }
.rf-web .rf-toast { position: absolute; left: 50%; bottom: 22px; z-index: 8; max-width: min(86%, 380px); padding: 11px 18px; border-radius: 14px; background: #263049; color: var(--rf-text); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); font-size: .9rem; line-height: 1.35; text-align: center; cursor: pointer; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.rf-web .rf-toast.is-shown { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .rf-web .rf-toast { transition: none; } }
.rf-sink svg { fill: none !important; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rf-web .rf-sink.is-on { background: var(--rf-accent-soft); color: #9db8ee; }
@media (max-width: 420px) { .rf-web .rf-volume { gap: 6px; } .rf-web .rf-volume input { width: 90px; } }
.rf-web .rf-now[hidden] { display: none; }
.rf-web.rf-kiosk .rf-now { font-size: 1.15rem; }

/* Minuteur d'arret */
.rf-volume { position: relative; }
.rf-web .rf-timer-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--rf-row); color: var(--rf-muted); cursor: pointer; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.rf-web .rf-timer-btn:hover { background: var(--rf-row-hover); color: var(--rf-text); }
.rf-web .rf-timer-btn.is-on { background: var(--rf-accent-soft); color: #9db8ee; }
.rf-web .rf-timer-btn.is-fading { animation: rf-blink 1s steps(2, start) infinite; background: var(--rf-accent); color: #fff; }
@keyframes rf-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rf-web .rf-timer-btn.is-fading { animation: none; } }
.rf-timer-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rf-web .rf-timer-btn:focus-visible, .rf-web .rf-timer-menu button:focus-visible { outline: 3px solid var(--rf-accent); outline-offset: 2px; }
.rf-timer-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 6; min-width: 190px; max-height: 55vh; overflow-y: auto; scrollbar-width: thin; padding: 6px; background: var(--rf-panel); border: 1px solid var(--rf-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); text-align: left; }
.rf-timer-menu[hidden] { display: none; }
.rf-web .rf-timer-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--rf-text); text-align: left; cursor: pointer; }
.rf-web .rf-timer-menu button:hover { background: var(--rf-row-hover); }
.rf-web .rf-timer-menu .rf-timer-off { color: var(--rf-muted); border-top: 1px solid var(--rf-line); border-radius: 0 0 8px 8px; margin-top: 4px; }
@media (max-width: 420px) { .rf-web .rf-volume input { width: 110px; } }

/* Mode discret : plein ecran, logo et commandes seulement (radio d'ambiance en boutique, cabinet, bureau) */
.rf-web .rf-popout.rf-ghost { background: var(--rf-row); color: var(--rf-text); }
.rf-web .rf-popout.rf-ghost:hover { background: var(--rf-row-hover); color: var(--rf-text); }
.rf-web.rf-kiosk { max-width: none; }
.rf-web.rf-kiosk .rf-bar { justify-content: flex-end; background: transparent; border-bottom: 0; }
.rf-web.rf-kiosk .rf-brand, .rf-web.rf-kiosk .rf-search, .rf-web.rf-kiosk .rf-popout:not(.rf-ghost) { display: none; }
.rf-web.rf-kiosk .rf-popout.rf-ghost { opacity: .55; }
.rf-web.rf-kiosk .rf-popout.rf-ghost:hover, .rf-web.rf-kiosk .rf-popout.rf-ghost:focus-visible { opacity: 1; }
.rf-web.rf-kiosk .rf-main { display: flex; flex-direction: column; }
.rf-web.rf-kiosk .rf-list-pane { display: none; }
.rf-web.rf-kiosk .rf-player-pane { flex: 1; order: 0; gap: 8px; padding: 6px 16px 12px; min-height: 0; }
.rf-web.rf-kiosk .rf-radio { width: min(23vh, 320px, 70vw); }
.rf-web.rf-kiosk .rf-name { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.rf-web.rf-kiosk .rf-note { display: none; }
.rf-web.rf-kiosk:fullscreen { height: 100vh; border-radius: 0; margin: 0; }

.rf-web .rf-credit{margin:14px 0 0;font-size:12px;line-height:1.4;color:#7d8aa3;text-align:center}
.rf-web .rf-credit a{color:#9db4dd;text-decoration:none}
.rf-web .rf-credit a:hover,.rf-web .rf-credit a:focus{text-decoration:underline}

/* Telephone : lecteur compact pour que la liste des radios reste visible dessous */
@media (max-width: 720px) {
    .rf-web .rf-note { display: none; }
    .rf-web .rf-radio { width: 76px; }
    .rf-web .rf-player-pane { padding: 12px 14px; gap: 4px; }
    .rf-web .rf-name { font-size: 1.2rem; margin: 2px 0 0; }
    .rf-web .rf-status { margin: 2px 0; min-height: 1.2em; }
    .rf-web .rf-controls { margin-top: 0; gap: 16px; }
    .rf-web .rf-play { width: 60px; height: 60px; }
    .rf-web .rf-controls .rf-ctl { width: 42px; height: 42px; }
    .rf-web .rf-volume { margin-top: 2px; }
    .rf-web .rf-don { margin-top: 8px; padding: 6px 14px; }
    .rf-web .rf-credit { margin: 6px 0 0; }
    .rf-web .rf-list-pane { min-height: 260px; padding: 10px 12px; }
    .rf-web .rf-tabs { margin-bottom: 8px; }
    .rf-web .rf-art-badge { width: 32px; height: 32px; right: -8px; bottom: -8px; border-radius: 9px; }
    .rf-web .rf-now { margin: 2px 0 0; font-size: .92rem; }
    .rf-web.rf-full { overflow-y: auto; }
}
@media (max-width: 720px) and (max-height: 820px) {
    .rf-web .rf-genre { display: none; }
}
