/* === Radiant Gradient Button (PRO) === */
.btn-primary,
.btn-upgrade {
    background: linear-gradient(90deg, #DD922E 0%, #2DD4BF 100%) !important;
    color: #0D1321 !important;
    border: none !important;
    box-shadow: 0 2px 8px 0 rgba(45, 212, 191, 0.10), 0 1.5px 6px 0 rgba(221, 146, 46, 0.10);
    transition: background 0.3s, color 0.3s, box-shadow 0.2s;
}
.btn-primary:hover:not(:disabled),
.btn-upgrade:hover:not(:disabled) {
    background: linear-gradient(90deg, #2DD4BF 0%, #DD922E 100%) !important;
    color: #0D1321 !important;
    filter: brightness(1.08);
    box-shadow: 0 4px 16px 0 rgba(45, 212, 191, 0.18), 0 2px 8px 0 rgba(221, 146, 46, 0.13);
}
.btn-primary:disabled,
.btn-upgrade:disabled {
    opacity: 0.6;
    background: linear-gradient(90deg, #bdbdbd 0%, #e0e0e0 100%) !important;
    color: #888 !important;
    cursor: not-allowed;
}

/* Les boutons secondaires restent sobres */
.btn-secondary {
    background: transparent !important;
    border: 1px solid #4C8E88 !important;
    color: #4C8E88 !important;
    box-shadow: none !important;
}
.btn-secondary:hover:not(:disabled) {
    background: #4C8E88 !important;
    color: #0D1321 !important;
}

/* Les boutons de danger restent rouges, sans radiant */
.btn-destructive {
    background: #CC5555 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}
.btn-destructive:hover:not(:disabled) {
    background: #e57373 !important;
    color: #fff !important;
}

/* Tabs : radiant uniquement en soulignement sur l'actif */
.tab-btn {
    background: transparent !important;
    color: #4C8E88 !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
}
.tab-btn.active {
    color: #DD922E !important;
}
.tab-btn.active::after {
    content: '';
    display: block;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, #DD922E 0%, #2DD4BF 100%);
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    z-index: 2;
}
/* Ensure the page can grow and scroll when needed. Removing global overflow:hidden
   which was hiding content (e.g. dashboard statistics) on smaller viewports. */

/* Force hidden attribute to work even with conflicting CSS */
[hidden] {
    display: none !important;
}

:root {
    /* Header height used for scroll padding when navigating to anchors */
    --app-header-height: 64px;
    
    /* Safe area insets for devices with notch/home indicator - only apply in native apps */
    --safe-area-top: 0px;
    --safe-area-bottom: 0px;
    --safe-area-left: 0px;
    --safe-area-right: 0px;
}

/* For native apps with notch/home indicator, use safe area insets */
@supports (padding-top: env(safe-area-inset-top)) {
    :root {
        --safe-area-top: env(safe-area-inset-top, 0px);
        --safe-area-bottom: env(safe-area-inset-bottom, 0px);
        --safe-area-left: env(safe-area-inset-left, 0px);
        --safe-area-right: env(safe-area-inset-right, 0px);
    }
}

/* ===== Mobile Floating Action Bar ===== */
#mobile-action-bar {
    /* Ensure it's above other content but below modals */
    z-index: 40;
    /* Smooth entrance animation */
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Play button pulse effect when ready */
#btn-play-mobile:not(:disabled),
#btn-play-pause:not(:disabled) {
    animation: pulse-ready 2s infinite;
}

@keyframes pulse-ready {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* Ensure floating bar doesn't overlap with lyrics display */
#lyrics-display-container:not(.hidden) ~ #mobile-action-bar,
.has-lyrics-visible #mobile-action-bar {
    bottom: 10rem; /* Move up when lyrics are visible */
}

/* App layout: prevent the document body from scrolling and let the
   in-app main area handle scrolling. This avoids two vertical
   scrollbars and ensures the header does not overlap content when
   navigating to anchors. */
html, body {
    height: 100%;
    overflow: hidden; /* document-level scroll disabled */
    overflow-x: hidden; /* ensure no horizontal document scroll */
    /* hide any native scrollbars on the document level */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

/* Hide webkit scrollbars on html/body only (keeps main scrollbar visible) */
html::-webkit-scrollbar, body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

/* The top-level app container (in base.html) uses .h-screen; make it
   take full viewport height and hide overflow so inner <main> can scroll. */
body > .h-screen {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow: hidden; /* keep outer container from scrolling */
}

/* Main content area - no scrolling here, let children handle it */
body > .h-screen > main {
    overflow: hidden; /* Disable scrolling on main - grid-container handles it */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: var(--app-header-height);
    flex: 1;
    min-height: 0; /* Important for flex children to shrink properly */
}

/* The grid container is the actual scrollable area for the piano roll */
#grid-container {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0; /* Allow shrinking in flex context */
}

/* Hide scrollbar on grid-container for cleaner look, but keep scrolling functional */
#grid-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#grid-container::-webkit-scrollbar-track { background: transparent; }
#grid-container::-webkit-scrollbar-thumb { background: rgba(76,142,136,0.4); border-radius: 4px; }
#grid-container { scrollbar-color: rgba(76,142,136,0.4) transparent; scrollbar-width: thin; }

/* Safe area support for native apps */
@supports (padding-top: env(safe-area-inset-top)) {
    body > .h-screen > header,
    header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem) !important;
    }
    body > .h-screen > footer,
    body > .h-screen footer {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* Padding minimum pour le header même sans safe-area */
header {
    padding-top: 0.75rem;
}
/* Style pour les titres principaux (ex: "harmonease-moi!", "Connexion") */
.page-title {
    color: #DD922E; /* Carrot Orange */
    font-weight: bold;
}

/* Style pour les liens dans les formulaires (S'inscrire / Se connecter) */
.form-link {
    color: #F0EBD8; /* Eggshell */
    text-decoration: none;
    transition: color 0.2s;
}
.form-link:hover {
    color: #DD922E; /* Carrot Orange */
    text-decoration: underline;
}

#app-loader {
    transition: opacity 0.5s ease-in-out;
}

#app-loader.hidden {
    opacity: 0;
    pointer-events: none; /* Empêche de cliquer dessus pendant la disparition */
}

/* Pour les actions "Premium" (Mettre à niveau) */
.btn-upgrade { 
    background-color: #2DD4BF; /* Turquoise vif */
    color: #0D1321; /* Rich Black pour un contraste maximal */
    border-color: #2DD4BF;
}
.btn-upgrade:hover {
    background-color: #5EEAD4; /* Une version plus claire au survol */
}

.sound-wave-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    gap: 8px; /* Espace entre les barres */
}

.sound-wave-loader .bar {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #F0EBD8; /* Eggshell */
    animation: wave-animation 1.2s ease-in-out infinite;
}

/* On applique un délai d'animation différent à chaque barre pour créer l'effet de vague */
.sound-wave-loader .bar:nth-child(2) {
    animation-delay: -1.0s;
}
.sound-wave-loader .bar:nth-child(3) {
    animation-delay: -0.8s;
}
.sound-wave-loader .bar:nth-child(4) {
    animation-delay: -0.6s;
}
.sound-wave-loader .bar:nth-child(5) {
    animation-delay: -0.4s;
}
@keyframes wave-animation {
    0%, 100% {
        transform: scaleY(1);
        background-color: #4C8E88; /* Wintergreen Dream */
    }
    50% {
        transform: scaleY(5); /* Hauteur maximale de la barre */
        background-color: #DD922E; /* Carrot Orange */
    }
}

body { font-family: 'Inter', sans-serif; cursor: default; }
#playback-cursor, #mouse-time-cursor { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 50; pointer-events: none; }
#playback-cursor { background-color: rgba(255, 215, 0, 0.8); }
#mouse-time-cursor { background-color: rgba(255, 255, 255, 0.4); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none;  scrollbar-width: none; }
#loader { border: 4px solid #F0EBD8; border-top: 4px solid #4C8E88; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.recording-pulse { animation: pulse 1.5s infinite; background-color: rgba(239, 68, 68, 0.85) !important; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
#countdown-overlay { z-index: 1000; }
.form-checkbox:checked { background-color: currentColor; }



/* On ajuste la couleur du texte pour les boutons actifs pour une meilleure lisibilité */
.voice-toggle-btn.active {
    color: #0D1321; /* Rich Black */
}



canvas { cursor: default; }

/* Harmonisation du style pad actif (version charte) */
.pad-active {
    background-color: #DD922E; /* Carrot Orange */
    color: #0D1321; /* Rich Black */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 3px #F0EBD8;
    transform: scale(0.95);
}
@media (max-width: 768px) {
    footer {
        transform: translateY(0);
    }
    
    #app-container {
        padding-top: 0px;
        padding-bottom: 0px;
    }
    
    /* Dashboard specific - ensure content doesn't get cut off by Android nav bar */
    body.dashboard-page #app-container,
    body.dashboard-page .dashboard-content,
    #tab-content-profile,
    #tab-content-group,
    #tab-content-projets,
    #tab-content-playlists,
    #tab-content-subscriptions {
        padding-bottom: calc(var(--safe-area-bottom, 0px) + 80px);
    }

    /* Mobile modal styles - make modals scrollable and fit screen */
    /* Only apply to visible modals (not hidden ones) */
    [id$="-modal"]:not(.hidden) {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Account for safe areas (notch, home indicator) */
        padding: 1rem !important;
        padding-top: calc(var(--safe-area-top, 0px) + 0.5rem) !important;
        padding-bottom: calc(var(--safe-area-bottom, 0px) + 0.5rem) !important;
        /* Center content properly */
        align-items: center !important;
        justify-content: center !important;
    }

    [id$="-modal"]:not(.hidden) > div {
        max-height: calc(100vh - var(--safe-area-top, 0px) - var(--safe-area-bottom, 0px) - 2rem) !important;
        max-height: calc(100dvh - var(--safe-area-top, 0px) - var(--safe-area-bottom, 0px) - 2rem) !important;
        overflow-y: auto !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Reduce modal padding on mobile */
    [id$="-modal"]:not(.hidden) > div > .p-6,
    [id$="-modal"]:not(.hidden) > div[class*="p-6"] {
        padding: 1rem !important;
    }
    
    /* Reduce form spacing on mobile */
    [id$="-modal"] .space-y-4 {
        gap: 0.75rem;
    }
    
    [id$="-modal"] .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
}

