/* ============================================================
   Y - WHY · musiques.css
   Page des morceaux / singles
   ============================================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --bg-root:      #09050f;
    --bg-deep:      #0d0520;
    --bg-card:      #120828;
    --bg-card-alt:  #1a0d35;
    --border-faint: #1e0f38;
    --border-dim:   #2d1a4a;
    --border-mid:   #3d1f7a;
    --border-main:  #5b21b6;
    --purple-main:  #7c4dff;
    --purple-vivid: #7c4dff;
    --purple-light: #aa44ff;
    --purple-pale:  #c4a8ff;
    --purple-muted: #9b7ed0;
    --text-primary:   #ede0ff;
    --text-secondary: #b59dd4;
    --text-muted:     #6b4fa0;
    --text-faint:     #a891c4;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'DM Sans', Inter, sans-serif;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 22px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
     background-image: url('img/album_1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
    padding-bottom: 88px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(9, 5, 15, 0.75); /* ajuste le 0.75 selon l'intensité voulue */
    z-index: 0;
    pointer-events: none;
}

main, header, footer {
    position: relative;
    z-index: 1;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 48px;
    background: rgba(9, 5, 15, 0.9);
    border-bottom: 0.5px solid var(--border-faint);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
}

.logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--purple-pale);
    letter-spacing: 3px;
}
.logo span { color: var(--purple-vivid); }

.nav-links { display: flex; gap: 36px; }
.nav-link { font-size: 13px; color: var(--text-muted); letter-spacing: 0.8px; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: var(--purple-pale); }

.nav-link:hover,
.nav-link.active {
    color: var(--purple-pale);
}

.nav-cta {
    font-size: 12px;
    color: var(--purple-pale);
    background: transparent;
    border: 0.5px solid var(--border-main);
    padding: 9px 22px;
    border-radius: var(--r-sm);
    letter-spacing: 1.5px;
    transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--purple-main); color: white; }

.back-btn {
    position: fixed;
    top: 120px;
    left: 80px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: black;
    color: var(--purple-pale);
    border: 0.5px solid var(--border-main);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: var(--purple-main);
    color: white;
}

/* ============================================================
   EN-TÊTE PAGE
   ============================================================ */
.page-header {
    text-align: center;
    padding: 64px 48px 0;
    max-width: 800px;
    margin: 0 auto;
}

.page-eyebrow {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-bottom: 16px;
    font-family: var(--font-body);
}

.page-title {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.page-title em { font-style: italic; color: var(--purple-light); }

.page-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.rainbow-header {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    line-height: 0;
    filter: drop-shadow(0 0 10px rgba(170, 68, 255, .25));
}
.rainbow-header svg { width: 100%; height: 60px; display: block; }

/* ============================================================
   FILTRES & RECHERCHE
   ============================================================ */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1280px;
    margin: 40px auto 0;
    padding: 0 48px;
}

.filters-inner { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 0.5px solid var(--border-mid);
    padding: 8px 18px;
    border-radius: 100px;
    transition: background .2s, color .2s, border-color .2s;
}
.filter-btn:hover { color: var(--purple-pale); border-color: var(--border-mid); }
.filter-btn.active {
    background: var(--purple-main);
    color: white;
    border-color: var(--purple-main);
}

.sort-row { display: flex; align-items: center; gap: 10px; }
.sort-label { font-size: 13px; color: var(--text-faint); }

.sort-select {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: var(--r-sm);
    padding: 7px 12px;
    outline: none;
    cursor: pointer;
}

/* ============================================================
   SECTION MORCEAUX
   ============================================================ */
.tracks-section {
    max-width: 1280px;
    margin: 32px auto 0;
    padding: 0 48px 56px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: var(--r-md);
    padding: 12px 18px;
    margin-bottom: 32px;
    font-size: 16px;
    color: var(--text-muted);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
}
.search-bar input::placeholder { color: var(--text-faint); }

