:root {
    --swal-primary-color: #7b5aff;
    --swal-secondary-color: #6c757d;
    --swal-text-color: #e2e2e2;
    --swal-bg-color: #2c2c3e;
	--swal-bg-favorite-color: #fff0f0;
	--swal-border-favorite-color: #f5a5a5;
	--swal-font-favorite-color: #bb0b0b;
    --swal-checkbox-bg: #4a4a61;
	--swal-header-bg-color: #222230; 
}

:root {
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);
	
    --bg-dark: #1A1A2E;          /* Fond principal très sombre, bleu nuit */
    --surface-dark: #2C2C3E;    /* Couleur pour les surfaces comme les boutons */
    --primary-color: #7A5AF5;      /* Un violet vibrant mais pas agressif */
    --primary-hover: #9176ff;      /* Violet un peu plus clair pour le survol */
    --text-color: #EAEAFB;        /* Texte clair, légèrement bleuté */
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glow-color: rgba(122, 90, 245, 0.4); /* Lueur subtile pour les actions importantes */
}

body {
    padding-left: 0px;
    padding-right: 0px;
}

html, body {
    touch-action: manipulation; /* empêche double-tap et pinch dans la plupart des cas */
}

/* Appliquer le fond sombre au corps de la page pour une immersion complète */
body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    /* Assurez-vous que la police est bien lisible sur fond sombre */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Empêche le défilement horizontal */
html, body {
    overflow-x: hidden;
    margin: 0 !important;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.aedivControlsCanva {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Prend toute la hauteur de l'écran */
    width: 100vw;  /* Prend toute la largeur */
}

#controls {
    flex-shrink: 0; /* Empêche le rétrécissement */
    display: flex;           /* Active flexbox pour #controls */
    flex-direction: column;  /* Empile les enfants verticalement */
    
    gap: 10px;
    top: env(safe-area-inset-top, 2px);
    left: 2px;
    z-index: 2;
	width: 100%;
    padding-top: env(safe-area-inset-top, 10px);
    padding-left: 0px;
    padding-right: auto;
	/*border: 1px solid red;*/
}

.row3 {
    flex: 1; /* Occupe tout l'espace restant */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative; /* Pour le positionnement du canvas */
	/*border: 1px solid red;*/
}

#controls .row1 {
    position: relative; /* Indispensable pour positionner le pseudo-élément */
	overflow: hidden;
	
    /* 1. Le flou appliqué à l'arrière-plan (reste sur l'élément principal) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Pour la compatibilité avec les anciens Safari */

    width: 100%;
    /*flex-wrap: wrap;*/
    flex-wrap: nowrap;              /* plus de retour à la ligne */
    justify-content: center;
    /* align-items: center; */ /* J'ai corrigé "left" qui n'est pas une valeur valide pour align-items.
                                 Si vous voulez aligner les éléments en haut, utilisez "flex-start".
                                 "center" est un bon choix par défaut pour centrer verticalement. */
    align-items: center; /* ou flex-start si vous voulez que les éléments soient alignés en haut */

    /* background-color et border sont DÉPLACÉS vers le pseudo-élément */
    /* border: 1px solid rgba(255, 255, 255, 0.5); */
    /* background-color: rgba(238, 245, 251, 0.6); */


    display: flex; /* Aligne les éléments horizontalement dans chaque ligne */
    gap: 10px; /* Espacement entre les éléments */
    /*border: 1px solid red;*/
}



/* Le pseudo-élément qui va porter la couleur de fond et la bordure */
#controls .row1::before {
    content: ''; /* Obligatoire pour les pseudo-éléments */
    position: absolute;
    top: 15px;      /* Décalage de 10px par le haut */
    bottom: 15px;   /* Décalage de 10px par le bas */
    left: 0;
    right: 0;
    z-index: -1;    /* Place le pseudo-élément derrière le contenu de .row1 */

    /* Applique la couleur de fond et la bordure ici */
    background-color: rgba(238, 245, 251, 0.6); /* Votre couleur de fond */
    border: 1px solid rgba(255, 255, 255, 0.5); /* Votre bordure */

    /* Si .row1 a un border-radius, le pseudo-élément doit l'hériter ou le copier */
    border-radius: inherit;
}

/* Un peu d'espace pour que l'image ne soit pas collée */
#loadPartitionsImage {
    margin-left: 15px;
}