/* On cible le conteneur principal du piano roll */
#grid-container::-webkit-scrollbar {
    width: 8px;  /* Largeur de la barre verticale */
    height: 8px; /* Hauteur de la barre horizontale */
}

/* La piste (le fond de la barre) */
#grid-container::-webkit-scrollbar-track {
    background: #1D2D44; /* Prussian Blue */
}

/* La poignée (la partie déplaçable) */
#grid-container::-webkit-scrollbar-thumb {
    background-color: #4C8E88; /* Wintergreen Dream */
    border-radius: 10px;
    border: 2px solid #1D2D44; /* Prussian Blue */
}

/* La poignée au survol de la souris */
#grid-container::-webkit-scrollbar-thumb:hover {
    background-color: #F0EBD8; /* Eggshell pour hover */
}
.status-overlay-text {
    text-align: center;
    display: flex;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #F0EBD8;
    align-items: center;
    height: 100%;
}
#settings-sidebar {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* On ajoute 'opacity' à la transition */
    /* Assurez-vous que l'état par défaut (caché) a une opacité de 0 */
    opacity: 0;
    /* Force le positionnement en haut même en mode simple avec étapes */
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: env(safe-area-inset-top, 0) !important;
}

/* Quand la sidebar est visible (sans la classe -translate-x-full), on la rend opaque */
#settings-sidebar:not(.-translate-x-full) {
    opacity: 1;
}
/* Style par défaut du conteneur (caché et prêt pour l'animation) */
#chord-pads-container {
    transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
    opacity: 0;
    transform: translateY(15px) scale(0.98); /* Commence un peu plus bas et plus petit */
    pointer-events: none; /* Non cliquable quand il est invisible */
    visibility: hidden;   /* Complètement caché et ignoré */
}

/* En mode simple, positionner le pad en haut */
.mode-simple #chord-pads-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-bottom: 2px solid rgba(76, 142, 136, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 50vh;
    overflow-y: auto;
}

/* Style quand le conteneur doit être visible */
#chord-pads-container.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto; /* Il redevient cliquable */
    visibility: visible;
}
#btn-metronome.active {
    background-color: #4C8E88; /* Wintergreen Dream pour ON */
    color: #FFFFFF;
}

body {
    background-color: #0D1321; /* Rich Black */
    color: #F0EBD8; /* Eggshell */
    font-family: 'Inter', sans-serif;
    cursor: default;
    /* allow page scrolling instead of clipping content */
    min-height: 100%;
}