/* ---- Grille ---- */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.track-card {
    background: var(--bg-card);
    border: 0.5px solid var(--border-faint);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color .25s, background .25s, transform .2s;
}
.track-card:hover {
    background: var(--bg-card-alt);
    border-color: var(--border-mid);
    transform: translateY(-3px);
}

/* Pochette */
.track-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-root);
}
.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.track-card:hover .track-cover img { transform: scale(1.05); }

.track-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 5, 15, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.track-card:hover .track-cover-overlay { opacity: 1; }

.track-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--purple-main);
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform .15s, background .2s;
}
.track-play-btn:hover { transform: scale(1.08); background: #6040e0; }

/* Infos */
.track-info { padding: 16px; }

.track-type {
    font-size: 10px;
    color: var(--purple-vivid);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 6px;
}

.track-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 14px;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--purple-pale);
    background: rgba(91, 33, 182, 0.15);
    border: 0.5px solid var(--border-mid);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    transition: background .2s;
}
.track-listen-btn:hover { background: rgba(91, 33, 182, 0.3); }

.track-fav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
    border: 0.5px solid var(--border-dim);
    flex-shrink: 0;
}
.track-fav-btn:hover, .track-fav-btn.active { color: #ff5ecf; border-color: #ff5ecf; }

/* Message aucun résultat */
.no-results {
    text-align: center;
    padding: 48px;
    color: var(--text-faint);
    font-family: var(--font-display);
    font-size: 20px;
    font-style: italic;
}

/* ============================================================
   TOAST EN LECTURE
   ============================================================ */
.now-playing-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--bg-card-alt);
    border: 0.5px solid var(--border-main);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 300;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    animation: slide-in .3s ease;
}

.player-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.npt-left { display: flex; align-items: center; gap: 12px; }

.npt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple-vivid);
    animation: pulse-dot 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}

.npt-label {
    font-size: 10px;
    color: var(--text-faint);
    letter-spacing: 1.5px;
}

.npt-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

.npt-stop {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
}
.npt-stop:hover { color: var(--purple-pale); }

/* ============================================================
   PLAYER BAR
   ============================================================ */
.player-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: #1a0d35;
    border-top: 0.5px solid var(--border-faint);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    gap: 24px;
    z-index: 200;
}

.player-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }

.player-thumb {
    width: 46px; height: 46px;
    border-radius: var(--r-sm);
    background: var(--border-mid);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--purple-pale); flex-shrink: 0;
}

.player-title { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.player-center {
    flex: 1.5;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.player-controls { display: flex; align-items: center; gap: 8px; }

.ctrl-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s, background .2s;
}
.ctrl-btn:hover { color: var(--purple-pale); background: rgba(91,33,182,.15); }

.ctrl-play { width: 42px; height: 42px; background: var(--purple-main); color: white; font-size: 18px; }
.ctrl-play:hover { background: #6040e0; color: white; }

.player-progress { display: flex; align-items: center; gap: 10px; width: 100%; }
.player-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

.progress-track {
    flex: 1; height: 3px;
    background: var(--border-faint);
    border-radius: 2px; overflow: hidden; cursor: pointer;
}
.progress-fill { height: 100%; width: 0%; background: var(--purple-main); border-radius: 2px; transition: width .1s; }

.player-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }

.volume-track { width: 80px; height: 3px; background: var(--border-dim); border-radius: 2px; overflow: hidden; }
.volume-fill { height: 100%; width: 70%; background: var(--purple-main); }

.btn-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: transparent; color: var(--text-faint);
    font-size: 16px; display: flex; align-items: center; justify-content: center;
    transition: color .2s;
}
.btn-icon:hover { color: var(--purple-pale); }





/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .tracks-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .tracks-grid { grid-template-columns: repeat(2, 1fr); }
    .navbar { padding: 14px 24px; }
    .tracks-section { padding: 0 24px 48px; }
    .filters-bar { padding: 0 24px; }
    .page-header { padding: 48px 24px 0; }
    .page-title { font-size: 38px; }
}

@media (max-width: 480px) {
    .tracks-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .player-right { display: none; }
}