#controls .row2{
    position: relative; /* Indispensable pour positionner le pseudo-élément */
	overflow: hidden;
	
    /* 1. Le flou appliqué à l'arrière-plan (reste sur l'élément principal) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Pour la compatibilité avec les anciens Safari */

    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    /* align-items: center; */ /* J'ai corrigé "left" qui n'est pas une valeur valide pour align-items.
                                 Si vous voulez aligner les éléments en haut, utilisez "flex-start".
                                 "center" est un bon choix par défaut pour centrer verticalement. */
    align-items: center; /* ou flex-start si vous voulez que les éléments soient alignés en haut */

    /* background-color et border sont DÉPLACÉS vers le pseudo-élément */
    /* border: 1px solid rgba(255, 255, 255, 0.5); */
    /* background-color: rgba(238, 245, 251, 0.6); */


    display: flex; /* Aligne les éléments horizontalement dans chaque ligne */
    gap: 10px; /* Espacement entre les éléments */
    /*border: 1px solid red;*/
}

/* Le pseudo-élément qui va porter la couleur de fond et la bordure */
#controls .row2::before {
    content: ''; /* Obligatoire pour les pseudo-éléments */
    position: absolute;
    top: 0px;      /* Décalage de 10px par le haut */
    bottom: 1px;   /* Décalage de 10px par le bas */
    left: 0;
    right: 0;
    z-index: -1;    /* Place le pseudo-élément derrière le contenu de .row1 */

    /* Applique la couleur de fond et la bordure ici */
    background-color: rgba(238, 245, 251, 0.6); /* Votre couleur de fond */
    border: 1px solid rgba(255, 255, 255, 0.5); /* Votre bordure */

    /* Si .row1 a un border-radius, le pseudo-élément doit l'hériter ou le copier */
    border-radius: inherit;
}

#controls .row2 {
    left: 0px;
}

#controls .leftspacer {
    width: env(safe-area-inset-left, 2px);
}

.record-btn {
    background-color: #b71c1c;
    display: flex;
    align-items: center;
    gap: 4px;
}

.record-btn.recording {
    background-color: #d32f2f;
    box-shadow: 0 0 12px rgba(211, 47, 47, 0.6);
}

.record-btn.record-btn-unavailable,
.record-btn:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.7);
}

.vu-meter {
    width: 120px;
    height: 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.vu-meter[aria-hidden="true"] {
    opacity: 0.4;
}

.vu-meter[aria-hidden="false"] {
    opacity: 1;
}

.vu-level {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4caf50 0%, #ffc107 60%, #f44336 100%);
    transition: width 0.1s ease-out;
}

/* Boutons principaux - plus gros et plus fun */
button.normal {
    background-color: var(--surface-dark);
    display: inline-block;
    padding: 10px 30px; /* Padding augmenté pour des boutons plus grands */
    margin: 0.3em 0.2em;
    border: none;
    border-radius: 8px; /* Coins plus arrondis */
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    font-weight: 500; /* Texte plus gras */
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    font-size: 16px; /* Taille de texte augmentée */
    cursor: pointer;
    transition: all 0.3s ease; /* Transition plus fluide */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Ombre plus prononcée */
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

/* Effet de surbrillance au survol */
button.normal:hover {
    background: linear-gradient(95deg, #5A3FFF 60%, #6A4FFF 100%);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Effet de clic */
button.normal:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animation de fond au clic */
button.normal::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

button.normal:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}


/* On cible le texte des boutons dans les deux rangées */
.btn-text {
    display: none; /* Cache complètement le texte */
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

#sheetCanvas {
    display: block;
    left: env(safe-area-inset-left, 0px);
    width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    z-index: 0;
}

#portraitMessage {
    display: none;
    position: absolute;
    color: red;
    font-size: 20px;
    text-align: center;
}

@keyframes beat {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.cursor {
    position: absolute;
    width: 4px;
    height: 100%;
    background-color: red;
    animation: beat 0.5s infinite;
    transform-origin: bottom;
}

.loading-spinner {
    width: 50px; /* Taille du spinner */
    height: 50px; /* Taille du spinner */
    border: 5px solid #f3f3f3; /* Couleur de fond */
    border-top: 5px solid #3498db; /* Couleur du haut */
    border-radius: 50%; /* Forme ronde */
    animation: spin 1s linear infinite; /* Animation */
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999; /* S'assurer qu'il est au-dessus d'autres éléments */
}

/* Animation du spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button.partition-button {
    width: 100%;
	margin: 0px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
	align-items: center;
	text-align: left;
    display: flex; /* Utiliser flexbox pour aligner le texte et le cœur */
    justify-content: space-between;
	left: 20px;
    padding: 10px; /* Espacement interne */
	word-break: break-word;
	min-width: 200px;
	white-space: nowrap;
	overflow: hidden;
}

.partition-label {
  display: inline-block;
  white-space: nowrap;
  padding-left: 10px;
}

button.partition-button:hover {
    background-color: var(--swal-header-bg-color);
    color: var(--text-color);
    transform: translateY(-1px);
}

button.partition-button:active {
    transform: translateY(0);
}

button.folder-button {
    width: 100%;
    padding: 8px;
    margin: 2px 0;
    background-color: #e7f1ff;
    border: 2px solid #007bff;
    border-radius: 6px;
    color: #007bff;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button.folder-button-favorite {
    width: 100%;
    padding: 8px;
    margin: 2px 0;
    border-radius: 6px;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	
    background-color: var(--swal-bg-favorite-color);
    color: var(--swal-font-favorite-color);
    border: 1px solid var(--swal-border-favorite-color);
}

button.folder-button:hover {
    background-color: #d0e4ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button.folder-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#StartSignalBox {
    border: 2px solid #411FFF; /* Bordure violette pour correspondre aux boutons */
    border-radius: 8px; /* Coins arrondis pour un effet moderne */
    padding: 10px; /* Espacement intérieur pour éviter que le contenu ne colle à la bordure */
    background-color: #f9f9f9; /* Fond clair pour différencier le groupe (optionnel) */
    margin-bottom: 10px; /* Espacement sous le groupe pour alignement avec les autres éléments */
    display: flex; /* Alignement vertical des sous-div */
    flex-direction: column; /* Empile les éléments verticalement */
    gap: 5px; /* Espacement entre les deux sous-div */
}

#StartSignalBox div {
    display: flex; /* Alignement horizontal des éléments dans chaque sous-div */
    align-items: center; /* Centre verticalement les éléments */
    gap: 5px; /* Espacement entre les labels et inputs/radios */
}

#StartSignalBox label {
    margin: 0; /* Supprime la marge par défaut pour un alignement précis */
}

