/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700;800&display=swap');

/* --- VARIABLES & RESET --- */
:root {
    --primary: #00d2ff;
    --secondary: #ff0055;
    --glass-bg: rgba(20, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: #888;
    --active-lyric: #ffffff;
    --inactive-lyric: rgba(255, 255, 255, 0.3);
    --tidal-blue: #00aaff;
    --limiter-green: #00ff88;
    --bg-dark: #050505;
    --spotify-green: #1DB954;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg-dark);
    height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: center;
    color: white;
    position: relative;
}

/* --- ANDROID TV MODE --- */
body.tv-mode {
    cursor: none; /* Cache la souris */
    font-size: 1.5rem; /* Textes plus gros */
}

body.tv-mode .app-layout {
    width: 100%; height: 100%; border: none; border-radius: 0;
    grid-template-columns: 100px 1fr 400px;
}

/* Focus très visible pour la navigation télécommande */
body.tv-mode *:focus {
    outline: 4px solid var(--primary) !important;
    outline-offset: 4px;
    transform: scale(1.05);
    z-index: 50;
    background: rgba(255, 255, 255, 0.15);
}

body.tv-mode .track-card:focus {
    transform: scale(1.1);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-color: var(--primary);
}

body.tv-mode .nav-item {
    font-size: 32px; /* Icônes sidebar énormes */
    margin: 10px 0;
    padding: 10px;
    border-radius: 50%;
}

body.tv-mode .player-capsule {
    bottom: 40px; width: 90%; height: 120px;
    transform: translateX(-50%) scale(1.1);
}

body.tv-mode .bento-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Cartes plus grosses */
    gap: 30px;
}

body.tv-mode .search-input { font-size: 24px; padding: 20px; }
body.tv-mode .search-btn { font-size: 20px; padding: 15px 30px; }

/* Masquer les éléments inutiles sur TV */
body.tv-mode .vol-slider, 
body.tv-mode .settings-slider { display: none; } /* Le volume est géré par la TV */

body.tv-mode .login-screen { background: rgba(0,0,0,0.9); }
body.tv-mode .login-card { transform: scale(1.2); }


/* --- PAGE TOP 10 HERO --- */
.top10-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.top10-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    background: linear-gradient(to right, #FFD700, #FDB931, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.top10-timer {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.3);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* NOUVEAU : STATS PILLS */
.stat-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    color: #eee;
}
.stat-pill i { color: var(--primary); }

.play-top10-btn {
    background: white;
    color: black;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.play-top10-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}

/* --- BADGES DE CLASSEMENT (TOP 10) --- */
.rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 14px;
    font-weight: 900;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-right-radius: 16px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    z-index: 20; 
    border-right: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #FDB931); color: black; box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
