/**
 * MODAL FULLSCREEN - MODE GAMMES
 * Modal pour afficher la gamme en grand écran
 */

/* ============================================
   OVERLAY ET CONTENEUR PRINCIPAL
   ============================================ */

.scale-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.scale-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.scale-modal-content {
    position: relative;
    width: 95%;
    max-width: 1800px;
    max-height: 90vh;
    background: #FFF8DC;
    border: 4px solid var(--bordure-principale);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* ============================================
   BOUTON FERMER
   ============================================ */

.scale-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: #808000;
    border: 2px solid #666600;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.scale-modal-close:hover {
    background: #666600;
    transform: scale(1.1);
}

.scale-modal-close:active {
    transform: scale(0.95);
}

/* ============================================
   HEADER
   ============================================ */

.scale-modal-header {
    padding: 2rem 4rem 1rem 2rem;
    background: #FFF8DC;
    border-bottom: 3px solid var(--bordure-principale);
}

.scale-modal-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 0;
}

/* ============================================
   BODY (contient l'instrument)
   ============================================ */

.scale-modal-body {
    flex: 1;
    overflow: auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scaleModalInstrument {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Ajuster le conteneur de l'instrument dans le modal */
#scaleModalInstrument .fretboard-scroll-wrapper,
#scaleModalInstrument .piano-interactive {
    width: 100%;
    overflow-x: auto;
}

/* Agrandir légèrement l'instrument dans le modal */
#scaleModalInstrument .fretboard-interactive {
    transform: scale(0.8);
    transform-origin: center center;
}

#scaleModalInstrument .piano-interactive {
    transform: scale(1);
    justify-content: center;
}

/* Scrollbar personnalisée pour le modal */
.scale-modal-body::-webkit-scrollbar,
#scaleModalInstrument .fretboard-scroll-wrapper::-webkit-scrollbar {
    height: 10px;
}

.scale-modal-body::-webkit-scrollbar-track,
#scaleModalInstrument .fretboard-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.scale-modal-body::-webkit-scrollbar-thumb,
#scaleModalInstrument .fretboard-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #808000;
    border-radius: 5px;
}

.scale-modal-body::-webkit-scrollbar-thumb:hover,
#scaleModalInstrument .fretboard-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #666600;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.scale-modal {
    animation: fadeIn 0.3s ease;
}

.scale-modal-content {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 47.9375rem) {
    .scale-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .scale-modal-header {
        padding: 1.5rem 3rem 1rem 1rem;
    }
    
    .scale-modal-title {
        font-size: 1.25rem;
    }
    
    .scale-modal-body {
        padding: 1rem;
    }
    
    .scale-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    /* Réduire encore plus l'instrument sur mobile */
    #scaleModalInstrument .fretboard-interactive {
        transform: scale(0.6);
    }
}

/* ============================================
   PRÉFÉRENCE MOUVEMENT RÉDUIT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .scale-modal,
    .scale-modal-content {
        animation: none;
    }
    
    .scale-modal-close {
        transition: none;
    }
}