/* Styles pour la modale de base */
#partitionModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1003;
	overflow: hidden; /* Désactive le scroll sur la modale elle-même */
	/*border: 1px solid red;*/
}

/* Conteneur principal du contenu */
#partitionModal .modal-content {
    position: absolute;
	top: calc(50% + env(safe-area-inset-top, 0px));
	left: calc(50% + env(safe-area-inset-left, 0px));
	transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 5px;
    width: calc(95% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));;
    max-width: 1200px;
	max-height: 95%;
    height: calc(95% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column; /* Empile les enfants verticalement */
    overflow: hidden; /* Important : désactive le scroll sur le conteneur */
	min-height: 0; /* Permet aux enfants flex de rétrécir */
}

/* En-tête FIXE */
#partitionModal .modal-header {
    padding: 1px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0; /* Empêche le rétrécissement */
}

/* Liste SCROLLABLE */
#partitionModal .modal-list {
    overflow-y: auto; /* Active la barre de défilement verticale */
    flex-grow: 1; /* Prend tout l'espace restant */
    padding: 10px 20px;
}

/* Style des éléments de la liste (optionnel) */
#partitionModal .partition-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Styles pour les éléments internes */
#partitionModal ul {
    list-style: none;
    padding: 0;
    overflow-y: auto;
	/*border: 1px solid red;*/
}

#partitionModal button {
    margin-top: 0px;
}

/* Animation pour les notifications */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
    max-width: 350px;
    word-wrap: break-word;
}

