/* BASE & THEME */
:root {
    --bg-main: #07050f;
    --bg-card: rgba(20, 15, 35, 0.6);
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --purple-dark: #6B21A8;
    --purple-light: #A855F7;
    --neutral-toggle: #3f3f46;
}

html {
    background-color: var(--bg-main);
}

.safe-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    margin-bottom: 16px;
    padding: 4px 10px;
    background-color: #1e2a1e;
    color: #4ade80;
    border: 1px solid #4ade80;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    user-select: none;
    vertical-align: middle;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.safe-badge:hover,
.safe-badge:focus {
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

.safe-badge .badge-hint-icon {
    font-size: 0.65rem;
    opacity: 0.7;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.2); }
}

.safe-badge:hover,
.safe-badge:focus {
    background-color: #2a3d2a;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
}

.safe-badge-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background-color: #111;
    color: #f1f1f1;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.safe-badge-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #111 transparent transparent transparent;
}

.safe-badge:hover .safe-badge-tooltip,
.safe-badge:focus .safe-badge-tooltip {
    visibility: visible;
    opacity: 1;
}

.safe-badge.active .safe-badge-tooltip {
    visibility: visible;
    opacity: 1;
}

#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Remplit l'écran sans déformer */
    z-index: -1;
    /* Se place juste derrière le contenu */
    filter: brightness(0.35) contrast(1.1);
    /* Assombrit pour la lisibilité */
}

body {
    background-color: transparent;
    /* Indispensable pour voir la vidéo derrière ! */
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Supprime la barre de défilement horizontale */
}

/* --- FIX DU HEADER GLOBAL INJECTÉ --- */
#header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

/* On force le vrai header de navigation à garder sa structure d'origine */
#header-container .main-header {
    display: flex !important;
    justify-content: space-between !important;
    /* Aligne logo à gauche, menu à droite */
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 40px !important;
    /* Ajuste l'espace interne de ton menu */
    box-sizing: border-box !important;
}

/* --- LECTEUR VIDÉO YOUTUBE --- */
#main-player {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: none;
    border-radius: 12px;
    /* Ombre de base + lueur néon violette */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(168, 85, 247, 0.3);
    margin: 0 auto 20px auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#main-player[src*="youtube"] {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(168, 85, 247, 0.6);
}

/* Centre le contenu de la page sous le header */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin-top: 100px;
    /* Crée l'espace nécessaire sous le menu fixe */
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Cache les pages qui débordent pendant le slide */
}

h1,
h2,
h3 {
    margin: 0;
}

/* --- DESIGN DU BADGE "MUSIQUE" --- */
.page-title-area {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    margin-top: 10px;
}

.page-title-area .badge {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--purple-light);
    color: #fff;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

/* COMPOSANT TOGGLE A 3 ETATS */
.toggle-wrapper {
    position: relative;
    display: flex;
    background: rgba(15, 10, 28, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 4px 15px rgba(0, 0, 0, 0.5);
    border-radius: 30px;
    padding: 4px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px auto;
    z-index: 10;
    overflow: hidden;
    /* Sécurité pour l'arrondi */
}

.toggle-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 0;
    cursor: pointer;
    z-index: 2;
    /* Reste par-dessus l'indicateur violet */
    transition: color 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

/* L'indicateur violet qui va slider */
.toggle-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(33.333% - 4px);
    /* Prendre un tiers de la largeur */
    background: linear-gradient(135deg, var(--purple-light), var(--purple-dark)) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
    border-radius: 26px;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- GESTION DU SLIDE DU BOUTON SELON L'ÉTAT --- */
.toggle-wrapper[data-state="left"] .toggle-indicator {
    transform: translateX(0%);
}

.toggle-wrapper[data-state="left"] #btn-left {
    color: #ffffff;
}

.toggle-wrapper[data-state="center"] .toggle-indicator {
    transform: translateX(100%);
}

.toggle-wrapper[data-state="center"] #btn-center {
    color: #ffffff;
}