.rank-2 { background: linear-gradient(135deg, #E0E0E0, #BDBDBD); color: black; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.rank-other { background: rgba(0,0,0,0.85); color: white; font-size: 12px; backdrop-filter: blur(10px); }

/* NOUVEAU : VOTE COUNT ON CARD */
.vote-count {
    font-size: 11px;
    color: var(--secondary);
    margin-top: 6px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 0, 85, 0.1);
    padding: 3px 8px;
    border-radius: 10px;
    width: fit-content;
}

/* --- MODE ZEN --- */
body.zen-active .sidebar,
body.zen-active .search-container,
body.zen-active .header-controls,
body.zen-active .main-feed {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.zen-active .app-layout {
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

body.zen-active .right-panel {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 500;
    /* En mode Zen, on s'assure que le panel est transparent */
    background: transparent;
    border: none;
}

body.zen-active .player-capsule {
    opacity: 0.8;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.5s ease;
}
body.zen-active .player-capsule:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ETAT INACTIF (SOURIS IMMOBILE 3S) */
body.zen-active.zen-idle .player-capsule {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(150px) !important; /* Disparait vers le bas */
    pointer-events: none;
}

body.zen-active.zen-idle {
    cursor: none; /* Cache le curseur */
}


/* --- FOND COULEUR DOMINANTE --- */
#ambientBg {
    position: fixed;
    top: -50%; left: -50%; 
    width: 200%; height: 200%;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(150px) brightness(0.5) saturate(2); 
    z-index: 0;
    opacity: 0;
    transition: background-image 1.5s ease-in-out, opacity 1s ease;
    pointer-events: none;
}

/* --- VIGNETTE SOMBRE --- */
#ambientOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, #0a0a0a 90%);
    z-index: 1;
    pointer-events: none;
}

/* --- TRANSITIONS VISUELLES --- */
.smooth-fade { transition: opacity 0.3s ease-in-out; opacity: 1; }
.smooth-fade.fade-out-active { opacity: 0 !important; }

/* --- ORBE 8D --- */
.orbit-orb {
    position: fixed;
    width: 500px; height: 500px; 
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    z-index: 10;
    left: 50%; top: 120%; 
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: top 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 1s ease;
}
.orbit-orb.center-stage { top: 50%; opacity: 1; }
.orbit-orb.orbiting { top: 50%; left: 50%; transform: translate(-50%, -50%); animation: driftAndSpin 10s linear infinite; }
@keyframes driftAndSpin {
    0% { transform: rotate(0deg) translateX(0) rotate(0deg); }
    10% { transform: rotate(36deg) translateX(35vw) rotate(-36deg); }
    100% { transform: rotate(360deg) translateX(35vw) rotate(-360deg); }
}

/* --- LOGIN SCREEN --- */
.login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 10, 0.95);
    z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    backdrop-filter: blur(20px);
}
.login-card {
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    width: 100%; max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}
.login-input {
    width: 100%; padding: 15px; margin: 10px 0;
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 12px; color: white; font-size: 16px; outline: none;
    transition: 0.2s;
}
.login-input:focus { border-color: var(--primary); background: rgba(0,0,0,0.5); }
.login-btn {
    width: 100%; padding: 15px; margin-top: 20px;
    background: var(--primary); color: #000;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 800; cursor: pointer;
    transition: 0.2s;
}
.login-btn:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); }

/* BOUTON SPOTIFY */
.btn-spotify {
    width: 100%; padding: 15px; margin-top: 10px;
    background: var(--spotify-green); color: white;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-spotify:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(29, 185, 84, 0.4); background: #1ed760; }


.login-toggle { margin-top: 20px; color: #888; font-size: 14px; cursor: pointer; }
.login-toggle b { color: var(--primary); }

/* APP LAYOUT - HIDDEN BY DEFAULT */
.app-layout { 
    width: 95%; height: 92%; 
    background: rgba(20, 20, 30, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    /* Display managed by .layout-visible class now */
    display: none; 
    grid-template-columns: 80px 1fr 350px; gap: 20px; position: relative; 
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    z-index: 20; 
}

/* Desktop State when Logged In */
.app-layout.layout-visible {
    display: grid;
}

/* SIDEBAR */
.sidebar { 
    background: var(--glass-bg); border-radius: 24px; border: 1px solid var(--glass-border);
    display: flex; flex-direction: column; align-items: center; padding: 40px 0; 
    gap: 15px; /* ESPACEMENT RÉDUIT (Avant: 25px) */
    z-index: 200;
    transition: opacity 0.5s;
}
.nav-item { font-size: 22px; color: var(--text-dim); cursor: pointer; transition: 0.2s; position: relative; } 
.nav-item:hover, .nav-item.active { color: var(--primary); text-shadow: 0 0 10px var(--primary); }

/* NOTIF BADGE NUMÉRIQUE */
.nav-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff0055;
    color: white;
    border-radius: 10px; /* Forme pilule */
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 5px #ff0055;
    display: none; /* Caché par défaut */
    z-index: 10;
}

/* ACTIVE PARTY INDICATOR */
.active-party {
    color: #00ff88 !important;
    text-shadow: 0 0 15px #00ff88;
    animation: pulseParty 2s infinite;
}
@keyframes pulseParty { 0% { opacity: 0.8; } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.8; } }


/* PARTY CHAT STYLES */
#partyActiveContainer {
    flex-direction: column; height: 60vh; width: 100%;
}

.chat-box-container {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    margin: 15px 0;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--glass-border);
}
.chat-box-container::-webkit-scrollbar { width: 5px; }
.chat-box-container::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

.chat-message {
    display: flex; flex-direction: column; max-width: 80%;
    margin-bottom: 5px;
}
.chat-message.me { align-self: flex-end; align-items: flex-end; }
.chat-message.other { align-self: flex-start; align-items: flex-start; }
.chat-message.system { align-self: center; align-items: center; width: 100%; margin: 10px 0; opacity: 0.7; }