/* Barre de progression */
.progress-container {
    position: fixed;
    top: 80%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 500px;
    z-index: 1001;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #3498db;
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-text {
    color: var(--text-color);
    font-size: 12px;
    line-height: 20px;
    position: absolute;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

.progress-info {
    color: var(--text-color, #ffffff);
    background-color: rgba(44, 44, 62, 0.95); /* Fond presque totalement opaque foncé */
    font-size: 14px;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Légère ombre pour plus de lisibilité */
}

#mixingControls button {
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#mixingControls button:hover {
    background-color: #0056b3;
}

.material-icons {
    font-size: 24px; /* Taille personnalisée */
    vertical-align: middle; /* Alignement avec le texte */
}

/* ---------- THÈME SOMBRE PRO ---------- */
/* 2. Style de base pour les nouveaux boutons : .btn-pro */
.btn-pro {
    background-color: var(--surface-dark);
    color: var(--text-color);
    border: 1px solid transparent; /* Bordure discrète */
    border-radius: 12px;           /* Coins bien arrondis pour un look moderne */
    padding: 10px 10px;
    font-size: 16px;
    font-weight: 600;              /* Semi-gras */
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Espace entre icône et texte */
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 15px var(--shadow-color); /* Ombre douce pour le relief */
    transform: translateY(0);
}

.btn-pro:hover {
    background-color: #3a3a52; /* Légèrement plus clair au survol */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.btn-pro:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* 3. Variante pour les boutons d'action principaux (Play, Lancer, etc.) */
.btn-pro.primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.btn-pro.primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 20px var(--shadow-color), 0 0 25px var(--glow-color); /* Ajout d'une lueur */
}

/* 4. Variante pour les boutons circulaires (ex: Play) */
.btn-pro.circular {
    bottom: -25px;      /* Déborde de 25px en bas */
    right: -25px;       /* Déborde de 25px à droite */
    width: 84px;
    height: 84px;
    padding: 20px;
    border-radius: 50%;
    font-size: 28px; /* Pour une icône plus grande */
}
 
/* 1. Style "Tiroir" pour le bouton d'ouverture des partitions */
#openPartitionExplorer {
    /* Forme et positionnement */
    position: relative; /* Peut être utile si vous ajoutez d'autres éléments par la suite */
    border-radius: 0 12px 12px 0; /* Arrondi seulement à droite, pour l'effet "attaché à gauche" */
    border: none;
    border-left: 10px solid var(--primary-color); /* Une barre de couleur pour l'accroche visuelle */
    
    /* Couleurs et typo */
    background: linear-gradient(145deg, #3a3a52, var(--surface-dark)); /* Dégradé subtil pour le relief */
    color: var(--text-color);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px; /* Espacement des lettres pour un look plus "design" */
    padding: 15px 25px 15px 20px;
    
    /* Icône (via le ::before) et alignement */
    align-items: center;
    cursor: pointer;
    
    /* Effets et transitions */
    transform: translateX(0);
    box-shadow: 5px 0px 20px rgba(0,0,0,0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transition douce */
}

#openPartitionExplorer::before {
    content: '';
    display: inline-block;
    width: 38px;
    height: 30px;
    background-color: #FDD835;
    border-radius: 3px;
    margin-right: 15px;
    border-top: 5px solid rgba(0, 0, 0, 0.1);
    background-image: url('apple-touch-icon.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px; /* Taille légèrement supérieure à la hauteur */
    overflow: hidden; /* Masque les parties dépassantes */
}



#openPartitionExplorer:hover {
    transform: translateX(5px); /* Le tiroir "sort" un peu */
    box-shadow: 8px 0px 25px rgba(0,0,0,0.5);
    border-left-color: var(--primary-hover);
}

#openPartitionExplorer:active {
    transform: translateX(2px);
    box-shadow: 3px 0px 15px rgba(0,0,0,0.4);
}

/* 2. Style "Utilitaire" pour le bouton de copie de lien */
#copyUrlButton {
    /* Forme et taille */
    width: 48px;
    height: 48px;
    border-radius: 50%; /* Cercle parfait */
    
    /* Style "fantôme" : transparent avec une bordure */
    background: transparent;
    border: 2px solid var(--surface-dark);
    color: var(--text-color);
    
    /* Centrage de l'icône et typo */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    
    /* Transitions */
    transition: all 0.2s ease-in-out;
}

#copyUrlButton:hover {
    background: var(--surface-dark);
    border-color: var(--primary-color); /* La bordure prend la couleur d'accent */
    color: var(--primary-hover);
    transform: scale(1.1); /* L'icône grossit un peu */
}

#copyUrlButton:active {
    transform: scale(1);
}

/* =================================================================== */
/* ==       STYLE PROFESSIONNEL POUR LES POPUPS (MODALES)         == */
/* =================================================================== */
/* 2. Le conteneur de la popup (commun pour #settingsPopup et #mixingPopup) */
.popup-pro {
    background: rgba(44, 44, 62, 0.85) !important; /* Fond de la modale */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    color: var(--text-color) !important;
    
    /* On définit une largeur maximale, mais on laisse SweetAlert2 gérer le reste */
    width: clamp(320px, 90vw, 500px) !important;
}


/* 3. Style des sections internes de la popup */
.popup-header, .popup-actions {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Empêche le header/footer de rétrécir */
}

.popup-header {
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.popup-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.popup-actions {
    justify-content: flex-end;
    gap: 10px;
    background-color: rgba(0,0,0,0.1); /* Pied de page légèrement différent */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* 4. Bouton pour fermer la popup */
.popup-close-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 24px; /* Taille de l'icône */
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.popup-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* 5. Style des contrôles à l'intérieur (#mixingControls, #settingsControls) */
#mixingControls, #settingsControls {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Plus d'espace pour respirer */
}

#mixingControls label, #settingsControls label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
}

.swal2-title-pro {
    color: #EAEAFB !important;
    font-weight: 600;
}

/* ================================================================== */
/*          NOUVEAU STYLE COMPLET POUR LES SLIDERS DE MIXAGE          */
/* ================================================================== */