.toggle-wrapper[data-state="right"] .toggle-indicator {
    transform: translateX(200%);
}

.toggle-wrapper[data-state="right"] #btn-right {
    color: #ffffff;
}


/* ==========================================================================
   SYSTÈME DE TRANSLATION HORIZONTALE AVEC EFFET DE VENT (FLOU)
   ========================================================================== */
.slide-container {
    display: flex;
    align-items: flex-start;
    /* Évite que les sections inactives étirent la hauteur totale du conteneur */
    width: 300%;
    /* 3 sections alignées côte à côte */
    /* Ralenti à 0.65s avec un effet d'accélération/décélération plus marqué */
    transition: transform 0.65s cubic-bezier(0.25, 1, 0.3, 1);
    will-change: transform;
}

.content-section {
    display: block !important;
    width: 33.333%;
    max-width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.97);
    /* Transition synchronisée pour l'opacité, le zoom, le flou et la hauteur */
    transition: opacity 0.65s ease, transform 0.65s ease, filter 0.65s ease, max-height 0.65s ease;
    filter: blur(8px);
    /* Effet de vent/flou par défaut sur les sections cachées */
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* La section active devient lumineuse, nette, perd son flou et prend sa hauteur réelle */
.content-section.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
    /* Nettoyage complet de l'effet une fois en place */
    max-height: 10000px;
    overflow: visible;
    pointer-events: auto;
}

/* --- GLISSEMENT DU GRAND RUBAN SELON L'ÉTAT ACTIF --- */
.slide-container[data-state="left"] {
    transform: translateX(33.333%);
    /* Amène la section gauche au centre */
}

.slide-container[data-state="center"] {
    transform: translateX(0%);
    /* Reste au centre (Accueil) */
}

.slide-container[data-state="right"] {
    transform: translateX(-33.333%);
    /* Décale vers la gauche pour voir la section droite */
}


/* ARCHITECTURE DES CARTES */
.music-card {
    background: var(--bg-card);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    /* Empêche les cartes de se décentrer */
}

.welcome-text {
    color: var(--text-muted);
    margin: 15px 0 25px 0;
    line-height: 1.6;
}

.music-icon {
    font-size: 3rem;
    opacity: 0.3;
    animation: pulse 2s infinite alternate;
}

.embed-container {
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    min-height: 150px;
}

iframe {
    border: none;
    width: 100%;
    display: block;
}

/* LISTE DES TRACKS COMPACTE */
.track-list {
    margin-top: 15px;
    text-align: left;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease-in-out;
}

.track-item:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateX(5px);
}

.track-img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background-color: #1a1528;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.track-info {
    flex-grow: 1;
    margin-left: 15px;
    /* Éloigne proprement les titres */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.track-duration {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* BOUTONS EXTERNES */
.external-link {
    display: inline-block;
    margin-top: 25px;
    padding: 12px 24px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-ytm {
    background: var(--purple-dark);
}

.btn-ytm:hover {
    background: #581c87;
}

.btn-spot {
    background: var(--purple-light);
}

.btn-spot:hover {
    background: #9333ea;
}

.content-section a {
    color: var(--purple-light);
    font-style: italic;
    text-decoration: none;
    transition: opacity 0.2s;
}

.content-section a:hover {
    opacity: 0.8;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* --- CATEGORIES DE PLAYLISTS --- */
.playlist-category {
    margin-top: 25px;
}

.playlist-category+.playlist-category {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
}

.category-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #c084fc;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* --- GRILLE ET CONTENEURS DE PLAYLISTS --- */
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
    gap: 25px;
    max-width: 480px;
    margin: 15px auto 0 auto;
    box-sizing: border-box;
}

.playlist-custom-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    width: 200px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.playlist-custom-card:nth-child(3) {
    grid-column: 1 / span 2;
    justify-self: center;
}

.playlist-custom-card h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    margin-top: 12px;
    font-weight: 700;
    color: #fff;
}

.playlist-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
}

.playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* COUVERTURES AVEC ICONES ET FONDS DEGRADES */
.playlist-cover-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #ffffff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s ease;
}

.playlist-cover-icon i {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s ease;
}

.cover-stream-bg {
    background: linear-gradient(135deg, #6b21a8, #c084fc);
}

.cover-hype-bg {
    background: linear-gradient(135deg, #b91c1c, #f97316);
}

.playlist-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* HOVERS DE CARTES */
.hover-stream:hover {
    transform: translateY(-5px);
    border-color: #c084fc;
    box-shadow: 0 10px 25px rgba(192, 132, 252, 0.3);
    background: rgba(192, 132, 252, 0.04);
}

.hover-stream:hover .playlist-cover-icon i {
    transform: scale(1.15) rotate(-5deg);
}

.hover-hype:hover {
    transform: translateY(-5px);
    border-color: #f97316;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.04);
}

.hover-hype:hover .playlist-cover-icon i {
    transform: scale(1.18) rotate(5deg);
}

.hover-synthwave:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #ff007f;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.4), 0 0 40px rgba(0, 240, 255, 0.2);
    background: rgba(255, 0, 127, 0.05);
}

.hover-synthwave:hover .playlist-cover img {
    transform: scale(1.08);
    filter: saturate(1.4) hue-rotate(-10deg);
}

.hover-lofi:hover {
    transform: translateY(-5px);
    border-color: #ffb366;
    box-shadow: 0 10px 25px rgba(255, 179, 102, 0.25);
    background: rgba(255, 179, 102, 0.03);
}

.hover-lofi:hover .playlist-cover img {
    transform: scale(1.04);
    filter: sepia(0.3) contrast(0.9);
}

.hover-ambient:hover {
    transform: translateY(-5px);
    border-color: #8a2be2;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
    background: rgba(138, 43, 226, 0.02);
}

.hover-ambient:hover .playlist-cover img {
    transform: scale(1.05);
    filter: brightness(1.2) blur(0.5px);
}

/* MODALES & BULLES */
.spotify-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 2, 7, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.spotify-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spotify-bubble-menu {
    background: rgba(20, 16, 33, 0.95);
    border: 2px solid #A855F7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 380px;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.spotify-modal-overlay.active .spotify-bubble-menu {
    transform: scale(1);
}

.spotify-bubble-menu h4 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    margin: 0 0 20px 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-bubble {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-bubble:hover {
    color: #fff;
}

.bubble-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bubble-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    color: #fff;
    text-decoration: none;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.bubble-btn i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #A855F7;
}

.bubble-btn:hover {
    background: #A855F7;
    border-color: #fff;
    transform: translateX(5px);
}

.bubble-btn:hover i {
    color: #fff;
}

.bubble-btn.app-link {
    border-color: rgba(30, 215, 96, 0.4);
}

.bubble-btn.app-link i {
    color: #1ED760;
}

.bubble-btn.app-link:hover {
    background: #1ED760;
    border-color: #fff;
}

.info-badge-glow {
    display: inline-block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid #a855f7;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4), inset 0 0 5px rgba(168, 85, 247, 0.2);
}

.playlist-custom-card:hover .info-badge-glow {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.7), inset 0 0 8px rgba(168, 85, 247, 0.3);
    border-color: #c084fc;
    color: #fff;
}

.badge-footer-container {
    margin-top: 20px;
    margin-bottom: 5px;
    text-align: center;
}

.medal-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.6));
}

.medal-legend {
    margin: 25px auto 0 auto;
    max-width: 400px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(168, 85, 247, 0.2);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.medal-legend p {
    margin: 6px 0;
}

/* SCROLLBAR LISTE */
#playlist-container::-webkit-scrollbar {
    width: 6px;
}

#playlist-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#playlist-container::-webkit-scrollbar-thumb {
    background: var(--purple-light);
    border-radius: 10px;
}

#playlist-container::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}