.btn {
    padding: 0.75rem 1rem; /* p-3/px-4 */
    border-radius: 0.5rem; /* rounded-lg */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em; /* tracking-wider */
    transition: all 0.2s ease-in-out;
    transform: translateY(0);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.btn:disabled {
    background-color: #4A5568; /* Gris pour désactivé */
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- Couleurs Sémantiques --- */
/* Pour les actions principales (Connexion, Inscription, Sauver) */
.btn-primary { background-color: #DD922E; color: #0D1321; } /* Carrot Orange */

/* Pour les actions positives (Play, Live, Commencer) */
.btn-positive { background-color: #4C8E88; color: #FFFFFF; } /* Wintergreen Dream */

/* Pour les actions de danger/arrêt (Stop, Logout, Reset) */
.btn-destructive { background-color: #CC5555; color: #FFFFFF; } /* Rouge UX */

/* Pour les actions secondaires (Charger, Importer) */
.btn-secondary { background-color: transparent; border-color: #4C8E88; color: #F0EBD8; }
.btn-secondary:hover { background-color: #4C8E88; color: #0D1321; }


/* --- Styles pour les boutons-icônes (Logout, Aide) --- */
.btn-icon {
    width: 2.5rem; /* w-10 */
    height: 2.5rem; /* h-10 */
    border-radius: 9999px; /* rounded-full */
    background-color: #1D2D44; /* Prussian Blue */
    color: #F0EBD8; /* Eggshell */
    font-size: 1.125rem; /* text-lg */
}
.btn-icon:hover {
    background-color: #4C8E88;
    color: #FFFFFF;
}
.btn-icon .fa-power-off {
  color: #CC5555; /* Rouge UX pour l'icône logout */
}

/* Style pour un bouton d'icône désactivé */
.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    /* On s'assure qu'il n'y a pas d'effet de survol */
    background-color: #1D2D44 !important; 
}

/* On cible l'icône à l'intérieur du bouton désactivé */
.btn-icon:disabled .fa-trash-alt {
    color: #4A5568; /* Couleur grise pour l'icône */
}

/*
  Assure que l'icône à l'intérieur du bouton de déconnexion
  est toujours parfaitement centrée.
*/
#btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === INTERFACE PRINCIPALE === */
.header { background-color: #1D2D44; /* Prussian Blue */ }
.footer { background-color: #1D2D44; }
.sidebar { background-color: #1D2D44; }
.modal-bg { background-color: #1D2D44; }

/* Header mobile improvements */
header {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
header::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Ensure header buttons don't shrink too much on mobile */
@media (max-width: 768px) {
    header {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    header button, header .btn {
        flex-shrink: 0;
    }
    header .flex-grow {
        flex-grow: 0;
        flex-shrink: 0;
    }
}

/* Footer mobile improvements */
footer {
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    footer {
        padding: 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    footer > div {
        flex-shrink: 0;
    }
}

/* Titre principal dans le header */
.header-title { color: #DD922E; /* Carrot Orange */ }

/* Style de base pour tous les champs (input, select) */
.form-input {
    width: 100%;
    background-color: #1D2D44; /* Prussian Blue */
    color: #F0EBD8;           /* Eggshell */
    border: 1px solid #4C8E88;  /* Wintergreen Dream */
    border-radius: 0.5rem;      /* rounded-lg */
    padding: 0.75rem;           /* p-3 */
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* BPM input spécifique - taille optimisée */
#bpm-input {
    width: 4rem !important;
    max-width: 4rem !important;
    padding: 0.5rem 0.25rem;
    height: 2.25rem;
    line-height: 1.25rem;
}
@media (min-width: 768px) {
    #bpm-input {
        width: 4.5rem !important;
        max-width: 4.5rem !important;
        height: 2.5rem;
    }
}

/* Time signature select - taille harmonisée */
#time-signature-select {
    width: 3.5rem !important;
    min-width: 3.5rem !important;
    padding-left: 0.375rem;
    padding-right: 1.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
@media (min-width: 768px) {
    #time-signature-select {
        width: 4rem !important;
        min-width: 4rem !important;
        height: 2.5rem;
    }
}

/* Tonality select - taille harmonisée */
#tonality-select {
    width: 3rem !important;
    min-width: 3rem !important;
    padding-left: 0.375rem;
    padding-right: 1.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
@media (min-width: 768px) {
    #tonality-select {
        width: 3.5rem !important;
        min-width: 3.5rem !important;
        height: 2.5rem;
    }
}

.form-input:focus {
    outline: none;
    border-color: #DD922E; /* Carrot Orange */
    box-shadow: 0 0 0 3px rgba(221, 146, 46, 0.4);
}

/* Style de base pour les menus déroulants */
.form-select {
    -webkit-appearance: none; /* Retire le style par défaut sur Chrome/Safari */
    -moz-appearance: none;    /* Retire le style par défaut sur Firefox */
    appearance: none;         /* Retire le style par défaut standard */

    /* Couleurs de votre charte graphique */
    background-color: #1D2D44; /* Prussian Blue */
    border: 1px solid #4C8E88;  /* Wintergreen Dream */
    color: #F0EBD8;           /* Eggshell */
    border-radius: 0.5rem;      /* rounded-lg - LA CLÉ POUR LES ANGLES ARRONDIS */
    padding: 0.75rem;           /* p-3 */
    
    /* Ajout d'une flèche personnalisée */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23F0EBD8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Laisse de la place pour la flèche */
}

/* Style au focus, pour la cohérence */
.form-select:focus {
    outline: none;
    border-color: #DD922E; /* Carrot Orange */
    box-shadow: 0 0 0 3px rgba(221, 146, 46, 0.4);
}

/* Tentative de style pour les options du dropdown */
.form-select option {
    background: #1D2D44; /* Prussian Blue */
    color: #F0EBD8;      /* Eggshell */
}


/* Style pour l'option survolée ou sélectionnée (ne fonctionne pas partout !) */
.form-select option:checked, .form-select option:hover {
    background: #DD922E; /* Carrot Orange */
    color: #0D1321;      /* Rich Black */
}

/* Style pour les champs avec icônes (inchangé) */
.form-input-with-icon {
    padding-left: 2.5rem;
}


/* Boutons de mode (Practice/Create/Progrès) */
.mode-btn {
    background-color: #1D2D44; /* Prussian Blue (inactif) */
    color: #F0EBD8; /* Eggshell */
    transition: all 0.2s ease-in-out; /* On ajoute une transition */
    border: 1px solid #1D2D44; /* Bordure de la même couleur */
}

/* NOUVEAU : Style au survol de la souris */
.mode-btn:hover {
    border-color: #4C8E88; /* Bordure Wintergreen */
    filter: brightness(1.2); /* On éclaircit légèrement */
}

/* Style du bouton actif (quand on a cliqué dessus) */
.mode-btn.active {
    background-color: #DD922E; /* Carrot Orange */
    color: #0D1321; /* Rich Black */
    border-color: #DD922E; /* Bordure de la même couleur */
    box-shadow: 0 0 10px rgba(221, 146, 46, 0.5); /* Lueur orange */
}

/* Couleurs pour les statistiques du Dashboard */
.stat-projects { color: #DD922E; }
.stat-sessions { color: #4C8E88; }
.stat-score { color: #F0EBD8; }
.stat-pupitre { color: #7DBDAD; } /* Nuance de Wintergreen pour varier */


/* Animation de chargement */
#loader { border: 4px solid #1D2D44; border-top: 4px solid #4C8E88; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


#btn-save-project:disabled,
#btn-load-project:disabled,
#btn-mode-practices:disabled,
#btn-mode-progress:disabled {
  cursor: not-allowed;
}




/* ============================================
   VOICE ROLLER 3D COMPONENT
   ============================================ */

.voice-roller-wrapper {
    position: relative;
    height: 36px;
    width: 100px;
    perspective: 200px;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    background: linear-gradient(180deg, 
        rgba(29, 45, 68, 0.9) 0%, 
        rgba(29, 45, 68, 0.6) 20%,
        rgba(29, 45, 68, 0.3) 50%,
        rgba(29, 45, 68, 0.6) 80%,
        rgba(29, 45, 68, 0.9) 100%);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.voice-roller-wrapper::before,
.voice-roller-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    pointer-events: none;
    z-index: 10;
}

.voice-roller-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom, #1D2D44, transparent);
}

.voice-roller-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top, #1D2D44, transparent);
}

.voice-roller {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.voice-roller-item {
    position: absolute;
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #F0EBD8;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: color 0.3s, text-shadow 0.3s;
}

.voice-roller-item.active {
    color: #4C8E88;
    text-shadow: 0 0 8px rgba(76, 142, 136, 0.5);
}

.voice-roller-item.Tous.active { color: #F0EBD8; text-shadow: 0 0 8px rgba(240, 235, 216, 0.4); }
.voice-roller-item.Soprano.active { color: #7DBDAD; text-shadow: 0 0 8px rgba(125, 189, 173, 0.5); }
.voice-roller-item.Alto.active { color: #DD922E; text-shadow: 0 0 8px rgba(221, 146, 46, 0.5); }
.voice-roller-item.Ténor.active { color: #5D8AA8; text-shadow: 0 0 8px rgba(93, 138, 168, 0.5); }

/* Focus indicator */
.voice-roller-wrapper.focused {
    box-shadow: 0 0 0 2px #4C8E88, inset 0 0 10px rgba(76, 142, 136, 0.2);
}

/* Legacy support - keep old classes but hide */
.voice-toggle-btn {
    display: none;
}
/* On cache les éléments inutiles en mode practice */
.mode-practice #chord-track-container,
.mode-practice #btn-generate-harmonies-group,
.mode-practice #btn-save-project,
.mode-practice #btn-export-midi,
.mode-practice #btn-import-chords,
.mode-practice #btn-apply-autotune,
.mode-practice #btn-mode-live,
.mode-practice #btn-mode-upload,
.mode-practice #btn-action-start,
.mode-practice #btn-record-pads,
.mode-practice #chord-pads-container,
.mode-practice #btn-play-pause,
.mode-practice #btn-stop,
.mode-practice #btn-action-start-mobile,
.mode-practice #btn-toggle-pads,
.mode-practice #btn-record,
.mode-practice #btn-mode-live-mobile {
    display: none !important; /* On force le masquage */
}
/* Masque tous les éléments "étiquetés" quand on est en mode Pratique */
.mode-practice .hide-in-practice-mode {
    display: none !important;
}

/* Masque tous les éléments "étiquetés" quand on est en mode Autonome */
.mode-autonome .hide-in-autonome-mode {
    display: none;
}

/* Affiche les éléments UNIQUEMENT en mode Autonome */
.show-only-in-autonome-mode {
    display: none !important;
}
.mode-autonome .show-only-in-autonome-mode {
    display: flex !important;
}

/* On change le curseur pour montrer que le piano roll n'est pas cliquable */
.mode-practice #piano-roll-canvas {
    cursor: default;
}

.mode-practice #bpm-input,
.mode-practice #tonality-select {
    pointer-events: none; /* Désactive les clics et autres interactions */
    background-color: #1D2D44; /* Fond plus neutre pour indiquer l'inactivité */
    opacity: 0.7; /* Apparence légèrement estompée */
}

/* Masque la flèche du menu déroulant en mode pratique pour qu'il ressemble à un simple affichage */
.mode-practice #tonality-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    padding-right: 0.75rem; /* Ajuste le padding qui compensait la flèche */
}

#btn-start-exercise {
    display: none;
}
/* Affiche le bouton uniquement en mode Pratique */
.mode-practice #btn-start-exercise {
    display: inline-flex; /* ou 'block' selon votre préférence */
}
#btn-action-start.is-pressing {
    transform: scale(1.1);
    box-shadow: 0 0 20px #4C8E88;
    transition: transform 0.1s ease-out;
}
/* Style par défaut du bouton (pas d'enregistrement) */
#btn-action-start-mobile .icon-mic { display: inline-block; }
#btn-action-start-mobile .icon-stop { display: none; }

/* Style du bouton quand il a la classe .is-recording */
#btn-action-start-mobile.is-recording .icon-mic { display: none; }
#btn-action-start-mobile.is-recording .icon-stop { display: inline-block; }

/* On gère aussi la couleur et la pulsation ici */
#btn-action-start-mobile.is-recording {
    background-color: #DD922E;
    animation: pulse 1.5s infinite;
}
.practice-step {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #4A5568;
    transition: all 0.2s ease-in-out;
}

.step-completed {
    background-color: #4C8E88;
    border-color: #4C8E88;
    opacity: 0.7;
}
.step-completed::before {
    content: '✓ ';
    font-weight: bold;
}

.step-active {
    background-color: #1D2D44; /* On garde le fond sombre pour la lisibilité */
    border-color: #DD922E; /* Bordure Carrot Orange */
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(221, 146, 46, 0.5); 
}

.step-upcoming {
    background-color: #0D1321; /* Rich Black */
}
#bravo-animation .confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00; /* Sera changé par le JS */
    opacity: 0.7;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}
#coach-mark-arrow {
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
}
/* On cache le bouton par défaut */
#btn-show-practice-steps {
    display: none;
}

/* On l'affiche seulement si le body a la classe .mode-practice */
.mode-practice #btn-show-practice-steps {
    display: flex; 
}
/*
    * Thème personnalisé pour Shepherd.js (Version corrigée)
    * basé sur votre charte graphique.
*/

/* Reset des styles par défaut de Shepherd */
.shepherd-element {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.shepherd-content {
    background: transparent !important;
    border: none !important;
}

/* Conteneur principal de l'infobulle */
.shepherd-element.shepherd-theme-custom {
    background-color: #1f2937 !important; /* gray-800 */
    border: 2px solid #14b8a6 !important; /* teal-500 */
    border-radius: 0.75rem !important;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4), 0 10px 10px -5px rgba(0,0,0,0.2) !important;
    max-width: 320px !important;
    z-index: 10000 !important;
}

/* En-tête (titre) */
.shepherd-theme-custom .shepherd-header {
    background-color: #374151 !important; /* gray-700 */
    padding: 0.875rem 1rem !important;
    border-bottom: 1px solid #4b5563 !important; /* gray-600 */
    border-radius: 0.65rem 0.65rem 0 0 !important;
}

.shepherd-theme-custom .shepherd-title {
    color: #f9fafb !important; /* gray-50 */
    font-weight: 700 !important;
    font-size: 1rem !important;
}

/* Icône pour fermer */
.shepherd-theme-custom .shepherd-cancel-icon {
    color: #9ca3af !important; /* gray-400 */
    font-size: 1.25rem !important;
    opacity: 1 !important;
}
.shepherd-theme-custom .shepherd-cancel-icon:hover {
    color: #14b8a6 !important; /* teal-500 */
}

/* Texte principal */
.shepherd-theme-custom .shepherd-text {
    color: #d1d5db !important; /* gray-300 */
    padding: 1rem !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
    background-color: #1f2937 !important; /* gray-800 */
}

/* Footer */
.shepherd-theme-custom .shepherd-footer {
    background-color: #1f2937 !important; /* gray-800 */
    padding: 0.75rem 1rem !important;
    border-top: 1px solid #374151 !important;
    border-radius: 0 0 0.65rem 0.65rem !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
}

/* Style général des boutons */
.shepherd-theme-custom .shepherd-button {
    transition: all 0.2s ease-in-out !important;
    transform: translateY(0) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
}

.shepherd-theme-custom .shepherd-button:hover {
    transform: translateY(-1px) !important;
}

/* Bouton principal (Suivant / Terminer) */
.shepherd-theme-custom .shepherd-button:not(.shepherd-button-secondary) {
    background-color: #14b8a6 !important; /* teal-500 */
    color: #ffffff !important;
    border: none !important;
}
.shepherd-theme-custom .shepherd-button:not(.shepherd-button-secondary):hover {
    background-color: #0d9488 !important; /* teal-600 */
}

/* Bouton secondaire (Précédent) */
.shepherd-theme-custom .shepherd-button.shepherd-button-secondary {
    background-color: transparent !important;
    color: #9ca3af !important; /* gray-400 */
    border: 1px solid #4b5563 !important; /* gray-600 */
}
.shepherd-theme-custom .shepherd-button.shepherd-button-secondary:hover {
    background-color: #374151 !important; /* gray-700 */
    color: #f9fafb !important;
}

/* Style de la flèche */
.shepherd-theme-custom .shepherd-arrow,
.shepherd-theme-custom .shepherd-arrow::before {
    background-color: #1f2937 !important;
    border-color: #14b8a6 !important;
}

.shepherd-theme-custom.shepherd-has-arrow[data-popper-placement^='bottom'] > .shepherd-arrow::before {
    background-color: #374151 !important;
    border-color: #14b8a6 !important;
}

.shepherd-theme-custom.shepherd-has-arrow[data-popper-placement^='top'] > .shepherd-arrow::before {
    background-color: #1f2937 !important;
    border-color: #14b8a6 !important;
}

.shepherd-theme-custom.shepherd-has-arrow[data-popper-placement^='right'] > .shepherd-arrow::before {
    background-color: #1f2937 !important;
    border-color: #14b8a6 !important;
}

.shepherd-theme-custom.shepherd-has-arrow[data-popper-placement^='left'] > .shepherd-arrow::before {
    background-color: #1f2937 !important;
    border-color: #14b8a6 !important;
}

/* Modal overlay */
.shepherd-modal-overlay-container {
    fill: rgba(0, 0, 0, 0.6) !important;
}

/* === SHEPHERD MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    /* Conteneur principal - adapté mobile mais garde le positionnement */
    .shepherd-element.shepherd-theme-custom {
        max-width: calc(100vw - 2rem) !important;
        width: auto !important;
        min-width: 280px !important;
        border-radius: 0.75rem !important;
        /* Garder le positionnement naturel de Shepherd */
    }
    
    /* Garder la flèche pour indiquer l'élément */
    .shepherd-theme-custom .shepherd-arrow {
        display: block !important;
    }
    
    /* En-tête */
    .shepherd-theme-custom .shepherd-header {
        padding: 1rem 1.25rem !important;
    }
    
    /* Titre */
    .shepherd-theme-custom .shepherd-title {
        font-size: 1.125rem !important;
        font-weight: 700 !important;
    }
    
    /* Texte */
    .shepherd-theme-custom .shepherd-text {
        padding: 1rem 1.25rem !important;
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }
    
    /* Footer des boutons */
    .shepherd-theme-custom .shepherd-footer {
        padding: 1rem 1.25rem !important;
        gap: 0.75rem !important;
        flex-wrap: nowrap !important;
    }
    
    /* Boutons */
    .shepherd-theme-custom .shepherd-button {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
        flex: 1 !important;
        text-align: center !important;
    }
    
    /* Icône de fermeture plus grande pour le tactile */
    .shepherd-theme-custom .shepherd-cancel-icon {
        font-size: 1.75rem !important;
        padding: 0.5rem !important;
        position: absolute !important;
        right: 0.5rem !important;
        top: 0.5rem !important;
    }
}


/* === BOUTONS DE MODE === */
.btn-mode-group .btn-mode-item {
    background-color: #1D2D44; /* Prussian Blue (inactif) */
    color: #F0EBD8; /* Eggshell */
    border-color: #4A5568; /* Gris */
}
.btn-mode-group .btn-mode-item:hover {
    background-color: #2c4463; /* Prussian Blue plus clair */
}
.btn-mode-group .btn-mode-item.active {
    background-color: #4C8E88; /* Wintergreen Dream (actif) */
    color: #FFFFFF;
    border-color: #4C8E88;
}


/* On retire l'apparence par défaut pour pouvoir la personnaliser */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px; /* Hauteur de la barre */
    background: #1D2D44; /* Prussian Blue pour le fond de la barre */
    border-radius: 5px;
    outline: none;
}

/* Style du curseur (la "poignée") pour Chrome, Safari, Edge */
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #DD922E; /* Carrot Orange */
    cursor: pointer;
    border: 2px solid #F0EBD8; /* Bordure Eggshell */
    transition: transform 0.2s, box-shadow 0.2s;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(221, 146, 46, 0.5); /* Lueur Carrot Orange */
}

/* Style du curseur (la "poignée") pour Firefox */
.custom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #DD922E; /* Carrot Orange */
    cursor: pointer;
    border: 2px solid #F0EBD8; /* Bordure Eggshell */
    transition: transform 0.2s, box-shadow 0.2s;
}

.custom-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(221, 146, 46, 0.5); /* Lueur Carrot Orange */
}