/* 1. Layout du conteneur pour aligner Label, Slider et Output */
.swal2-mixing-controls {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr 50px; /* Label | Slider | Valeur */
    align-items: center;
    gap: 15px; /* Espace entre les éléments */
    margin-bottom: 12px; /* Espace entre chaque ligne de mixage */
}

.mixing-track-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 4px;
    width: 100%;
}

.mixing-track-header .mixing-slider-label {
    flex: 1;
}

.recording-actions {
    display: inline-flex;
    gap: 6px;
}

.recording-action-btn {
    background: transparent;
    border: none;
    color: var(--text-color, #fff);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.recording-action-btn:hover,
.recording-action-btn:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color, #00d8ff);
    outline: none;
    transform: scale(1.05);
}

.recording-action-btn .material-icons {
    font-size: 18px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 2. Le conteneur qui va créer le HALO lumineux */
.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 30px; /* Hauteur suffisante pour le halo */
}

/* C'est ici que la magie du halo opère (pseudo-élément) */
.slider-wrapper::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -8px;
    right: -8px;
    bottom: 5px;
    border-radius: 50px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color), inset 0 0 5px rgba(0, 216, 255, 0.5);
    opacity: 0.7;
    transition: all 0.3s ease-in-out;
    pointer-events: none; /* Important pour pouvoir cliquer sur le slider */
}

/* Effet de survol sur le halo */
.slider-wrapper:hover::before {
    opacity: 1;
    box-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color), inset 0 0 5px rgba(0, 216, 255, 0.5);
    transform: scale(1.02);
}

/* 3. Style de l'input range lui-même (la piste et le curseur) */
.slider-wrapper input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px; /* Hauteur de la piste intérieure */
    background: transparent; /* Le wrapper gère le fond */
    outline: none;
    padding: 0;
    margin: 0;
}

/* La PISTE du slider */
.slider-wrapper input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: linear-gradient(to right, 
        #0055ff var(--slider-value, 50%), 
        #00c8ff var(--slider-value, 50%), 
        #1a1a1a var(--slider-value, 50%));
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6); /* Effet de profondeur */
}

.slider-wrapper input[type="range"]::-moz-range-track {
    /* Styles pour Firefox si nécessaire */
    width: 100%;
    height: 12px;
    cursor: pointer;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Le CURSEUR (thumb) du slider */
.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    /* Effet métallique avec un dégradé radial */
    background: radial-gradient(circle at 65% 35%, white, #b8b8b8);
    box-shadow: 0 0 2px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
    margin-top: -6px; /* Centrage vertical du curseur sur la piste */
    transition: transform 0.2s ease;
}

/* Curseur au survol */
.slider-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-wrapper input[type="range"]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 65% 35%, white, #b8b8b8);
    box-shadow: 0 0 2px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
}

