:root {
    --apricot: #F99B7D;
    --magenta: #E71D36;
    --bg-dark: #121212;
    --panel-bg: rgba(30, 30, 30, 0.7);
    --text-light: #f5f5f5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    margin: 0; padding: 20px;
}

/* --- EN-TÊTE & BOUTONS --- */
.glass-header {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, rgba(249, 155, 125, 0.2), rgba(231, 29, 54, 0.2));
    backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 40px; border-radius: 15px; margin-bottom: 40px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.btn {
    padding: 12px 24px; border-radius: 8px; font-weight: bold;
    text-decoration: none; border: none; cursor: pointer; transition: 0.3s;
}
.btn-primary { background: linear-gradient(90deg, var(--apricot), var(--magenta)); color: white; }
.btn-primary:hover { opacity: 0.8; transform: translateY(-2px); }

/* Bouton Éditer (Crayon) sur les cartes */
.btn-edit {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-edit:hover {
    background: var(--apricot);
    transform: rotate(15deg) scale(1.1);
}

/* --- GRILLE & CARTES D'ALBUMS (Page d'accueil) --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }

.album-card {
    background: var(--panel-bg); border-radius: 15px; overflow: hidden;
    backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.card-header { position: relative; }
.card-header img { width: 100%; height: 320px; object-fit: cover; display: block; }
.header-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 20px; display: flex; justify-content: space-between; align-items: flex-end;
}
.header-overlay h2 { margin: 0; font-size: 1.2rem; }
.badge { background: var(--magenta); padding: 5px 10px; border-radius: 5px; font-weight: bold; }

.tracklist { padding: 15px; max-height: 250px; overflow-y: auto; }
.tracklist::-webkit-scrollbar { width: 6px; }
.tracklist::-webkit-scrollbar-thumb { background: var(--apricot); border-radius: 3px; }

.track-item {
    display: flex; justify-content: space-between; padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem;
}
.track-item.is-fav { background: rgba(249, 155, 125, 0.15); border-left: 3px solid var(--apricot); }
.t-rating { font-weight: bold; color: var(--apricot); }

/* --- BARRE DE RECHERCHE FLOTTANTE --- */
.container { max-width: 800px; margin: auto; }

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 40px auto;
    z-index: 100;
}

.search-box {
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--apricot);
    box-shadow: 0 0 20px rgba(249, 155, 125, 0.2);
    background: rgba(0, 0, 0, 0.8);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 15px 25px;
    font-size: 1.1rem;
    outline: none;
}

.search-btn {
    border-radius: 40px;
    padding: 0 25px;
    font-size: 1.2rem;
}