.chord-pad {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem; /* rounded-lg */
    font-weight: bold;
    font-size: 1.25rem; /* text-xl */
    transition: all 0.2s ease-in-out;
    transform: scale(1);

    /* On utilise les couleurs de la charte */
    background-color: #1D2D44; /* Prussian Blue */
    color: #F0EBD8; /* Eggshell */
    border: 1px solid #4A5568; /* Gris neutre */
}

/* Transition fluide pour le collapse/expand du pad grid */
#pads-grid {
    transition: all 0.3s ease-in-out;
    max-height: 500px; /* Hauteur maximale quand visible */
    opacity: 1;
}

#pads-grid.hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.chord-pad:hover {
    transform: scale(1.05);
    border-color: #DD922E; /* Carrot Orange */
}

/* On met aussi à jour le style du pad ACTIF */
.pad-active {
    background-color: #DD922E; /* Carrot Orange */
    color: #0D1321; /* Rich Black */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 3px #F0EBD8; /* Ombre intérieure et bordure Eggshell */
    transform: scale(0.95);
}


.actions-menu {
    position: absolute; /* Se positionne par rapport au plus proche parent positionné */
    z-index: 100; /* S'affiche au-dessus des autres éléments */
    background-color: #1D2D44; /* Prussian Blue */
    border: 1px solid #4C8E88; /* Wintergreen Dream */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: 180px; /* Largeur fixe */
    padding: 0.5rem 0; /* py-2 */
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    pointer-events: none; /* Non cliquable quand il est caché */
}

.actions-menu.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.actions-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem; /* px-4 py-3 */
    font-size: 0.875rem; /* text-sm */
    color: #F0EBD8; /* Eggshell */
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.actions-menu-item:hover {
    background-color: #4C8E88; /* Wintergreen Dream */
    color: #FFFFFF;
}

.actions-menu-item i {
    margin-right: 0.75rem; /* mr-3 */
    width: 16px; /* Pour l'alignement */
}

/* Fichier : static/css/custom.css */

/* --- CENTRAGE DU FORMULAIRE --- */
/* Appliquez ceci au conteneur de votre formulaire pour le centrer */
/* Par exemple, si votre formulaire a un id="login-form" */
#login-form {
    display: flex;
    flex-direction: column; /* Aligne les éléments verticalement */
    align-items: center;   /* Centre les éléments horizontalement */
}

/* Conteneur principal - LA CORRECTION CLÉ EST ICI */
.custom-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
    position: relative; /* ESSENTIEL : Définit le contexte de positionnement pour la coche */
}

/* On masque la case à cocher par défaut */
.custom-checkbox-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

/* Le texte du label */
.custom-checkbox-container label {
    /* --- LA SOLUTION SIMPLE ET LISIBLE --- */
    color: #F0EBD8; /* EGGSHELL : Texte clair pour un contraste parfait */
    
    font-weight: 500;
    padding-left: 32px;
    line-height: 24px;
    
    /* On peut supprimer le text-shadow, il n'est plus nécessaire */
    text-shadow: none; 
}

/* La fausse case (le carré) */
.custom-checkbox-container label::before {
    content: '';
    display: inline-block;
    position: absolute; /* On la positionne par rapport au conteneur */
    left: 0;
    top: 0;
    
    width: 20px;
    height: 20px;
    
    /* Couleurs de votre charte */
    background-color: #F0EBD8; /* EGGSHELL */
    border: 2px solid #1D2D44; /* PRUSSIAN BLUE */
    border-radius: 4px;
    
    transition: all 0.2s ease;
}

/* Quand la case est cochée, on change la couleur de la fausse case */
.custom-checkbox-container input[type="checkbox"]:checked + label::before {
    background-color: #1D2D44; /* PRUSSIAN BLUE */
    border-color: #DD922E;   /* CARROT ORANGE */
}

/* La coche ("V") qui apparaît - CORRIGÉE */
.custom-checkbox-container input[type="checkbox"]:checked + label::after {
    content: '';
    display: block;
    position: absolute;
    
    /* Positionnement de la coche DANS la fausse case */
    left: 7px;
    top: 4px;

    /* Création de la forme de la coche */
    width: 6px;
    height: 12px;
    border: solid #DD922E; /* CARROT ORANGE */
    border-width: 0 3px 3px 0;
    
    transform: rotate(45deg);
}





/* --- SYSTÈME DE TRANSITIONS --- */

/* Classe de base à ajouter à tout élément que vous souhaitez animer.
  Elle définit la durée et la courbe de l'animation.
*/
.transitionable {
  transition-property: opacity, transform; /* On anime l'opacité et la taille/position */
  transition-duration: 300ms; /* Durée par défaut de 300ms */
  transition-timing-function: ease-in-out; /* Courbe de vitesse douce */
}

/*
  État "caché" : l'élément est invisible et légèrement réduit.
  'pointer-events-none' est crucial pour qu'on ne puisse pas cliquer dessus.
*/
.is-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* État "visible" : l'élément est entièrement visible et à sa taille normale.
*/
.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto; /* On réactive les clics */
}

/*
  Pour les fonds de modal (le noir semi-transparent), on n'anime que l'opacité.
*/
.modal-backdrop {
  transition-property: opacity;
  transition-duration: 300ms;
  transition-timing-function: ease-in-out;
}

/*
  État "caché" : l'élément est invisible et légèrement réduit.
  'pointer-events-none' est crucial pour qu'on ne puisse pas cliquer dessus.
*/
/* .is-hidden, .actions-menu, .modal-bg {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
} */

/* État "visible" : l'élément est entièrement visible et à sa taille normale.
*/
/* .is-visible, .actions-menu.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto; /* On réactive les clics 
} */


/* Style de base pour l'affichage du rôle */
#profile-role-display {
    display: inline-block; /* Permet d'appliquer padding et margin */
    padding: 0.1rem 0.6rem;
    border-radius: 9999px; /* Crée une forme de pilule */
    font-size: 0.75rem; /* Texte légèrement plus petit */
    font-weight: bold;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Style spécifique pour le rôle "Administrator" */
#profile-role-display.role-administrator {
    background-color: #DD922E; /* Carrot Orange (votre couleur primaire) */
    color: #0D1321; /* Rich Black */
}

/* Style spécifique pour le rôle "Limited" */
#profile-role-display.role-limited {
    background-color: #4A5568; /* Gris neutre */
    color: #F0EBD8; /* Eggshell */
}

/* Un style par défaut si le rôle n'est pas reconnu */
#profile-role-display.role-default {
    background-color: #1D2D44; /* Prussian Blue */
    color: #F0EBD8; /* Eggshell */
}

/* Style de base pour les notifications toast */
.toast-notification {
    color: #FFFFFF; /* Texte blanc par défaut */
    pointer-events: none;
    text-align: left;
    left: 50%;
    transform: translate(-50%, -140%);
    max-width: calc(100vw - 2rem);
    opacity: 0;
    font-weight: 500;
}

.toast-notification.toast-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto; /* Activer les clics quand visible */
}

/* Bouton fermer toast */
.toast-notification #toast-close-btn {
    pointer-events: auto;
    padding: 0.5rem;
    margin: -0.5rem;
    margin-left: 0.25rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.toast-notification #toast-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toast-notification #toast-close-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Style pour un toast de SUCCÈS */
.toast-success {
    background-color: #4C8E88; /* Wintergreen Dream (votre couleur positive) */
}

/* Style pour un toast d'ERREUR */
.toast-error {
    background-color: #CC5555; /* Rouge UX (votre couleur destructive) */
}