/* 4. Style des textes (label et output) */
.mixing-slider-label {
    font-size: 1em;
    color: #eee;
    text-align: right;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.mixing-slider-output {
    font-size: 1em;
    font-weight: bold;
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 4px 0;
    border-radius: 5px;
    text-align: center;
}

.currentPartitionQuestion {
	color: var(--swal-header-bg-color);
    text-align: left;
    font-size: 0.9em;
    white-space: nowrap;
}

.currentPath {
	color: var(--swal-header-bg-color);
    text-align: left;
    font-size: 0.9em;
    white-space: nowrap;
}

/* =================================================================== */
/* ==       NOUVEAU STYLE COMPACT ET MODERNE POUR LES POPUPS (V2)   == */
/* =================================================================== */

.swal-popup-settings.swal2-popup {
    min-width: 600px !important; /* On donne une largeur fixe pour éviter la césure */
    padding: 0 !important; 
    background: var(--swal-bg-color);
    color: var(--swal-text-color);
    display: flex;
    flex-direction: column;
    gap: 0px;
    
    /* Amélioration de la police */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Assure que le header colle bien aux coins supérieurs */
    border-radius: 0.5em; /* Assurez-vous que le radius est appliqué ici */
    overflow: hidden; /* Très important : force les enfants à respecter les coins arrondis *
}

/* 1. En-tête (maintenant un bandeau pleine largeur) */
.swal-custom-header {
    display: flex;
    align-items: center;
    gap: 20px;
    
    /* NOUVEAU : Le style du bandeau */
    background-color: var(--swal-header-bg-color);
    padding: 2px 25px; /* On lui donne son propre padding */
    width: 100%; /* S'assure qu'il prend toute la largeur */
    box-sizing: border-box; /* Pour que le padding soit inclus dans la largeur */
}

.swal-custom-header h3 {
    margin-right: auto;
    font-size: 1.5em;
    font-weight: 600;
    white-space: nowrap; /* Empêche le titre de se couper */
}

.swal-header-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    white-space: nowrap; /* Empêche le texte des boutons de se couper */
}
.swal-header-actions .swal2-confirm { background-color: var(--swal-primary-color); }
.swal-header-actions .swal2-cancel { background-color: var(--swal-secondary-color); }

/* 2. Corps et lignes */
.swal-custom-body {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.swal2-html-container {
	padding: 0px !important;
}

.swal-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Empêche le texte des radios de se couper */
.swal-radio-group-inline label {
    white-space: nowrap;
}

/* 3. Checkboxes */
.swal-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.swal-checkbox-inline-group {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Aligne verticalement "à Droite" avec le label plus haut */
}

.swal-checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.swal-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.custom-checkbox {
    display: inline-block;
    min-width: 20px; /* Utilise min-width pour la robustesse */
    width: 20px;
    height: 20px;
    background-color: var(--swal-checkbox-bg);
    border-radius: 5px;
    transition: background-color 0.2s ease;
}
.swal-checkbox-item input[type="checkbox"]:checked ~ .custom-checkbox {
    background-color: var(--swal-primary-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
}

/* =================================================================== */
/* ==       STYLES SPÉCIFIQUES POUR LA POPUP DE MIXAGE              == */
/* =================================================================== */

.mixing-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px; /* Un peu d'espace entre les sliders */
}

.mixing-slider-label {
    flex-basis: 100px; /* Donne une largeur fixe aux labels pour un alignement parfait */
    flex-shrink: 0;
    text-align: right;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Ajoute "..." si le nom est trop long */
}

.mixing-slider {
    flex-grow: 1; /* Le slider prend toute la place restante */
    accent-color: var(--swal-primary-color); /* Colore le slider */
	background: var(--swal-header-bg-color);
}

.mixing-slider-output {
    font-family: monospace;
    background-color: var(--swal-header-bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 25px;
    text-align: center;
}

.mixing-slider-output input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 8px;
  background: var(--swal-header-bg-color);
  border-radius: 5px;
  outline: none;
}

/* =================================================================== */
/* ==       STYLES SPÉCIFIQUES POUR USERS				            == */
/* =================================================================== */

.user-info {
  display: flex;
  justify-content: flex-end; /* pousse le conteneur à droite */
  align-items: center;
  gap: 16px; /* espace entre user-name-container et boutons */
  padding-right: 16px; /* un peu de marge à droite */
  height: 48px; /* optionnel, hauteur fixe */
}

.user-name-container {
  display: flex;
  flex-direction: column; /* icône au-dessus, texte dessous */
  align-items: center;
  line-height: 1;
}

.user-name-container i.material-icons {
  font-size: 24px;
  margin-bottom: 2px; /* espace réduit entre icône et texte */
}

#username-text {
  font-size: 14px;
  margin: 0;
}

/* Boutons alignés horizontalement */
.user-info a.btn-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: inherit;
  text-decoration: none;
}

/* ================================================================== */
/*          STYLES COMPLÉMENTAIRES POUR LE SLIDER BPM           */
/* ================================================================== */

/* 1. Conteneur principal du BPM */
.bpm-container {
	left: 0;
    padding: 15px 15px;
    margin-top: 0px;
	margin-left: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Séparateur visuel */
}



/* 3. Wrapper qui aligne le slider et la valeur */
.bpm-slider-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* On dit au wrapper du slider (celui avec le halo) de prendre toute la place disponible */
.bpm-slider-wrap .slider-wrapper {
    flex-grow: 1;
}

/* 4. On s'assure que .bpm-value a le même style que les outputs du mixer */
.mixing-slider-output {
    font-size: 1em;
    font-weight: bold;
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 4px 0;
    border-radius: 5px;
    text-align: center;
    min-width: 70px; /* Largeur minimale pour éviter les sauts de ligne */
    white-space: nowrap;
}

/* 2. Label "Pulsation" */
.bpm-label {
    display: block;
    font-size: 1em;
    font-weight: bold;
    color: var(--bg-dark);
    text-align: right;
    min-width: 60px; /* Largeur minimale pour éviter les sauts de ligne */
	font-weight: 500;
    white-space: nowrap;
}

.bpm-value {
    text-align: center;
    min-width: 60px; /* Largeur minimale pour éviter les sauts de ligne */
	font-weight: 2000;
    white-space: nowrap;
    font-size: 1em;
    font-weight: bold;
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 4px 0;
    border-radius: 5px;
    text-align: center;
}