.results-list {
    position: absolute;
    top: 110%;
    left: 0; right: 0;
    background: var(--bg-dark);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.results-list:empty { border: none; box-shadow: none; }

.album-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.album-result:last-child { border-bottom: none; }
.album-result:hover { background: rgba(249, 155, 125, 0.1); }

.album-result img {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.result-info { display: flex; flex-direction: column; }
.result-title { font-weight: bold; font-size: 1.1rem; color: white; }
.result-artist { font-size: 0.9rem; color: var(--apricot); font-weight: 500; margin-top: 3px; }

/* --- FORMULAIRE & PANNEAU VITRÉ --- */
.glass-panel {
    background: var(--panel-bg); padding: 30px; border-radius: 15px;
    display: flex; flex-direction: column; gap: 20px; border: 1px solid rgba(255,255,255,0.1);
}

.album-preview { text-align: center; }
.album-preview img { width: 200px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.btn-submit { width: 100%; padding: 15px; font-size: 1.1rem; margin-top: 20px; }

/* --- DESIGN DES CHAMPS DE NOTE (Inputs Number) --- */

/* 1. Cacher les flèches du navigateur */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; margin: 0; 
}
input[type=number] { -moz-appearance: textfield; }

/* 2. Style de la Note Globale Géante */
.overall-rating-container {
    display: flex; flex-direction: column; align-items: center; margin: 30px 0;
}
.overall-rating-container label {
    text-transform: uppercase; letter-spacing: 2px; color: #888; font-size: 0.85rem; margin-bottom: 10px;
}
.overall-rating-container label::after {
    content: " (Moyenne automatique)";
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--apricot);
    text-transform: none;
    letter-spacing: 1px;
    margin-top: 5px;
}
.big-rating-wrapper {
    display: flex; align-items: baseline; justify-content: center; gap: 8px;
}
.input-massive {
    background: transparent; border: none; border-bottom: 2px solid rgba(255,255,255,0.1);
    color: white; font-size: 3.5rem; font-weight: 800; width: 110px; text-align: center;
    transition: all 0.3s ease; outline: none; font-family: inherit;
}
.input-massive:focus {
    border-bottom-color: var(--apricot);
    text-shadow: 0 0 20px rgba(249, 155, 125, 0.4);
}
.input-massive[readonly] {
    cursor: default;
    color: var(--apricot);
    text-shadow: 0 0 15px rgba(249, 155, 125, 0.3);
}
.big-rating-suffix { font-size: 1.5rem; color: #555; font-weight: bold; }

/* 3. Lignes des sons (Hover effects) */
.tracks-title { text-align: center; font-size: 1.1rem; color: #aaa; margin-bottom: 20px; }
.track-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.02); padding: 12px 20px; border-radius: 12px; margin-bottom: 10px;
    transition: all 0.3s ease; border: 1px solid transparent;
}
.track-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(249, 155, 125, 0.2);
    transform: translateX(5px);
}
.track-info { display: flex; gap: 15px; align-items: center; }
.track-number { color: #555; font-weight: 800; font-size: 0.9rem; width: 25px; }
.track-name { font-weight: 500; font-size: 1.05rem; letter-spacing: 0.3px; }

/* 4. Champs de note individuels */
.track-actions { display: flex; gap: 20px; align-items: center; }
.rating-input-wrapper {
    display: flex; align-items: baseline; background: rgba(0,0,0,0.4);
    border-radius: 8px; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s ease; cursor: text;
}
.rating-input-wrapper:focus-within {
    border-color: var(--apricot);
    box-shadow: 0 0 12px rgba(249, 155, 125, 0.15);
    background: rgba(0,0,0,0.6);
}
.rating-input-wrapper input {
    background: transparent; border: none; color: white; font-weight: bold; font-size: 1.1rem;
    width: 35px; text-align: right; outline: none; padding: 0;
}
.rating-suffix { color: #666; font-size: 0.8rem; font-weight: bold; margin-left: 4px; }

/* 5. Bouton Cœur SVG */
.fav-btn { cursor: pointer; display: flex; align-items: center; justify-content: center; margin-top: 5px; }
.fav-checkbox { display: none; } 
.heart-icon {
    width: 26px; height: 26px;
    fill: transparent;
    stroke: #555;
    stroke-width: 1.5;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fav-btn:hover .heart-icon { stroke: var(--apricot); transform: scale(1.1); }
.fav-checkbox:checked + .heart-icon {
    fill: var(--magenta);
    stroke: var(--magenta);
    transform: scale(1.25);
    filter: drop-shadow(0 0 10px rgba(231, 29, 54, 0.6));
}

/* =========================================
   📱 RESPONSIVE DESIGN (Mobiles & Tablettes)
   ========================================= */

@media (max-width: 768px) {
    /* Marge globale réduite sur mobile */
    body {
        padding: 10px;
    }

    /* En-tête : on empile le titre et les boutons */
    .glass-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
        text-align: center;
    }

    /* La barre de recherche prend toute la largeur */
    .search-container {
        width: 100%;
    }

    /* Les cartes d'album s'adaptent mieux aux petits écrans */
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    /* Réduction des marges intérieures du formulaire */
    .glass-panel {
        padding: 20px 15px;
    }

    /* On rétrécit la note géante pour ne pas déborder */
    .input-massive {
        font-size: 2.5rem;
        width: 80px;
    }
    .big-rating-suffix {
        font-size: 1.2rem;
    }
}

/* Pour les très petits écrans (smartphones) */
@media (max-width: 480px) {
    /* Sur la ligne d'un son : on passe la note en dessous du titre */
    .track-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Les boutons d'action (note + coeur) prennent toute la largeur */
    .track-actions {
        width: 100%;
        justify-content: space-between;
    }

    /* Boutons légèrement plus petits */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Titre des albums dans le menu de recherche */
    .result-title {
        font-size: 1rem;
    }
}