/* === TOAST MOBILE - Style notification système === */
@media (max-width: 768px) {
    .toast-notification {
        /* Position en haut avec safe area */
        top: calc(env(safe-area-inset-top, 0px) + 0.75rem) !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        transform: translateY(-150%) !important;
        
        /* Style notification mobile */
        padding: 1rem 1.25rem !important;
        border-radius: 0.875rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        
        /* Texte */
        font-size: 0.9375rem !important;
        line-height: 1.4 !important;
        text-align: left !important;
        
        /* Animation */
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease !important;
    }
    
    .toast-notification.toast-visible {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
    
    /* Style pour un toast de SUCCÈS sur mobile */
    .toast-success {
        background-color: rgba(76, 142, 136, 0.95) !important; /* Wintergreen Dream avec transparence */
    }
    
    /* Style pour un toast d'ERREUR sur mobile */
    .toast-error {
        background-color: rgba(204, 85, 85, 0.95) !important; /* Rouge avec transparence */
    }
}

/* Progress Tracker Steps */
.progress-step {
    display: flex;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
}

.progress-step-text {
    flex: 1;
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
    transition: color 0.3s ease;
}

.progress-step-text-pending {
    color: #6B7280 !important; /* gray-500 - plus sombre pour pending */
}

.progress-step-text-active {
    color: #E5E7EB !important; /* gray-200 - très visible */
    font-weight: 500 !important;
}

.progress-step-text-completed {
    color: #10B981 !important; /* green-500 - vert pour validé */
}

.progress-step-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.625rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.progress-step.pending .progress-step-icon {
    background-color: #1F2937 !important; /* gray-800 - très sombre */
    border: 2px solid #374151 !important; /* gray-700 */
}

.progress-step.active .progress-step-icon {
    background-color: #0D9488 !important; /* teal-600 */
    border: 2px solid #14B8A6 !important; /* teal-500 */
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15) !important;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

.progress-step.completed .progress-step-icon {
    background-color: #10B981 !important; /* green-500 - vert vif */
    border: 2px solid #10B981 !important;
}

.progress-step-icon .fa-check {
    color: white;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.25);
    }
}

/* Small loader for progress tracker */
.loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid #374151;
    border-top-color: #2DD4BF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Style pour les boutons d'onglets (Profil, Groupe) */
.tab-btn {
    padding: 0.5rem 0.25rem; /* Moins de padding horizontal pour un look plus fin */
    margin: 0 0.5rem; /* Un peu d'espace entre les onglets */
    border-bottom: 3px solid transparent; /* Bordure inférieure plus épaisse */
    font-weight: 600;
    color: #A0AEC0; /* Gris (inactif) */
    transition: all 0.2s ease-in-out;
    transform: translateY(0); /* État initial pour l'animation */
}

/* Au survol de la souris */
.tab-btn:hover {
    color: #F0EBD8; /* Eggshell (plus clair) */
    transform: translateY(-2px); /* Léger mouvement vers le haut, comme les autres boutons */
}

/* Style pour l'onglet ACTIF */
.tab-btn.active {
    color: #DD922E; /* Carrot Orange (votre couleur primaire) */
    border-bottom-color: #DD922E; /* Souligné avec la couleur primaire */
}

/* Cache les fonctionnalités non implémentées */
#quantize-select,
#btn-quantize,
#snap-to-scale-checkbox,
#btn-apply-autotune,
label[for="snap-to-scale-checkbox"] {
    display: none !important;
}

.loader-white-small {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #FFFFFF;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

label[for="scale-type-select"],
#scale-type-select {
    display: none !important;
}

/* On cache le bouton de génération d'harmonies en mode Autonome */
.mode-autonome #btn-generate-harmonies-group {
    display: none !important;
}

/* Par défaut, le bouton "Charger" dans l'en-tête est caché */
#btn-load-project-header {
    display: none;
}

/* En mode Practice, on AFFICHE le bouton de l'en-tête... */
.mode-practice #btn-load-project-header {
    display: inline-flex;
}

/* ...et on CACHE le bouton des paramètres pour éviter les doublons. */
.mode-practice #btn-load-project {
    display: none;
}

.file-name-display {
    display: inline-block;
    max-width: 140px; /* ajuste selon la largeur de ton champ */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* On cache tous les boutons d'action de l'en-tête */
.view-login #btn-load-project-header,
.view-login #btn-start-tour,
.view-login #btn-generate-harmonies-group,
.view-login #btn-show-practice-steps,
.view-login #btn-start-exercise,
.view-login #btn-play-pause,
.view-login #btn-stop,
.view-login #btn-toggle-settings {
    display: none !important;
}

/* On cache tout le footer pour masquer le métronome, le BPM et la Tonalité */
.view-login footer {
    display: none !important;
}

.view-login #app-title {
    display: none;
}

/* Cache le header sur la page de login */
body.view-login header {
    display: none !important;
}

/* NOUVELLE RÈGLE : Cache spécifiquement l'icône de chargement sur la page de login */
body.view-login #loader {
    display: none !important;
}

/* Styles pour la page upgrade - simplification du header */
body.upgrade-page #btn-mode-upload,
body.upgrade-page #btn-mode-live,
body.upgrade-page #btn-load-project-header,
body.upgrade-page #btn-action-start,
body.upgrade-page #btn-start-tour,
body.upgrade-page #btn-generate-harmonies-group,
body.upgrade-page #btn-show-practice-steps,
body.upgrade-page #btn-start-exercise,
body.upgrade-page #btn-play-pause,
body.upgrade-page #btn-stop,
body.upgrade-page #btn-toggle-settings,
body.upgrade-page .btn-mode-group,
body.upgrade-page #status-text,
body.upgrade-page #loader {
    display: none !important;
}

/* Simplifier l'affichage du header sur la page upgrade */
body.upgrade-page header {
    justify-content: center !important;
}

body.upgrade-page #header-left-container {
    display: none !important;
}

/* ===== Paroles synchronisées ===== */
#lyrics-display-container {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
    border-top: 2px solid rgba(76, 142, 136, 0.3);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
}

/* Masquer toutes les barres de scroll horizontales */
#lyrics-display-container::-webkit-scrollbar {
    display: none;
}

#lyrics-display-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#lyrics-display {
    line-height: 1.6;
    letter-spacing: 0.025em;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0.5rem;
    /* Forcer du padding à droite pour permettre le scroll */
    padding-right: 3000px !important;
}

/* Masquer aussi la scrollbar de #lyrics-display */
#lyrics-display::-webkit-scrollbar {
    display: none;
}

#lyrics-display {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Syllabe active */
#lyrics-display span.text-yellow-400 {
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
    transform: scale(1.1);
    display: inline-block;
}

/* Animation smooth des syllabes */
#lyrics-display span {
    transition: all 0.15s ease-out;
}

/* Modal des paroles */
#lyrics-editor-modal .modal-content {
    max-width: 600px;
}

#lyrics-textarea {
    font-family: 'Courier New', monospace;
    background-color: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(76, 142, 136, 0.3);
    color: #F0EBD8;
    resize: vertical;
}

#lyrics-textarea:focus {
    outline: none;
    border-color: #4C8E88;
    box-shadow: 0 0 0 3px rgba(76, 142, 136, 0.2);
}

/* ===================================================================
   MODE SIMPLE - Interface épurée pour débutants
   =================================================================== */

/* Éléments masqués en mode simple */
.mode-simple .hide-in-simple-mode {
    display: none !important;
}

/* Masquer les éléments techniques du header en mode simple */
.mode-simple #btn-toggle-melody,
.mode-simple #btn-toggle-chords,
.mode-simple #melody-buttons,
.mode-simple #chords-buttons,
.mode-simple #btn-load-project-header,
.mode-simple #btn-sections-panel,
.mode-simple #btn-open-lyrics-editor,
.mode-simple #btn-show-practice-steps,
.mode-simple #btn-start-exercise,
.mode-simple #btn-undo,
.mode-simple #btn-redo,
.mode-simple #btn-start-tour,
.mode-simple #dropdown-generate {
    display: none !important;
}

/* Masquer le toggle Voix/Accords complet */
.mode-simple .hide-in-practice-mode.hide-in-autonome-mode:has(#btn-toggle-melody) {
    display: none !important;
}

/* Masquer les contrôles techniques du footer */
.mode-simple #btn-metronome,
.mode-simple #time-signature-select,
.mode-simple #midi-controls,
.mode-simple #voice-roller-container {
    display: none !important;
}

/* Masquer la sidebar settings en mode simple (on garde un menu minimal) */
.mode-simple #settings-sidebar .hide-in-simple-mode {
    display: none !important;
}

/* Masquer la barre mobile standard en mode simple */
.mode-simple #mobile-action-bar {
    display: none !important;
}

/* Afficher uniquement en mode simple */
.show-only-in-simple-mode {
    display: none !important;
}

.mode-simple .show-only-in-simple-mode {
    display: flex !important;
}

/* ===== Header Simplifié - Workflow 3 étapes ===== */
#simple-mode-header {
    display: none;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-bottom: 1px solid rgba(76, 142, 136, 0.3);
    padding: 1rem;
    position: relative;
    z-index: 50;
    max-height: 40vh; /* Limite la hauteur du header sur mobile */
    overflow-y: auto; /* Permet le scroll si nécessaire */
}

.mode-simple #simple-mode-header {
    display: block !important;
}

/* Masquer le header simple si la vue de connexion est active */
#login-view:not(.is-hidden) ~ * #simple-mode-header,
body:has(#login-view:not(.is-hidden)) #simple-mode-header {
    display: none !important;
}

/* Masquer le header standard en mode simple */
.mode-simple header:not(#simple-mode-header) {
    display: none !important;
}

/* Bouton pour toggle les étapes (mobile) */
.toggle-steps-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.toggle-steps-btn:hover {
    background: rgba(55, 65, 81, 0.7);
}

.toggle-steps-btn i {
    transition: transform 0.3s ease;
}

.toggle-steps-btn.collapsed i {
    transform: rotate(-90deg);
}

/* Wrapper des étapes (collapsible) */
.simple-steps-wrapper {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.simple-steps-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Container des étapes */
.simple-steps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Étape individuelle */
.simple-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: rgba(55, 65, 81, 0.5);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 280px;
    cursor: pointer;
}

.simple-step:hover {
    background: rgba(55, 65, 81, 0.8);
    border-color: rgba(76, 142, 136, 0.3);
}

/* Étape en cours */
.simple-step.active {
    background: rgba(76, 142, 136, 0.2);
    border-color: #4C8E88;
    box-shadow: 0 0 20px rgba(76, 142, 136, 0.2);
}