button.folder-button {
    width: 100%;
    text-align: left;
    padding: 10px;
    background-color: var(--swal-bg-color);
    color: var(--swal-text-color);
    border: 1px solid var(--swal-primary-color);
    border-radius: 4px;
    margin-bottom: 5px;
    font-weight: bold;
    position: relative;
}

button.folder-button-favorite {
    width: 100%;
    text-align: left;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-weight: bold;
    position: relative;
	
    background-color: var(--swal-bg-favorite-color);
    color: var(--swal-font-favorite-color);
    border: 1px solid var(--swal-border-favorite-color);
}

button.folder-button::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

button.folder-button.active::before {
    transform: rotate(90deg);
}

#partitionModal .accordion-content {
    padding-left: 15px; /* Indentation à 15 pixels */
    margin-top: 0;
    width: 90%; /* Définit une largeur de base à 90% */
    max-width: 90%; /* Limite maximale à 90% du parent */
    box-sizing: border-box; /* Inclut padding dans la largeur calculée */
}

/****favorites */
.favorite-heart {
    margin-left: 0; /* Réinitialiser margin-left, car &nbsp; gère l’écart */
	margin-right: 10px; 
    cursor: pointer;
    transition: all 0.2s; /* Animation douce */
    position: relative; /* Pour positionner la croix */
}

.favorite-heart:hover svg {
    transform: scale(1.1); /* Zoom léger au survol */
}

/* Cœur noir détouré (non favori) */
.favorite-heart.outline path {
    fill: #000000; /* Noir par défaut */
    stroke: #000000; /* Bordure noire */
    stroke-width: 2;
}

/* Cœur rouge plein (favori) */
.favorite-heart.filled path {
    fill: rgb(241, 0, 0) !important; /* Rouge spécifié, !important pour priorité */
    stroke: none;
}

/* Animation de pulsation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.favorite-heart.pulsing svg {
    animation: pulse 0.5s ease-in-out;
}

/* Animation de croix au survol pour les favoris */
.favorite-heart.filled:hover::after {
    content: '';
    position: absolute;
    width: 15px; /* Ajusté pour s’adapter à 25x25px */
    height: 2px;
    background: rgb(241, 0, 0); /* Rouge du cœur */
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    margin-top: -1px;
    margin-left: -7.5px; /* Centrage ajusté */
    animation: crossFade 0.3s ease-in-out forwards;
}

@keyframes crossFade {
    0% { transform: rotate(45deg) scale(0); opacity: 0; }
    100% { transform: rotate(45deg) scale(1); opacity: 1; }
}

.favorite-heart.filled:hover::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 2px;
    background: rgb(241, 0, 0);
    transform: rotate(-45deg);
    top: 50%;
    left: 50%;
    margin-top: -1px;
    margin-left: -7.5px;
    animation: crossFade 0.3s ease-in-out forwards;
}

.partition-button.invalid .favorite-heart path {
    fill: #888; /* Gris atténué pour invalide */
    cursor: not-allowed;
}

.search-icon {
    color: #00008B;
    fill: #00008B;
}

/* ROOM STATUS */
#roomCodeInline {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.room-master {
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.7);
}

.room-slave {
    border: 2px solid #7A5AF5 !important;
    box-shadow: 0 0 8px rgba(122, 90, 245, 0.7);
}

.room-disconnected {
    border: 2px solid #FF4444 !important;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.7);
}

/* Wrapper ROOM + bouton version : vertical */
.roomInlineWrapper {
    display: flex;
    flex-direction: column;   /* bouton en dessous */
    align-items: center;      /* centré visuellement */
    gap: 1px;
}

/* Bouton de sous-dossier : plus fin que les autres .btn-pro */
.chooseVariantBtn {
    width: 40px !important;
    height: 30px !important;
    background-color: var(--surface-dark) !important;
    color: var(--text-color) !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    padding: 0px 0px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0px !important;
    transition: all 0.2s ease-out !important;
    box-shadow: 0 4px 15px var(--shadow-color) !important;
    transform: translateY(0) !important;
}

/* Petite icône dossier */
.btn-variant-icon {
    font-size: 10px;
}

/* SweetAlert responsive pour QR */
.swal-popup-pro.responsive-qr {
  box-sizing: border-box;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 40px) !important;
  overflow: auto;
  padding: 12px !important;
}

.swal-popup-pro.responsive-qr #qrWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  /* Limite la hauteur utile du QR à la hauteur disponible */
  max-height: calc(100vh * 0.6);
  padding: 8px 0;
  box-sizing: border-box;
}