.chat-user { font-size: 10px; color: #888; margin-bottom: 2px; margin-left: 5px; }
.chat-context { 
    font-size: 9px; color: var(--primary); 
    background: rgba(0, 210, 255, 0.1); 
    padding: 2px 6px; border-radius: 4px; margin-bottom: 4px; 
    display: inline-flex; align-items: center; gap: 4px;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.chat-message.me .chat-bubble {
    background: var(--primary); color: #000;
    border-bottom-right-radius: 2px;
}
.chat-message.other .chat-bubble {
    background: rgba(255,255,255,0.1); color: white;
    border-bottom-left-radius: 2px;
}
.chat-message.system .chat-bubble {
    background: transparent; color: #888; font-style: italic; font-size: 12px; padding: 0;
}

.chat-input-area {
    display: flex; gap: 10px;
}
.chat-input {
    flex: 1; padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: white; outline: none;
}
.chat-send-btn {
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--primary); border: none;
    color: black; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* PLAYLIST SELECT MODAL ITEMS */
.playlist-select-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: 0.2s;
}
.playlist-select-item:hover { background: rgba(255,255,255,0.05); color: var(--primary); }

/* PLAYLIST COLLAGE (2x2) */
.playlist-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #222;
}
.playlist-collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* MAIN FEED */
.main-feed { display: flex; flex-direction: column; gap: 20px; overflow: hidden; position: relative; transition: opacity 0.5s; }
.search-container { display: flex; gap: 10px; background: rgba(255,255,255,0.05); padding: 10px 15px; border-radius: 18px; border: 1px solid var(--glass-border); flex-shrink: 0; align-items: center; transition: opacity 0.5s; }
.search-select { background: transparent; color: var(--primary); border: none; font-weight: 700; outline: none; cursor: pointer; text-transform: uppercase; font-size: 12px; padding-right: 10px; border-right: 1px solid rgba(255,255,255,0.1); }
.search-select option { background: #000; color: white; padding: 10px; }
.search-input { flex: 1; background: transparent; border: none; color: white; font-size: 16px; outline: none; min-width: 0; }
.search-input::placeholder { color: rgba(255,255,255,0.5); }
.search-btn { background: var(--primary); border: none; padding: 8px 20px; border-radius: 10px; color: #000; font-weight: 700; cursor: pointer; }
.search-btn:active { transform: scale(0.95); }

/* HEADER CONTROLS */
.header-controls { display: flex; align-items: center; gap: 15px; margin-top: 10px; transition: opacity 0.5s; }
.back-btn-main { 
    background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border);
    color: white; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;
}
.back-btn-main:hover { background: var(--primary); color: black; transform: translateX(-3px); }

/* GRID VIEW */
.track-view { overflow-y: auto; flex: 1; display: block; }
.track-view::-webkit-scrollbar { display: none; }
.bento-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; padding-bottom: 120px; }
.track-card { background: rgba(255,255,255,0.03); border-radius: 16px; padding: 15px; cursor: pointer; transition: 0.2s; border: 1px solid var(--glass-border); position: relative; overflow: hidden; }
.track-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); border-color: var(--primary); }
.track-card.active-track { border-color: var(--primary); background: rgba(0, 210, 255, 0.1); box-shadow: 0 0 20px rgba(0, 210, 255, 0.2); }
.playing-indicator { position: absolute; bottom: 15px; right: 15px; font-size: 12px; color: var(--primary); font-weight: bold; animation: pulseText 1.5s infinite; background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 4px; }
@keyframes pulseText { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.track-card.artist-card img { border-radius: 50%; aspect-ratio: 1/1; width: 80%; margin: 0 auto 15px auto; display: block; }
.track-card.artist-card { text-align: center; }
.track-card img { width: 100%; border-radius: 12px; aspect-ratio: 1/1; object-fit: cover; margin-bottom: 10px; }
.track-card h3 { font-weight: 600; margin-bottom: 4px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-card p { font-size: 12px; color: var(--text-dim); }
.badges-container { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.type-badge { font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; color: #000; width: fit-content; }
.badge-hires { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.badge-album { background: var(--secondary); box-shadow: 0 0 10px var(--secondary); color: white; }
.badge-artist { background: #9d4edd; box-shadow: 0 0 10px #9d4edd; color: white; }
.badge-tidal { background: var(--tidal-blue); color: white; font-weight: 900; }
.badge-qobuz { background: #555; color: white; font-weight: 900; }
.badge-spotify { 
    background: #1DB954; 
    color: white; 
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.4); 
    font-size: 11px !important; 
    padding: 3px 8px !important; 
    display: flex;
    align-items: center;
    gap: 4px;
}

/* CREATE PLAYLIST CARD */
.create-playlist-card {
    display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.create-playlist-card:hover i { transform: scale(1.2); transition: 0.3s; }

/* ARTIST PROFILE VIEW */
.artist-view { display: none; flex: 1; overflow-y: auto; padding-bottom: 120px; }
.artist-view::-webkit-scrollbar { display: none; }
.artist-header-content { display: flex; align-items: flex-end; gap: 30px; padding: 30px; background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent); border-radius: 20px; margin-bottom: 30px; position: relative; overflow: hidden; }
.artist-header-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; z-index: -1; filter: blur(20px); }
.artist-profile-img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 4px solid rgba(255,255,255,0.1); }
.artist-info { flex: 1; }
.artist-name-large { font-size: 3rem; font-weight: 800; margin-bottom: 15px; line-height: 1; text-shadow: 0 0 20px rgba(0,0,0,0.5); }
.artist-bio { font-size: 14px; line-height: 1.6; color: #ccc; max-width: 800px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: 0.3s; }
.artist-bio.expanded { -webkit-line-clamp: unset; color: white; background: rgba(0,0,0,0.5); padding: 15px; border-radius: 10px; backdrop-filter: blur(10px); }
.section-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 20px 20px; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--primary); }

/* BADGE FANS */
.artist-fans-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #ddd;
    backdrop-filter: blur(5px);
}
.artist-fans-badge i { color: var(--primary); }

/* LYRICS VIEW */
.lyrics-view { display: none; flex: 1; overflow-y: auto; text-align: center; padding: 20px 50px 120px 50px; scroll-behavior: smooth; position: relative; }
.lyrics-view::-webkit-scrollbar { display: none; }
.lyric-line { font-size: 24px; font-weight: 700; margin: 20px 0; color: var(--inactive-lyric); transition: 0.3s; cursor: pointer; }
.lyric-line.active { color: var(--active-lyric); transform: scale(1.1); text-shadow: 0 0 20px rgba(255,255,255,0.3); }

/* INTRO */
.intro-container { position: fixed; top: 40%; left: 47%; transform: translate(-50%, -50%); width: 350px; display: none; pointer-events: none; z-index: 50; text-align: center; }
.intro-text { font-size: 14px; color: var(--primary); font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }
.intro-bar-bg { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.intro-bar-fill { height: 100%; width: 0%; background: var(--primary); box-shadow: 0 0 20px var(--primary); border-radius: 10px; transition: width 0.1s linear; }

/* TOAST */
.toast { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #000; padding: 10px 25px; border-radius: 30px; font-weight: 800; font-size: 14px; box-shadow: 0 0 20px var(--primary); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; z-index: 500; transform: translateX(-50%) translateY(20px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* RIGHT PANEL */
.right-panel { 
    background: var(--glass-bg); 
    border-radius: 24px; 
    padding: 30px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    border: 1px solid var(--glass-border); 
    position: relative; 
    overflow: hidden;
    justify-content: flex-start; /* Important */
}

/* CONTAINER POUR L'IMAGE ET LES INFOS */
.rp-header {
    width: 100%;
    flex: 0 0 auto; /* Ne rétrécit pas, ne grandit pas tout seul */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
}

.xl-image-wrapper { position: relative; width: 100%; max-width: 300px; margin-bottom: 20px; z-index: 2; transition: 0.3s; }
.album-art-xl { width: 100%; border-radius: 20px; aspect-ratio: 1/1; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.xl-badge { position: absolute; top: 15px; right: 15px; background: var(--primary); color: #000; font-size: 11px; font-weight: 900; padding: 4px 8px; border-radius: 6px; box-shadow: 0 0 15px var(--primary); z-index: 10; display: none; }
.xl-title, .xl-artist { z-index: 2; position: relative; }

/* ETAT OUVERT : On réduit l'image */
.right-panel.queue-open .xl-image-wrapper {
    max-width: 120px;
    margin-bottom: 10px;
}
.right-panel.queue-open {
    padding: 20px; /* Moins de padding pour gagner de la place */
}

/* PLAYER CAPSULE */
.player-capsule { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); width: 750px; height: 100px; background: #141416; border-radius: 25px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.9); border: 1px solid rgba(255,255,255,0.15); z-index: 100; }
.cap-info { display: flex; align-items: center; gap: 15px; width: 240px; }
.cap-img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: #222; }
.cap-text { display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.cap-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-artist { color: #888; font-size: 12px; cursor: pointer; transition: 0.2s; }
.cap-artist:hover { color: var(--primary); text-decoration: underline; }
.action-btn-mini { background: none; border: none; color: var(--text-dim); font-size: 14px; margin-left: 10px; cursor: pointer; transition: 0.2s; padding: 0; }
.action-btn-mini:hover { color: var(--primary); transform: scale(1.2); }
.action-btn-mini.liked { color: var(--secondary); text-shadow: 0 0 10px var(--secondary); }
.share-btn-mini { background: none; border: none; color: var(--text-dim); font-size: 14px; margin-left: 10px; cursor: pointer; transition: 0.2s; padding: 0; }
.cap-center { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 300px; }
.controls { display: flex; align-items: center; gap: 20px; }
.ctrl-btn { background: none; border: none; color: #888; font-size: 16px; cursor: pointer; transition: 0.2s; }
.ctrl-btn:hover, .ctrl-btn.active { color: white; }
.play-btn { width: 40px; height: 40px; background: white; color: black; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: 0.2s; }
.play-btn:hover { transform: scale(1.05); background: var(--primary); }
.timeline-box { width: 100%; display: flex; align-items: center; gap: 10px; font-size: 10px; color: #666; }
.progress-bg { flex: 1; height: 4px; background: #333; border-radius: 2px; cursor: pointer; position: relative; }
.progress-fill { width: 0%; height: 100%; background: var(--primary); border-radius: 2px; }
.seek-hitbox { position: absolute; top: -10px; bottom: -10px; width: 100%; cursor: pointer; }
.cap-right { width: 150px; display: flex; align-items: center; gap: 15px; justify-content: flex-end; }
.vol-slider { width: 80px; height: 4px; border-radius: 2px; -webkit-appearance: none; background: #333; outline: none; }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; background: white; border-radius: 50%; cursor: pointer; }
.radio-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: black; padding: 2px 10px; border-radius: 10px; font-size: 10px; font-weight: bold; box-shadow: 0 0 15px rgba(0, 210, 255, 0.4); display: none; }

/* --- STYLES AUDIO FX --- */
.eq-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: rgba(20, 20, 30, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); padding: 30px; border-radius: 25px; box-shadow: 0 20px 60px rgba(0,0,0,0.8); z-index: 300; display: none; flex-direction: column; gap: 15px; width: 400px; backdrop-filter: blur(20px); opacity: 0; transition: 0.3s ease; }
.eq-overlay.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.eq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.close-eq { background: none; border: none; color: white; font-size: 20px; cursor: pointer; }
.xfade-section { margin-bottom: 10px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.xfade-range { width: 100%; height: 6px; border-radius: 3px; -webkit-appearance: none; background: #333; outline: none; margin-top: 10px; }
.xfade-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; box-shadow: 0 0 10px var(--primary); }
.eq-sliders { display: flex; justify-content: space-between; height: 150px; align-items: center; }
.eq-band { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 10px; }
.eq-range { -webkit-appearance: none; width: 120px; height: 4px; background: #333; border-radius: 2px; outline: none; transform: rotate(-90deg); transform-origin: center; margin: 60px -50px; cursor: pointer; }
.eq-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 10px var(--primary); }
.eq-band span { font-size: 10px; color: #888; margin-top: auto; }
.eq-reset-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 8px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.eq-reset-btn:hover { background: var(--primary); color: black; }
.orbit-btn { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #888; padding: 10px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; margin-top: 5px; transition: 0.3s; }
.orbit-btn:hover { background: rgba(255,255,255,0.1); }
.orbit-btn.active { background: rgba(0, 210, 255, 0.15); border-color: var(--primary); color: var(--primary); box-shadow: 0 0 15px rgba(0, 210, 255, 0.2); }

/* BOUTON KARAOKE (NO VOCAL) */
.karaoke-btn { width: 100%; background: rgba(255,0,85,0.1); border: 1px solid rgba(255,0,85,0.3); color: #ff0055; padding: 10px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; margin-top: 10px; transition: 0.3s; }
.karaoke-btn:hover { background: rgba(255,0,85,0.2); }
.karaoke-btn.active { background: #ff0055; color: white; box-shadow: 0 0 20px #ff0055; border-color: #ff0055; }

/* BOUTON LIMITER */
.limiter-btn { width: 100%; background: rgba(0,255,136,0.1); border: 1px solid rgba(0,255,136,0.3); color: var(--limiter-green); padding: 10px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; margin-top: 10px; transition: 0.3s; }
.limiter-btn:hover { background: rgba(0,255,136,0.2); }
.limiter-btn.active { background: var(--limiter-green); color: black; box-shadow: 0 0 20px var(--limiter-green); border-color: var(--limiter-green); }

/* --- QUEUE PANEL (NEW) --- */
.queue-panel {
    /* Flux normal (Static) pour qu'il pousse ou soit poussé, mais avec flex grow */
    width: 100%;
    flex: 1 1 auto; /* Prend tout l'espace disponible restant */
    min-height: 0; /* CRUCIAL pour que le scroll fonctionne dans un flex container */
    
    background: rgba(255, 255, 255, 0.03); 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    
    margin-top: 20px;
    padding-top: 15px;
    
    display: none; /* Caché par défaut */
    flex-direction: column;
    
    opacity: 0;
    transition: opacity 0.3s;
}

.queue-panel.active {
    display: flex;
    opacity: 1;
}

.queue-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
}
.queue-list {
    overflow-y: auto; flex: 1;
    position: relative; /* CRITICAL: Enables correct offsetTop calculation for children */
}
.queue-list::-webkit-scrollbar { width: 5px; }
.queue-list::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

.queue-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 8px;
    cursor: pointer; transition: 0.2s;
    text-align: left; /* Alignement texte à gauche pour la liste */
}
.queue-item:hover { background: rgba(255,255,255,0.1); }
.queue-item.current { background: rgba(0, 210, 255, 0.15); border: 1px solid var(--primary); }
.queue-item.played { opacity: 0.5; filter: grayscale(0.5); } 
.queue-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.queue-info { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.queue-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-artist { font-size: 11px; color: #888; }
.playing-icon-small { color: var(--primary); font-size: 12px; margin-right: 5px; }

/* --- STYLES PROFIL --- */
.profile-view {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    text-align: center;
}
.profile-container {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
}
.profile-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px auto;
    cursor: pointer;
}
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.1);
    transition: 0.3s;
}
.profile-avatar-wrapper:hover .profile-avatar {
    border-color: var(--primary);
    opacity: 0.8;
}
.profile-avatar-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s;
    font-size: 30px; color: white;
}
.profile-avatar-wrapper:hover .profile-avatar-overlay {
    opacity: 1;
}
.form-group { margin-bottom: 25px; text-align: left; }
.form-label { display: block; margin-bottom: 10px; color: var(--text-dim); font-size: 14px; font-weight: bold; text-transform: uppercase; }
.form-input {
    width: 100%; padding: 15px;
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 12px; color: white; font-size: 18px; outline: none;
    transition: 0.2s;
}
.form-input:focus { border-color: var(--primary); }

/* FIX SLIDER PARAMETRES */
.settings-slider {
    width: 100%; height: 6px; border-radius: 3px; 
    -webkit-appearance: none; background: #333; outline: none; 
    margin-top: 10px; cursor: pointer;
}
.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; 
    background: var(--primary); border-radius: 50%; cursor: pointer; 
    box-shadow: 0 0 10px var(--primary);
}

.save-btn {
    width: 100%; padding: 15px;
    background: var(--primary); color: #000;
    border: none; border-radius: 12px;
    font-size: 16px; font-weight: 800; cursor: pointer;
    transition: 0.2s;
}
.save-btn:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); }
.save-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* --- TOGGLE SWITCH (PARAMETRES) --- */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

/* --- BLIND TEST STYLES --- */
.bt-container {
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
    padding: 20px;
}

.bt-cover-container {
    width: 250px;
    height: 250px;
    margin: 20px auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    background: #222;
}

.bt-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px);
    transition: filter 0.8s ease-in-out;
    transform: scale(1.1); /* Avoid white edges when blurring */
}

.bt-cover-img.revealed {
    filter: blur(0);
    transform: scale(1);
}

.bt-timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.bt-timer-fill {
    height: 100%;
    background: var(--primary);
    width: 100%;
    transition: width 0.1s linear;
}

.bt-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.bt-option-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 20px 10px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 80px;
}

.bt-option-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.bt-option-btn.correct {
    background: rgba(0, 255, 136, 0.2) !important;
    border-color: #00ff88 !important;
    color: #00ff88;
}

.bt-option-btn.wrong {
    background: rgba(255, 0, 85, 0.2) !important;
    border-color: #ff0055 !important;
    color: #ff0055;
    opacity: 0.6;
}

.bt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bt-score-pill {
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}


/* MOBILE FIX */
@media (max-width: 768px) {
    /* When logged in on mobile, use Flex column */
    .app-layout.layout-visible {
        display: flex;
        flex-direction: column; 
    }
    
    .app-layout { 
        display: none; 
        flex-direction: column; 
        padding: 10px; 
        width: 100%; 
        height: 100%; 
        border-radius: 0; 
        border: none; 
    }
    .right-panel { display: none; }
    .sidebar { 
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        height: 60px; 
        flex-direction: row; 
        align-items: center; 
        justify-content: flex-start; 
        overflow-x: auto; 
        padding: 0 20px; 
        gap: 30px; 
        background: #000; 
        border-top: 1px solid var(--glass-border); 
        border-radius: 0; 
        z-index: 200; 
        scrollbar-width: none; 
        -ms-overflow-style: none; 
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .nav-item, .sidebar > div { flex-shrink: 0; }
    
    /* FIX LAYOUT PRINCIPAL */
    .main-feed { 
        padding-bottom: 250px; 
        width: 100%; 
    }
    .bento-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        width: 100%;
    }
    
    /* FIX PLAYER */
    .player-capsule { 
        width: 96%; 
        height: auto; 
        min-height: 130px; 
        bottom: 75px; /* Ajusté pour être au-dessus de la sidebar */
        flex-direction: column; 
        justify-content: center; 
        padding: 20px 15px; 
        gap: 15px; 
        background: rgba(20, 20, 25, 0.98); 
        border: 1px solid rgba(255,255,255,0.1); 
    }
    .cap-info { width: 100%; }
    .cap-center { width: 100%; gap: 15px; margin-top: 5px; }
    .cap-right { display: none; } 
    .controls { width: 100%; justify-content: space-around; }
    .timeline-box { display: flex !important; width: 100%; justify-content: space-between; margin-top: 0px; }
    .progress-bg { height: 6px; } 
    
    /* FIX SEARCH BAR MOBILE */
    .search-container { 
        width: 100%; 
        flex-wrap: wrap; 
        padding: 15px; 
    }
    .search-input { 
        width: 100%; 
        margin-top: 10px; 
        order: 3; 
        background: rgba(255,255,255,0.1); /* Fond semi-transparent sombre */
        color: white;
        border-radius: 10px;
    }
    .search-select { order: 1; }
    .search-btn { order: 2; margin-left: auto; }
    
    .lyrics-view { padding: 20px; }
    .lyric-line { font-size: 18px; }
    .intro-container { width: 90%; left: 50%; }
    .toast { bottom: 240px; }
    .eq-overlay { width: 90%; height: auto; padding: 20px; bottom: 350px; top: auto; transform: translate(-50%, 0) scale(0.9); }
    .eq-overlay.active { transform: translate(-50%, 0) scale(1); }
    .artist-header-content { flex-direction: column; align-items: center; text-align: center; }
    .artist-profile-img { margin-bottom: 20px; }
    .artist-name-large { font-size: 2rem; }

    /* MOBILE BLIND TEST */
    .bt-options-grid { grid-template-columns: 1fr; }
    .bt-cover-container { width: 200px; height: 200px; }
    
    /* QUEUE PANEL MOBILE */
    .queue-panel {
        /* En mobile, on le remet en bas en absolute par rapport à l'écran si besoin, 
           mais comme right-panel est hidden, on doit gérer ça.
           Pour l'instant, le right-panel est display:none en mobile, donc la queue ne s'affichera pas.
           Il faudrait idéalement sortir la queue du right-panel en mobile, mais pour l'instant 
           on garde la structure desktop demandée. */
        display: none !important; 
    }
}