/* Étape complétée */
.simple-step.completed {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
}

.simple-step.completed .step-icon {
    background: #22c55e;
}

/* Numéro/icône de l'étape */
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.simple-step.active .step-icon {
    background: #4C8E88;
    box-shadow: 0 0 15px rgba(76, 142, 136, 0.5);
}

/* Titre de l'étape */
.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* Statut de l'étape */
.step-status {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

.simple-step.completed .step-status {
    color: #22c55e;
}

/* Connecteur entre étapes */
.step-connector {
    width: 40px;
    height: 3px;
    background: #374151;
    border-radius: 2px;
    flex-shrink: 0;
}

.step-connector.completed {
    background: linear-gradient(90deg, #22c55e, #4C8E88);
}

/* Conteneur de boutons multiples pour une étape */
.step-action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Bouton principal de l'étape */
.step-action-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.step-action-btn.primary {
    background: #4C8E88;
    color: white;
}

.step-action-btn.primary:hover {
    background: #5a9e98;
    transform: translateY(-1px);
}

.step-action-btn.secondary {
    background: #374151;
    color: #d1d5db;
}

.step-action-btn.secondary:hover {
    background: #4b5563;
}

.step-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.step-action-btn.recording {
    background: #dc2626;
    color: white;
    animation: pulse-recording 1.5s infinite;
}

.step-action-btn.recording:hover {
    background: #ef4444;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== Wizard Mode (Step-by-step) ===== */
.wizard-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.wizard-dots {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.wizard-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #374151;
    border: 2px solid #4b5563;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.wizard-dot:hover {
    background: #4b5563;
    transform: scale(1.2);
}

.wizard-dot.active {
    background: #4C8E88;
    border-color: #4C8E88;
    box-shadow: 0 0 10px rgba(76, 142, 136, 0.5);
    transform: scale(1.3);
}

.wizard-dot.completed {
    background: #22c55e;
    border-color: #22c55e;
}

.wizard-step-label {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

.wizard-container {
    position: relative;
    min-height: 350px;
    padding: 0 1rem;
}

.wizard-step {
    display: none;
    opacity: 0;
    animation: fadeOut 0.3s ease;
}

.wizard-step.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    animation: fadeIn 0.4s ease;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.wizard-step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(76, 142, 136, 0.1);
    border-radius: 1rem;
    border: 2px solid rgba(76, 142, 136, 0.3);
    margin-bottom: 1.5rem;
}

.wizard-step-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4C8E88, #5a9e98);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 4px 20px rgba(76, 142, 136, 0.4);
}

.wizard-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
    text-align: center;
}

.wizard-step-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0.5rem;
}

.wizard-step-description {
    font-size: 0.95rem;
    color: #9ca3af;
    text-align: center;
    line-height: 1.5;
}

.wizard-step-status {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    padding: 0.5rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

.wizard-tonality-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.5rem;
}

.wizard-tonality-selector label {
    margin: 0;
    white-space: nowrap;
}

.wizard-tonality-selector select {
    min-width: 80px;
}

.wizard-step-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.wizard-action-btn {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wizard-action-btn.primary {
    background: linear-gradient(135deg, #4C8E88, #5a9e98);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 142, 136, 0.3);
}

.wizard-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 142, 136, 0.4);
}

.wizard-action-btn.secondary {
    background: #374151;
    color: #d1d5db;
    border: 2px solid #4b5563;
}

.wizard-action-btn.secondary:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.wizard-action-btn.recording-pulse {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    animation: pulse-recording 1.5s infinite;
}

.wizard-action-btn.recording-pulse:hover {
    background: #ef4444 !important;
}

.wizard-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wizard-btn-hidden {
    display: none !important;
}

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1rem 1rem;
    margin-top: auto;
}

.wizard-nav-btn {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #374151;
    color: #d1d5db;
    border: 2px solid #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wizard-nav-btn:hover:not(:disabled) {
    background: #4b5563;
    border-color: #6b7280;
    transform: translateY(-1px);
}

.wizard-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Masquer le wizard classique quand l'assistant est actif */
.mode-simple .wizard-progress,
.mode-simple #wizard-container,
.mode-simple .wizard-navigation {
    display: none !important;
}

/* Masquer les controles de lecture en mode simple tant qu'ils ne sont pas utiles */
.mode-simple.simple-playback-hidden #simple-playback-controls {
    display: none !important;
}

/* Masquer l'etat vide jusqu'a la fin */
.mode-simple.simple-empty-hidden #simple-empty-state {
    display: none !important;
}

/* ===== Assistant guidé ===== */
.simple-assistant {
    position: sticky;
    bottom: 0;
    margin-top: 1.5rem;
    max-width: 820px;
    width: 100%;
    align-self: center;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(76, 142, 136, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    z-index: 10;
}

.assistant-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

/* Bouton de réduction du panneau assistant */
.assistant-collapse-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    border-radius: 0.25rem;
    transition: color 0.2s, transform 0.25s;
    flex-shrink: 0;
}
.assistant-collapse-btn:hover {
    color: #e5e7eb;
}
.simple-assistant.collapsed .assistant-collapse-btn {
    transform: rotate(180deg);
}

/* État réduit : masquer rail + contenu + actions */
.simple-assistant.collapsed .assistant-rail,
.simple-assistant.collapsed .assistant-main,
.simple-assistant.collapsed .assistant-actions {
    display: none !important;
}
.simple-assistant.collapsed .assistant-progress {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}
/* Transition hauteur */
.simple-assistant .assistant-rail,
.simple-assistant .assistant-main,
.simple-assistant .assistant-actions {
    transition: opacity 0.2s;
}

.assistant-rail {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.assistant-rail-step {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(55, 65, 81, 0.6);
    color: #9ca3af;
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.assistant-rail-step.active {
    color: #e5e7eb;
    background: rgba(76, 142, 136, 0.25);
    border-color: rgba(76, 142, 136, 0.5);
}

.assistant-rail-step.completed {
    color: #e5e7eb;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.45);
}

.assistant-rail-step.completed i {
    color: #22c55e;
}

.assistant-step {
    font-weight: 600;
    color: #d1d5db;
}

.assistant-status {
    color: #4C8E88;
}

.assistant-main {
    margin-bottom: 0.75rem;
}

.assistant-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.assistant-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f4f6;
}

.assistant-desc {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0;
}

.assistant-tonality-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.5rem;
}

.assistant-tonality-selector .tonality-label {
    color: #d1d5db;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
}

.assistant-tonality-selector .tonality-select {
    min-width: 65px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    background: rgba(17, 24, 39, 0.8);
    color: #f3f4f6;
}

.assistant-tonality-selector .tonality-select:focus {
    outline: 2px solid #4C8E88;
    outline-offset: 2px;
}

.assistant-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.assistant-btn {
    padding: 0.75rem 1.1rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.assistant-btn.primary {
    background: linear-gradient(135deg, #4C8E88, #3d7571);
    color: white;
    box-shadow: 0 6px 18px rgba(76, 142, 136, 0.25);
}

.assistant-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(76, 142, 136, 0.35);
}

.assistant-btn.secondary {
    background: linear-gradient(135deg, #4C8E88 0%, #1D2D44 100%);
    color: #F0EBD8;
    border: 1.5px solid rgba(76, 142, 136, 0.5);
    box-shadow: 0 3px 12px rgba(76, 142, 136, 0.18);
}

.assistant-btn.secondary:hover {
    background: linear-gradient(135deg, #5aa89e 0%, #253a56 100%);
    color: white;
    border-color: rgba(76, 142, 136, 0.8);
    box-shadow: 0 5px 18px rgba(76, 142, 136, 0.32);
    transform: translateY(-1px);
}

.assistant-btn.bg-red-600 {
    background: #dc2626 !important;
    color: white !important;
}

.assistant-btn.bg-red-600:hover {
    background: #b91c1c !important;
}

.assistant-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive pour petit écran */
@media (max-width: 640px) {
    .wizard-step-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .wizard-step-title {
        font-size: 1.25rem;
    }
    
    .wizard-action-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }

    .simple-assistant {
        padding: 0.85rem 1rem;
        margin-top: 1rem;
    }

    .assistant-actions {
        gap: 0.5rem;
    }

    .assistant-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Visualisation Simplifiée ===== */
#simple-visualization {
    display: none;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    padding: 1.5rem;
    flex: 1;
    min-height: 0;
    position: relative;
}

.mode-simple #simple-visualization {
    display: flex !important;
    flex-direction: column;
}

.mode-simple:not(.simple-tracks-visible) #simple-visualization {
    justify-content: center;
}

#simple-visualization::before,
#simple-visualization::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background: radial-gradient(circle at 20% 25%, rgba(76, 142, 136, 0.22), transparent 45%),
                radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.18), transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(248, 113, 113, 0.12), transparent 35%);
    filter: blur(8px);
    z-index: 0;
}

#simple-visualization::after {
    opacity: 0.35;
    background: radial-gradient(circle at 15% 90%, rgba(59, 130, 246, 0.2), transparent 45%),
                radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.18), transparent 40%);
}

#simple-visualization > * {
    position: relative;
    z-index: 1;
}

/* Masquer la visualisation simple quand la vue de connexion est active */
#login-view:not(.is-hidden) ~ * #simple-visualization,
body:has(#login-view:not(.is-hidden)) #simple-visualization {
    display: none !important;
}

/* Masquer le piano roll en mode simple */
.mode-simple #app-container > *:not(#simple-visualization):not(#simple-playback-controls):not(#simple-footer):not(#chord-pads-container) {
    display: none !important;
}

/* Zone de visualisation des pistes */
.simple-tracks-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.simple-tracks-view.hidden {
    display: none !important;
}

.simple-tracks-view.tracks-enter {
    animation: fadeInTracks 0.36s ease forwards;
}

.simple-track.track-enter {
    opacity: 0;
    animation: trackLift 0.42s ease forwards;
    animation-delay: var(--enter-delay, 0ms);
}

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

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

/* Placeholder tracks avant import */
.simple-placeholder-tracks {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto 1rem auto;
    width: 100%;
}

#simple-tracks-container.hidden ~ .simple-placeholder-tracks {
    display: flex;
}

.mode-simple.simple-completion-active #simple-tracks-container.hidden ~ .simple-placeholder-tracks {
    display: none;
}

