/* =====================================================================
   STYLES MODULAIRES POUR GRILLES MUSICALES
   
   Ce fichier contient les styles de base pour toutes les grilles.
   Les dimensions spécifiques sont gérées par grid-formats-config.js
   ===================================================================== */

/* Conteneur principal de la grille */
.composition-grid {
    display: grid;
    margin: 0 auto;
    width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: white;
}

/* Styles de base pour chaque vignette */
.vignette {
    background: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.1s ease;
    padding: 0;
}

/* État sélectionné */
.vignette.selected {
    border: 3px solid var(--primary-yellow);
    box-shadow: 0 0 20px rgba(238, 189, 64, 0.8);
    z-index: 5;
}

/* État en lecture */
.vignette.playing {
    xborder: 3px solid var(--success-green);
    box-shadow: 0 0 25px #eebd40;
    xanimation: highlightPlay 0.5s ease-in-out;
    z-index: 5;
}

@keyframes highlightPlay {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.vignette:active {
    cursor: pointer;
}

/* Image dans la vignette */
.vignette img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
    display: block;
}

/* Numéro de la vignette */
.vignette-number {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 20px;
    height: 20px;
    font-size: 14px;
    font-weight: bold;
    color: var(--black);
    background: var(--white);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

/* Bouton play sur chaque vignette */
.vignette-play-button {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eebd40;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    border: 2px solid #eebd40;
}

.vignette-play-button::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid var(--dark-bg);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    left: 50%;
    top: 50%;
    transform: translate(-30%, -50%);
}

.vignette-play-button:hover {
    background: #d4a93a;
    border: 2px solid #d4a93a;
    transform: scale(1.15);
}

/* =====================================================================
   RESPONSIVE - Adaptation mobile
   ===================================================================== */

@media (max-width: 768px) {
    .composition-grid {
        max-width: 100% !important;
        padding: 5px !important;
    }

    .vignette {
        max-height: 100px !important;
    }

    .vignette-number {
        width: 16px;
        height: 16px;
        font-size: 12px;
    }
    
    .vignette-play-button {
        width: 16px;
        height: 16px;
    }
}