.swal-popup-pro.responsive-qr #qrCode {
  width: 100%;
  height: auto;
  max-width: 420px;
  max-height: calc(min(80vw, 60vh));
  display: flex;
  justify-content: center;
  align-items: center;
}
.swal-popup-pro.responsive-qr #qrCode img,
.swal-popup-pro.responsive-qr #qrCode canvas {
  width: 100%;
  height: auto;
  display: block;
}


/* Cache le texte "Alain" sur petits écrans */
@media (max-width: 900px) {
  #username-text {
    display: none;
  }
	#controls .row1 {
    height: 70px;
    justify-content: left;
	}

	button.partition-button {
	left: 0px;
	white-space: nowrap;
	overflow: hidden;
	}

	/* Animation yoyo (va-et-vient) */
	@keyframes yoyoScroll {
	  0% { transform: translateX(0); }
	  50% { transform: translateX(-100%); } /* Défile vers la gauche */
	  100% { transform: translateX(0); }     /* Retour à la position initiale */
	}

	.scrolling-yoyo {
	  animation: yoyoScroll 8s linear infinite; /* 8s pour un effet fluide */
	}

	/* Pause au survol */
	.partition-button:hover .scrolling-yoyo {
	  animation-play-state: paused;
	}

	/* Boutons principaux - plus gros et plus fun */
	button.normal {
		padding: 10px 10px; /* Padding augmenté pour des boutons plus grands */
		margin: 0.1em 0.1em;
	}

  /* Boutons plus compacts */
  .btn-pro,
  #openPartitionExplorer,
  #copyUrlButton,
  .record-btn{
    padding: 6px 10px;
    font-size: 13px;
    min-width: auto;
  }

  /* On supprime les textes des boutons pour gagner de la place */
  .btn-pro .btn-text,
  #recordBtn .btn-text,
  #printBtn .btn-text,
  #mixBtn .btn-text,
  #settingsBtn .btn-text {
    display: none !important;
  }

  /* Play rond un peu plus petit */
  .btn-pro.circular {
    width: 64px;
    height: 64px;
    padding: 12px;
    font-size: 24px;
  }
}

.swal2-actions {
  gap: 12px !important;
  justify-content: center !important;
}

.swal2-styled {
  padding: 10px 20px !important;
  font-size: 16px !important;
}

/* Pour Annuler - gris très clair */
.swal2-cancel,
.swal-btn-cancel {
    background-color: #e0e0e0 !important;
    color: #444 !important;
}

/* Pour Télécharger PDF - bleu "btn-pro" */
.swal2-deny,
.swal-btn-download {
    background-color: var(--primary-color) !important;    /* ou #7A5AF5 si tu préfères la valeur fixe */
    color: white !important;
}

/* Imprimer reste vert, on touche pas si tu es content */
.swal2-confirm,
.swal-btn-print {
    background-color: #4caf50 !important;
    color: white !important;
}

@media (max-width: 768px) and (orientation: landscape) {
 #username-text {
    display: none;
  }
	#controls .row1 {
    height: 70px;
    justify-content: left;
	}

	button.partition-button {
	left: 0px;
	white-space: nowrap;
	overflow: hidden;
	}

	/* Animation yoyo (va-et-vient) */
	@keyframes yoyoScroll {
	  0% { transform: translateX(0); }
	  50% { transform: translateX(-100%); } /* Défile vers la gauche */
	  100% { transform: translateX(0); }     /* Retour à la position initiale */
	}

	.scrolling-yoyo {
	  animation: yoyoScroll 8s linear infinite; /* 8s pour un effet fluide */
	}

	/* Pause au survol */
	.partition-button:hover .scrolling-yoyo {
	  animation-play-state: paused;
	}

	/* Boutons principaux - plus gros et plus fun */
	button.normal {
		padding: 10px 10px; /* Padding augmenté pour des boutons plus grands */
		margin: 0.1em 0.1em;
	}

  /* Boutons plus compacts */
  .btn-pro,
  #openPartitionExplorer,
  #copyUrlButton,
  .record-btn{
    padding: 6px 10px;
    font-size: 13px;
    min-width: auto;
  }

  /* On supprime les textes des boutons pour gagner de la place */
  .btn-pro .btn-text,
  #recordBtn .btn-text,
  #printBtn .btn-text,
  #mixBtn .btn-text,
  #settingsBtn .btn-text {
    display: none !important;
  }

  /* Play rond un peu plus petit */
  .btn-pro.circular {
    width: 64px;
    height: 64px;
    padding: 12px;
    font-size: 24px;
  }
}

.collection-menu {
  cursor: pointer;
  font-size: 20px;
  margin-right: 6px;
  opacity: 0.7;
}
.collection-menu:hover {
  opacity: 1;
}

.collection-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