.placeholder-track {
    background: rgba(55, 65, 81, 0.25);
    border: 1px dashed rgba(75, 85, 99, 0.4);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.placeholder-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(55, 65, 81, 0.6);
    flex-shrink: 0;
}

.placeholder-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.placeholder-lines .line {
    height: 10px;
    border-radius: 6px;
    background: rgba(55, 65, 81, 0.6);
    width: 60%;
}

.placeholder-lines .line.short {
    width: 35%;
}

.placeholder-wave {
    width: 45%;
    height: 28px;
    border-radius: 0.5rem;
    background: rgba(55, 65, 81, 0.4);
}

/* Piste audio simplifiée */
.simple-track {
    background: rgba(55, 65, 81, 0.4);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(75, 85, 99, 0.5);
    transition: all 0.2s ease;
}

.simple-track:hover {
    background: rgba(55, 65, 81, 0.6);
}

.simple-track.playing {
    border-color: #4C8E88;
    box-shadow: 0 0 15px rgba(76, 142, 136, 0.2);
}

/* Pistes de voix cliquables pour le focus */
.simple-track.voice-track {
    cursor: pointer;
}

.simple-track.voice-track:hover {
    border-color: rgba(76, 142, 136, 0.5);
}

/* Piste focusée (en avant) */
.simple-track.focused {
    border-color: #4C8E88;
    background: rgba(76, 142, 136, 0.15);
    box-shadow: 0 0 20px rgba(76, 142, 136, 0.3);
}

.simple-track.focused .track-icon {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Pistes en arrière-plan (quand une autre est focusée) */
.simple-track.dimmed {
    opacity: 0.5;
}

.simple-track.dimmed .track-waveform {
    opacity: 0.4;
}

/* Icône de la piste */
.track-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.track-icon.vocal { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.track-icon.chords { background: linear-gradient(135deg, #f59e0b, #d97706); }
.track-icon.harmony1 { background: linear-gradient(135deg, #22c55e, #16a34a); }
.track-icon.harmony2 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* Info de la piste */
.track-info {
    flex: 1;
    min-width: 0;
}

.track-name {
    font-weight: 600;
    color: #f3f4f6;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.track-status {
    font-size: 0.8rem;
    color: #9ca3af;
}

.track-status.ready {
    color: #22c55e;
}

.track-status.pending {
    color: #f59e0b;
}

/* Forme d'onde simplifiée */
.track-waveform {
    flex: 2;
    height: 40px;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2px;
    padding: 0.25rem;
}

.waveform-bar {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.6;
}

/* Contrôles de volume de la piste */
.track-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.5rem;
    width: 100px;
    justify-content: center;
    flex-shrink: 0;
}

/* Slider de volume des accords */
.chords-volume-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: rgba(55, 65, 81, 0.8);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.chords-volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chords-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chords-volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #f59e0b 0%, rgba(55, 65, 81, 0.8) 0%);
}

.track-volume-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(55, 65, 81, 0.8);
    border: none;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-volume-btn:hover {
    background: rgba(76, 142, 136, 0.5);
    color: white;
}

.track-volume-btn.muted {
    color: #ef4444;
}

/* ===== Zone d'upload vide ===== */
.simple-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 3rem;
    text-align: center;
}

.simple-empty-state.hidden {
    display: none !important;
}

.simple-empty-state.completed {
    padding: 1.5rem;
    border: 1px solid rgba(76, 142, 136, 0.25);
    border-radius: 1rem;
    background: rgba(17, 24, 39, 0.6);
    max-width: 720px;
    margin: 0 auto 1rem auto;
}

.simple-empty-state.completed .empty-state-icon {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.simple-empty-state.completed .empty-state-title {
    font-size: 1.25rem;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(76, 142, 136, 0.2), rgba(76, 142, 136, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #4C8E88;
    margin-bottom: 1.5rem;
    animation: pulse-gentle 3s infinite;
}

@keyframes pulse-gentle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: #9ca3af;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.empty-state-btn {
    padding: 1rem 2rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #4C8E88, #3d7571);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 142, 136, 0.3);
}

.empty-state-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 142, 136, 0.4);
}

/* ===== Contrôles de lecture simplifiés ===== */
#simple-playback-controls {
    display: none;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    padding: 1.5rem;
    border-top: 1px solid rgba(75, 85, 99, 0.5);
}

.mode-simple #simple-playback-controls {
    display: block !important;
}

/* Masquer les contrôles de lecture quand la vue de connexion est active */
#login-view:not(.is-hidden) ~ * #simple-playback-controls,
body:has(#login-view:not(.is-hidden)) #simple-playback-controls {
    display: none !important;
}

.playback-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Barre de progression */
.progress-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-time {
    font-size: 0.8rem;
    color: #9ca3af;
    min-width: 45px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #374151;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4C8E88, #22c55e);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 3px;
}

/* Boutons de contrôle */
.playback-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.playback-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playback-btn.small {
    width: 44px;
    height: 44px;
    background: #374151;
    color: #d1d5db;
}

.playback-btn.small:hover {
    background: #4b5563;
    color: white;
}

.playback-btn.play {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.playback-btn.play:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.playback-btn.play:disabled {
    background: #4b5563;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.playback-btn.stop {
    width: 44px;
    height: 44px;
    background: #dc2626;
    color: white;
}

.playback-btn.stop:hover {
    background: #ef4444;
}

.playback-btn.transpose {
    width: 44px;
    height: 44px;
    background: #374151;
    color: #d1d5db;
}

.playback-btn.transpose:hover:not(:disabled) {
    background: #0d9488;
    color: white;
}

.playback-btn.transpose:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Actions secondaires */
.secondary-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.action-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn.save {
    background: #4C8E88;
    color: white;
}

.action-btn.save:hover {
    background: #5a9e98;
}

.action-btn.share {
    background: #374151;
    color: #d1d5db;
}

.action-btn.share:hover {
    background: #4b5563;
    color: white;
}

/* ===== Footer simplifié ===== */
#simple-footer {
    display: none;
    background: #111827;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
}

.mode-simple #simple-footer {
    display: block !important;
}

/* Masquer le footer simple quand la vue de connexion est active */
#login-view:not(.is-hidden) ~ * #simple-footer,
body:has(#login-view:not(.is-hidden)) #simple-footer {
    display: none !important;
}

/* Masquer le footer standard en mode simple */
.mode-simple footer:not(#simple-footer) {
    display: none !important;
}

/* ===== Toggle Mode Simple/Avancé ===== */
.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.mode-toggle-label {
    font-size: 0.9rem;
    color: #d1d5db;
}

.mode-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: #374151;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-toggle.active {
    background: #4C8E88;
}

.mode-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-toggle.active .mode-toggle-knob {
    left: 27px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #simple-mode-header {
        padding: 0.75rem;
        max-height: 45vh; /* Plus d'espace pour le header sur mobile */
    }
    
    .simple-steps-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
    }
    
    .simple-step {
        width: 100%;
        max-width: none;
        flex-direction: row;
        padding: 0.75rem;
    }
    
    .step-icon {
        width: 35px;
        height: 35px;
        margin-bottom: 0;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    
    .step-content {
        flex: 1;
        text-align: left;
    }
    
    .step-title {
        font-size: 0.9rem;
    }
    
    .step-status {
        font-size: 0.75rem;
    }
    
    .step-action-buttons {
        margin-top: 0;
        margin-left: auto;
        flex-direction: row;
        gap: 0.25rem;
    }
    
    .step-action-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
    
    .step-connector {
        display: none;
    }
    
    /* Visualisation des pistes plus compacte */
    #simple-visualization {
        padding: 0.75rem;
        flex: 1;
        overflow-y: auto; /* Permet le scroll des pistes */
    }
    
    .simple-tracks-view {
        gap: 0.5rem;
    }
    
    .simple-track {
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .track-icon {
        width: 35px;
        height: 35px;
    }
    
    .track-waveform {
        order: 3;
        width: 100%;
        flex: none;
        margin-top: 0.5rem;
    }

    .simple-placeholder-tracks {
        gap: 0.5rem;
    }

    .placeholder-track {
        padding: 0.75rem;
    }
    
    /* Contrôles de lecture plus compacts */
    #simple-playback-controls {
        padding: 0.75rem;
    }
    
    .playback-buttons {
        gap: 0.75rem;
    }
    
    .playback-btn {
        width: 45px;
        height: 45px;
    }
    
    /* Footer plus compact */
    #simple-footer {
        padding: 0.75rem;
        font-size: 0.75rem;
    }
}

.mode-simple:not(.simple-tracks-visible) .simple-assistant {
    position: relative;
    bottom: auto;
    margin-top: 0;
}

/* ================================================================
   PREMIUM VISUAL UPLIFT — 2026
   ================================================================ */

/* ── 1. Subtle aurora background (dark only) ── */
body {
    background-image:
        radial-gradient(ellipse at 18% 0%, rgba(76, 142, 136, 0.09) 0%, transparent 52%),
        radial-gradient(ellipse at 82% 100%, rgba(221, 146, 46, 0.07) 0%, transparent 52%);
}
:root[data-theme="light"] body {
    background-image: none;
}

/* ── 2. Gradient title ── */
.page-title {
    background: linear-gradient(135deg, #DD922E 10%, #4C8E88 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent !important;
}
:root[data-theme="light"] .page-title {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    color: #0f172a !important;
}

/* ── 3. Glassmorphism header ── */
header {
    background: rgba(13, 19, 33, 0.82) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(76, 142, 136, 0.15);
    box-shadow: 0 1px 24px rgba(0, 0, 0, 0.22);
}
:root[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 1px 14px rgba(0, 0, 0, 0.06) !important;
}

/* ── 4. Footer glass ── */
footer {
    background: rgba(13, 19, 33, 0.82) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(76, 142, 136, 0.12);
}
:root[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.88) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.07) !important;
}

/* ── 5. Buttons — drop uppercase, refine weight ── */
.btn {
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 0.625rem !important;
}

/* ── 6. Primary button glow ── */
.btn-primary {
    box-shadow: 0 3px 14px rgba(221, 146, 46, 0.22);
}
.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(221, 146, 46, 0.40) !important;
}

/* ── 7. Secondary button glass ── */
.btn-secondary {
    background: rgba(76, 142, 136, 0.06) !important;
    border-color: rgba(76, 142, 136, 0.50) !important;
}
.btn-secondary:hover {
    background: rgba(76, 142, 136, 0.16) !important;
    border-color: #4C8E88 !important;
    color: #F0EBD8 !important;
}

/* ── 8. Wizard primary CTA — orange→teal gradient + glow ── */
.wizard-action-btn.primary {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%);
    box-shadow: 0 4px 20px rgba(221, 146, 46, 0.25);
    border-radius: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}
.wizard-action-btn.primary:hover {
    box-shadow: 0 8px 30px rgba(221, 146, 46, 0.42);
    transform: translateY(-3px);
}

/* ── 9. Wizard secondary button — teal→prussian gradient ── */
.wizard-action-btn.secondary {
    background: linear-gradient(135deg, #4C8E88 0%, #1D2D44 100%) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(76, 142, 136, 0.5) !important;
    border-radius: 0.875rem;
    font-weight: 600;
    color: #F0EBD8 !important;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 3px 12px rgba(76, 142, 136, 0.18);
}
.wizard-action-btn.secondary:hover {
    background: linear-gradient(135deg, #5aa89e 0%, #253a56 100%) !important;
    border-color: rgba(76, 142, 136, 0.8) !important;
    box-shadow: 0 5px 18px rgba(76, 142, 136, 0.32);
    transform: translateY(-1px);
}

/* ── 9b. Assistant secondary button — same gradient ── */
.assistant-btn.secondary {
    background: linear-gradient(135deg, #4C8E88 0%, #1D2D44 100%) !important;
    border: 1.5px solid rgba(76, 142, 136, 0.5) !important;
    color: #F0EBD8 !important;
    box-shadow: 0 3px 12px rgba(76, 142, 136, 0.18) !important;
}
.assistant-btn.secondary:hover {
    background: linear-gradient(135deg, #5aa89e 0%, #253a56 100%) !important;
    border-color: rgba(76, 142, 136, 0.8) !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(76, 142, 136, 0.32) !important;
}

/* ── 9c. Wizard nav buttons — teal→prussian gradient ── */
.wizard-nav-btn {
    background: linear-gradient(135deg, rgba(76,142,136,0.4) 0%, rgba(29,45,68,0.8) 100%) !important;
    border-color: rgba(76, 142, 136, 0.4) !important;
    color: #F0EBD8 !important;
}
.wizard-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(76,142,136,0.65) 0%, rgba(29,45,68,0.95) 100%) !important;
    border-color: rgba(76, 142, 136, 0.65) !important;
}

/* ── 9d. Assistant primary button — orange→teal gradient ── */
.assistant-btn.primary {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%) !important;
    box-shadow: 0 4px 20px rgba(221, 146, 46, 0.25) !important;
    color: white !important;
}
.assistant-btn.primary:hover {
    box-shadow: 0 8px 30px rgba(221, 146, 46, 0.42) !important;
    transform: translateY(-2px) !important;
}

/* ── 9e. Action save button — orange→teal gradient ── */
.action-btn.save {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(221, 146, 46, 0.22) !important;
}
.action-btn.save:hover {
    box-shadow: 0 6px 22px rgba(221, 146, 46, 0.40) !important;
    transform: translateY(-1px) !important;
}

/* ── 9f. Mode button active — orange gradient ── */
.mode-btn.active {
    background: linear-gradient(135deg, #DD922E 0%, #c47a20 100%) !important;
    color: #0D1321 !important;
    border-color: #DD922E !important;
    box-shadow: 0 0 12px rgba(221, 146, 46, 0.55) !important;
}

/* ── 10. Wizard step icon — orange→teal gradient + glow ring ── */
.wizard-step-icon {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%);
    box-shadow: 0 6px 30px rgba(221, 146, 46, 0.32), 0 0 0 8px rgba(221, 146, 46, 0.07);
}

/* ── 11. Wizard step header glass ── */
.wizard-step-header {
    background: linear-gradient(135deg,
        rgba(221, 146, 46, 0.07) 0%,
        rgba(76, 142, 136, 0.06) 100%);
    border: 1.5px solid rgba(221, 146, 46, 0.22);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

/* ── 12. Wizard dots ── */
.wizard-dot.active {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #DD922E, #4C8E88);
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(221, 146, 46, 0.18), 0 0 14px rgba(221, 146, 46, 0.50);
    transform: scale(1.35);
}
.wizard-dot.completed {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: transparent;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

/* ── 13. Wizard step status ── */
.wizard-step-status {
    background: rgba(221, 146, 46, 0.05);
    border: 1px solid rgba(221, 146, 46, 0.16);
    border-radius: 0.625rem;
}

/* ── 14. Toast glass ── */
#toast-notification {
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    background: rgba(15, 23, 42, 0.90) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.38) !important;
    border-radius: 0.875rem !important;
}
.toast-success { border-left: 3px solid #22c55e !important; }
.toast-error   { border-left: 3px solid #ef4444 !important; }
.toast-warning { border-left: 3px solid #f59e0b !important; }
.toast-info    { border-left: 3px solid #60a5fa !important; }

/* ── 15. Upgrade plan cards glass ── */
.plan-card {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 1.25rem !important;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease !important;
}
.plan-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.40) !important;
    border-color: rgba(221, 146, 46, 0.30) !important;
}
.plan-card[data-tier="pro"] {
    border-color: rgba(76, 142, 136, 0.35) !important;
    box-shadow: 0 0 40px rgba(76, 142, 136, 0.10) !important;
}
.plan-card[data-tier="pro"]:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.40), 0 0 50px rgba(76, 142, 136, 0.18) !important;
    border-color: rgba(76, 142, 136, 0.55) !important;
}

/* ── 16. Settings sidebar glass ── */
#settings-sidebar {
    background: rgba(10, 15, 28, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-right: 1px solid rgba(76, 142, 136, 0.14) !important;
}
:root[data-theme="light"] #settings-sidebar {
    background: rgba(248, 250, 252, 0.94) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* ── 17. Chord pads container ── */
.mode-simple #chord-pads-container {
    background: linear-gradient(180deg,
        rgba(10, 15, 28, 0.96) 0%,
        rgba(15, 23, 42, 0.96) 100%) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(20, 184, 166, 0.18) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.50) !important;
}

/* ── 18. Mode toggle active state ── */
#btn-toggle-melody.bg-teal-600,
#btn-toggle-chords.bg-teal-600 {
    background: linear-gradient(135deg, #DD922E, #4C8E88) !important;
    box-shadow: 0 2px 14px rgba(221, 146, 46, 0.28);
}

/* ── 19. Form inputs — refined focus ring ── */
.form-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(76, 142, 136, 0.16), 0 0 0 1px rgba(76, 142, 136, 0.50) !important;
    border-color: rgba(76, 142, 136, 0.70) !important;
}

/* ── 20. App loader gradient text ── */
#app-loader p {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================================
   21. ONBOARDING MODAL — Premier accès
   =================================================== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 46, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: onboarding-fade-in 0.45s ease both;
}

@keyframes onboarding-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.onboarding-card {
    background: rgba(29, 45, 68, 0.92);
    border: 1px solid rgba(221, 146, 46, 0.28);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.55), 0 0 40px rgba(221,146,46,0.08);
    animation: onboarding-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes onboarding-slide-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.onboarding-logo {
    margin-bottom: 1.25rem;
}

.onboarding-logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 8px 24px rgba(221, 146, 46, 0.4);
}

.onboarding-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #DD922E 10%, #4C8E88 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.onboarding-subtitle {
    color: rgba(240, 235, 216, 0.72);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.55;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2rem;
    text-align: left;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
}

.onboarding-step-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(221,146,46,0.18) 0%, rgba(76,142,136,0.18) 100%);
    border: 1px solid rgba(221, 146, 46, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #DD922E;
    font-size: 1rem;
}

.onboarding-step-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.onboarding-step-text strong {
    font-size: 0.875rem;
    font-weight: 700;
    color: #F0EBD8;
}

.onboarding-step-text span {
    font-size: 0.775rem;
    color: rgba(240, 235, 216, 0.52);
    line-height: 1.4;
}

.onboarding-cta {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 0.875rem;
    cursor: pointer;
    margin-bottom: 0.875rem;
    box-shadow: 0 4px 16px rgba(221, 146, 46, 0.38);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.onboarding-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(221, 146, 46, 0.5);
}

.onboarding-cta:active {
    transform: translateY(0);
}

.onboarding-skip {
    display: block;
    background: none;
    border: none;
    color: rgba(240, 235, 216, 0.38);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin: 0 auto;
}

.onboarding-skip:hover {
    color: rgba(240, 235, 216, 0.7);
}

/* ===================================================
   22. SIMPLE-MODE — Palette onboarding appliquée aux pistes
   =================================================== */

/* Carte de piste — même glass que les lignes onboarding */
.simple-track {
    background: rgba(29, 45, 68, 0.55) !important;
    border: 1px solid rgba(221, 146, 46, 0.35) !important;
    border-radius: 1rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.simple-track:hover {
    background: rgba(29, 45, 68, 0.75) !important;
    border-color: rgba(221, 146, 46, 0.65) !important;
}

.simple-track.playing {
    border-color: #4C8E88 !important;
    box-shadow: 0 0 16px rgba(76, 142, 136, 0.3) !important;
}

.simple-track.focused {
    border-color: rgba(221, 146, 46, 0.6) !important;
    background: rgba(221, 146, 46, 0.08) !important;
    box-shadow: 0 0 20px rgba(221, 146, 46, 0.2) !important;
}

/* Icônes de piste — gradient onboarding */
.track-icon {
    border: 1px solid rgba(221, 146, 46, 0.45) !important;
}

.track-icon.vocal {
    background: linear-gradient(135deg, #DD922E 0%, #4C8E88 100%) !important;
    color: #fff !important;
}

.track-icon.chords {
    background: linear-gradient(135deg, #4C8E88 0%, #2DD4BF 100%) !important;
    color: #fff !important;
}

.track-icon.voix1,
.track-icon.harmony1 {
    background: linear-gradient(135deg, #4C8E88 0%, #2DD4BF 100%) !important;
    color: #fff !important;
}

.track-icon.voix2,
.track-icon.harmony2 {
    background: linear-gradient(135deg, #2DD4BF 0%, #4C8E88 100%) !important;
    color: #fff !important;
}