/* =================================================================== */
/* :: 1. Styles Généraux & Body                                        */
/* =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f7;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

/* =================================================================== */
/* :: 2. Layout & Conteneurs Principaux                                */
/* =================================================================== */
#content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    width: 100%;
    transition: justify-content 0.6s ease-in-out, padding-top 0.6s ease-in-out;
}

#content-wrapper.search-active {
    justify-content: flex-start;
    padding-top: 5vh;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    position: relative; /* Pour le positionnement de #auth-widget-container */
}

main {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* =================================================================== */
/* :: 3. Typographie                                                   */
/* =================================================================== */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
}

p {
    font-size: 1.1rem;
    color: #6e6e73;
    margin-top: 5px;
}

#home-title:hover {
    color: #0070c9;
}

h1#home-title {
    display: inline-block;
    cursor: pointer;
}

/* =================================================================== */
/* :: 4. Barre de recherche & Suggestions                              */
/* =================================================================== */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background-color: transparent;
}

#search-input {
    flex: 1;
    padding: 15px 25px;
    font-size: 1rem;
    border: 1px solid #d1d1d6;
    border-radius: 30px;
    outline: none;
    background-color: #fff;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

#search-input:hover {
    box-shadow: 0 0 12px rgba(0, 112, 201, 0.3);
}

#search-input:focus {
    border-color: #0070c9;
    box-shadow: 0 0 8px rgba(0, 112, 201, 0.2);
}

#search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-width: 600px;
    background-color: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(32,33,36,.28);
    padding: 10px 0;
    box-sizing: border-box;
    z-index: 100;
    text-align: left;
}

#search-suggestions.hidden {
    display: none;
}

#search-suggestions h4 {
    font-size: 0.8rem;
    color: #5f6368;
    margin: 10px 20px 5px;
    font-weight: 700;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #3c4043;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

/* =================================================================== */
/* :: 5. Barre de chargement & Résultats                               */
/* =================================================================== */
#loading-bar {
    width: 0;
    height: 4px;
    max-width: 600px;
    background-color: #0070c9;
    border-radius: 4px;
    transition: width 0.4s ease;
    margin-top: 15px;
    display: none;
}

#results {
    width: 100%;
    margin-top: 15px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: cascadeFadeIn 0.5s forwards ease-out;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.result-item:hover {
    background-color: #f0f0f5;
    border-color: #e0e0e5;
}

.result-item.expanded {
    max-height: 250px;
}

.result-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.result-info {
    flex-grow: 1;
    text-align: left;
}

.result-info h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 5px;
}

.result-info p {
    font-size: 0.9rem;
    color: #6e6e73;
}

.result-details {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.result-item.expanded .result-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    opacity: 1;
}

#open-in-spotify {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #1DB954;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

#open-in-spotify:hover {
    background-color: #17a142;
}

@keyframes cascadeFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================== */
/* :: 6. Footer & Sélecteur de langue                                  */
/* =================================================================== */
.google-footer {
    width: 100%;
    background-color: #f2f2f2;
    color: #70757a;
    font-size: 14px;
    border-top: 1px solid #dadce0;
    padding: 15px 30px;
    text-align: left;
    margin-top: auto;
    border-radius: 12px;
}

.google-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.google-footer .footer-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.google-footer .footer-line a {
    color: #70757a;
    text-decoration: none;
}
.google-footer .footer-line a:hover {
    text-decoration: underline;
}

#language-switcher-container a {
    margin-left: 10px;
    cursor: pointer;
}
#language-switcher-container a.active {
    font-weight: bold;
    text-decoration: none;
    cursor: default;
}

.lang-separator {
    margin: 0 7px 0 17px;
    color: inherit;
    user-select: none;
}

/* =================================================================== */
/* :: 7. Mode Sombre & Animations (Arrière-plan)                       */
/* =================================================================== */
#concert-background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1;overflow:hidden;background:linear-gradient(180deg,#1D2B4A 0%,#3a1c4b 100%);opacity:0;transition:opacity 1s ease-in-out}
body.dark-mode{background-color:transparent}
body.dark-mode #concert-background{opacity:1}
.halo{position:absolute;border-radius:50%;filter:blur(120px);opacity:0;animation:fade-in-out 15s infinite alternate}
.halo1{background-color:#5d3d82;width:60vw;height:60vh;top:-20vh;left:-20vw;animation-delay:-2s}
.halo2{background-color:#2c5a8e;width:70vw;height:70vh;bottom:-30vh;right:-30vw;animation-delay:-7s}
.light-stream{position:absolute;width:2px;height:150vh;top:-25vh;left:50%;transform-origin:50% 100%;animation:sweep 20s linear infinite;opacity:0}
.stream1,.stream2,.stream3{animation-name:sweep}
.stream1{background:linear-gradient(180deg,transparent 0%,rgba(52,152,219,.5) 50%,transparent 100%);transform:rotate(-30deg);animation-duration:18s;animation-delay:-2s}
.stream2{background:linear-gradient(180deg,transparent 0%,rgba(155,89,182,.5) 50%,transparent 100%);transform:rotate(20deg);animation-duration:22s;animation-delay:-10s}
.stream3{background:linear-gradient(180deg,transparent 0%,rgba(26,188,156,.4) 50%,transparent 100%);transform:rotate(60deg);animation-duration:16s;animation-delay:-5s}
@keyframes fade-in-out{from{opacity:0;transform:scale(.8)}to{opacity:.4;transform:scale(1.2)}}
@keyframes sweep{from{transform:rotate(-45deg);opacity:1}50%{opacity:.3}to{transform:rotate(45deg);opacity:1}}

body.dark-mode #search-input{background-color:rgba(25,25,30,.7);border-color:rgba(80,80,90,.5);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);box-shadow:0 4px 15px rgba(0,0,0,.5);color:#fff;transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;}
body.dark-mode #search-input:hover {border-color: rgba(132, 173, 255, 0.5); box-shadow: 0 4px 15px rgba(0,0,0,.5), 0 0 15px rgba(80, 160, 255, 0.5);}
body.dark-mode #search-input:focus {border-color: #4d90fe; box-shadow: 0 0 8px rgba(77, 144, 254, 0.7);}
body.dark-mode .result-item{background-color:rgba(25,25,30,.7);border-color:rgba(80,80,90,.5);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);box-shadow:0 4px 15px rgba(0,0,0,.5)}
body.dark-mode .result-item:hover, body.dark-mode .result-item.expanded{background-color:rgba(45,45,55,.8)}
body.dark-mode header h1,body.dark-mode .result-info h2{color:#fff}
body.dark-mode header p,body.dark-mode .result-info p{color:#c0c0d0}
body.dark-mode .google-footer{background-color:rgba(28,28,32,.8);border-top:1px solid #3c4043;color:#9aa0a6}
body.dark-mode .google-footer .footer-line a, body.dark-mode #language-switcher-container a {color:#9aa0a6}
body.dark-mode #search-suggestions{background-color:rgba(40,40,45,.9);border-color:#3c4043;backdrop-filter:blur(5px)}
body.dark-mode #search-suggestions h4{color:#9aa0a6}
body.dark-mode .suggestion-item{color:#e8eaed}
body.dark-mode .suggestion-item:hover{background-color:rgba(255,255,255,.1)}

/* =================================================================== */
/* :: 8. Authentification, Modales & Menu Profil                       */
/* =================================================================== */
#auth-widget-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000; /* Doit être élevé pour être au-dessus des autres éléments, surtout les modales */
}

#auth-initial-button, #profile-button {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    background-color: #f2f2f2; /* Style similaire au footer */
    border: 1px solid #d1d1d6;
    border-radius: 20px; /* Bords arrondis */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit; /* Assurer la cohérence de la police */
}
#auth-initial-button:hover, #profile-button:hover {
    background-color: #e8e8e8;
    border-color: #c0c0c0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#profile-menu {
    position: absolute;
    top: calc(100% + 8px); /* Un peu d'espace sous le bouton */
    right: 0;
    background-color: #ffffff;
    border-radius: 12px; /* Bords arrondis */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    width: 250px; /* Largeur du menu */
    padding: 8px 0;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s ease-in-out;
}
#profile-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
#profile-menu .profile-email {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 8px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#profile-menu .menu-item button#logout-btn{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #333;
    cursor: default; /* Pour les items non cliquables */
}

#profile-menu #dictionary-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #0070c9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
    margin-top: 5px; /* si besoin */
}
#profile-menu #dictionary-btn:hover {
    background-color: #005a9e;
}
#profile-menu .menu-item select {
    font-family: inherit;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    margin-left: 10px;
}
#profile-menu button#logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer !important;
    color: #d93025; /* Rouge pour la déconnexion */
    padding: 10px 16px; /* Assurer le padding */
    font-size: 0.9rem;
    font-family: inherit;
}
#profile-menu .menu-item:hover:not(.profile-email), 
#profile-menu button#logout-btn:hover {
    background-color: #f5f5f5;
}

#auth-modal-overlay, #alert-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Au-dessus de tout */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
#auth-modal-overlay:not(.hidden), #alert-modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#auth-modal, #alert-modal {
    background-color: #ffffff;
    padding: 25px 35px;
    border-radius: 16px; /* Bords arrondis */
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 420px; /* Largeur max de la modale */
    position: relative;
    text-align: left; /* Texte aligné à gauche dans la modale */
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}
#auth-modal-overlay:not(.hidden) #auth-modal,
#alert-modal-overlay:not(.hidden) #alert-modal {
    transform: scale(1);
}

#close-modal-btn { /* Style commun au bouton de fermeture des modales */
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    font-size: 1.8rem; color: #aaa;
    cursor: pointer; line-height: 1; padding: 0;
}
#close-modal-btn:hover { color: #777; }

#auth-modal h2, #alert-modal h2 {
    font-size: 1.8rem;
    color: #1d1d1f;
    margin-bottom: 20px;
    text-align: center;
}

#auth-modal .auth-form-view {
    transition: opacity 0.3s ease, max-height 0.4s ease, transform 0.3s ease; /* Ajout transform */
}
#auth-modal .auth-form-view.hidden {
    opacity: 0;
    max-height: 0 !important; /* Important pour forcer le masquage */
    transform: translateX(-20px); /* Animation de glissement */
    pointer-events: none; /* Empêche l'interaction */
    padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0;
    border: none;
    overflow: hidden;
}

#auth-modal div, #alert-modal div:not(.alert-modal-actions) {
    margin-bottom: 15px;
}
#auth-modal label, #captcha-container label {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 5px;
    font-weight: 500;
}
#auth-modal input[type="email"],
#auth-modal input[type="password"],
#auth-modal input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #d1d1d6;
    border-radius: 8px; /* Bords arrondis */
    box-sizing: border-box;
    font-family: inherit; /* Hériter la police du site */
}
#auth-modal input[type="email"]:focus,
#auth-modal input[type="password"]:focus,
#auth-modal input[type="text"]:focus {
    border-color: #0070c9;
    box-shadow: 0 0 0 3px rgba(0,112,201,0.2); /* Ombre au focus */
    outline: none;
}
#auth-modal small {
    font-size: 0.8rem;
    color: #6e6e73;
    display: block;
    margin-top: 3px;
}

#captcha-container {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
#captcha-container label.captcha-question { /* Classe spécifique pour la question CAPTCHA */
    font-style: italic;
    margin-bottom: 8px;
}

#auth-modal button[type="submit"],
.alert-modal-actions button {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #0070c9;
    border: none;
    border-radius: 8px; /* Bords arrondis */
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit; /* Hériter la police du site */
    margin-top: 5px; /* Petit espace si plusieurs boutons */
}
#auth-modal button[type="submit"]:hover,
.alert-modal-actions button:hover {
    background-color: #005a9e;
}

.alert-modal-actions {
    display: flex;
    gap: 10px; /* Espace entre les boutons */
    margin-top: 20px;
}
.alert-modal-actions button#alert-modal-cancel-btn {
    background-color: #6c757d; /* Gris pour annuler */
}
.alert-modal-actions button#alert-modal-cancel-btn:hover {
    background-color: #5a6268;
}

#alert-modal-progressbar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    height: 10px;
    margin-top: 15px;
    overflow: hidden; /* Pour les coins arrondis de la barre interne */
}
#alert-modal-progressbar-container.hidden {
    display: none;
}
#alert-modal-progressbar {
    width: 0%;
    height: 100%;
    background-color: #0070c9;
    border-radius: 8px;
    transition: width 0.3s ease-out; /* Animation fluide */
}


.form-switcher {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #6e6e73;
}
.form-switcher a {
    color: #0070c9;
    text-decoration: none;
    font-weight: 500;
}
.form-switcher a:hover { text-decoration: underline; }

#auth-message, #alert-modal-message {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 20px; /* Pour éviter les sauts de layout */
}
#alert-modal-message { margin-bottom: 0; } /* Spécifique à la modale d'alerte */

#auth-message.success, #alert-modal-message.success { color: #28a745; }
#auth-message.error, #alert-modal-message.error { color: #dc3545; }

body.dark-mode #auth-initial-button, body.dark-mode #profile-button {
    color: #e8eaed;
    background-color: rgba(50,50,55,0.8);
    border-color: #525355;
}
body.dark-mode #auth-initial-button:hover, body.dark-mode #profile-button:hover {
    background-color: rgba(70,70,75,0.9);
    border-color: #6a6b6d;
}

body.dark-mode #profile-menu {
    background-color: #2b2d30; 
    border-color: #43464a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
body.dark-mode #profile-menu .profile-email { border-bottom-color: #43464a; color: #e8eaed; }
body.dark-mode #profile-menu .menu-item { color: #c9cdd0; }
body.dark-mode #profile-menu .menu-item select {
    background-color: #3c4043;
    border-color: #5f6368;
    color: #e8eaed;
}
body.dark-mode #profile-menu .menu-item:hover:not(.profile-email),
body.dark-mode #profile-menu button#logout-btn:hover { background-color: #3c4043; }
body.dark-mode #profile-menu button#logout-btn { color: #f28b82; /* Rouge plus doux pour mode sombre */ }

body.dark-mode #auth-modal-overlay, body.dark-mode #alert-modal-overlay {
    background-color: rgba(10, 10, 10, 0.7); /* Plus sombre et opaque */
}
body.dark-mode #auth-modal, body.dark-mode #alert-modal {
    background-color: #2f3136; /* Fond de la modale sombre */
    border: 1px solid #40444b;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
body.dark-mode #close-modal-btn { color: #b9bbbe; }
body.dark-mode #close-modal-btn:hover { color: #ffffff; }
body.dark-mode #auth-modal h2, body.dark-mode #alert-modal h2 { color: #e8eaed; }
body.dark-mode #auth-modal label, body.dark-mode #captcha-container label { color: #b9bbbe; }
body.dark-mode #auth-modal input[type="email"],
body.dark-mode #auth-modal input[type="password"],
body.dark-mode #auth-modal input[type="text"] {
    background-color: #202225; /* Fond des inputs sombre */
    border-color: #40444b; /* Bordure des inputs sombre */
    color: #e8eaed;
}
body.dark-mode #auth-modal input[type="email"]:focus,
body.dark-mode #auth-modal input[type="password"]:focus,
body.dark-mode #auth-modal input[type="text"]:focus {
    border-color: #0096cf; /* Bleu vif pour le focus en mode sombre */
    box-shadow: 0 0 0 3px rgba(0,150,207,0.3);
}
body.dark-mode #auth-modal small { color: #8e9297; }
body.dark-mode #captcha-container { background-color: #292b2f; }

body.dark-mode #auth-modal button[type="submit"],
body.dark-mode .alert-modal-actions button {
    background-color: #0096cf; /* Bleu plus vif pour les boutons en mode sombre */
}
body.dark-mode #auth-modal button[type="submit"]:hover,
body.dark-mode .alert-modal-actions button:hover {
    background-color: #007bab;
}
body.dark-mode .alert-modal-actions button#alert-modal-cancel-btn {
    background-color: #525559;
}
body.dark-mode .alert-modal-actions button#alert-modal-cancel-btn:hover {
    background-color: #43464a;
}

body.dark-mode #alert-modal-progressbar-container {
    background-color: #3a3d40;
}
body.dark-mode #alert-modal-progressbar {
    background-color: #0096cf;
}

body.dark-mode .form-switcher { color: #8e9297; }
body.dark-mode .form-switcher a { color: #00aaff; }
body.dark-mode #auth-message.success, body.dark-mode #alert-modal-message.success { color: #3fb950; }
body.dark-mode #auth-message.error, body.dark-mode #alert-modal-message.error { color: #f85149; }

.progressbar-container {
    width: 100%;
    height: 12px; /* Hauteur de la barre */
    background-color: #e9ecef; /* Fond de la barre */
    border-radius: 6px; /* Bords arrondis pour le conteneur */
    margin-bottom: 15px; /* Espace avant le bouton */
    overflow: hidden; /* Pour que la barre interne respecte les coins arrondis */
    position: relative; /* Pour le texte de pourcentage */
}
.progressbar-container.hidden {
    display: none;
}

.progressbar-bar {
    width: 0%;
    height: 100%;
    background-color: #0070c9; /* Couleur par défaut (bleu) */
    border-radius: 6px;
    transition: width 400ms ease-in-out; /* Animation spécifiée */
}
.progressbar-bar.success {
    background-color: #16a34a; /* Vert succès */
}
.progressbar-bar.error {
    background-color: #dc2626; /* Rouge erreur/timeout */
}

.progressbar-text { /* Pour afficher le pourcentage */
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 12px; /* Même hauteur que la barre */
    font-size: 10px;
    color: #ffffff;
    font-weight: bold;
    left: 0;
    top: 0;
    text-shadow: 0 0 2px rgba(0,0,0,0.5); /* Lisibilité */
}

body.dark-mode .progressbar-container {
    background-color: #3a3d40;
}
body.dark-mode .progressbar-bar {
    background-color: #0096cf; /* Bleu plus vif en mode sombre */
}
body.dark-mode .progressbar-bar.success {
    background-color: #16a34a; /* Vert reste le même ou ajustez si besoin */
}
body.dark-mode .progressbar-bar.error {
    background-color: #dc2626; /* Rouge reste le même ou ajustez si besoin */
}
body.dark-mode .progressbar-text {
    color: #e8eaed;
    text-shadow: 0 0 2px rgba(0,0,0,0.7);
}

#login-form.form-locked fieldset, /* Si vous groupez vos inputs dans un fieldset */
#login-form.form-locked input,
#login-form.form-locked button {
    pointer-events: none;
    opacity: 0.7;
}

/* =================================================================== */
/* :: 9. STYLES MANQUANTS POUR LE MENU PROFIL                          */
/* =================================================================== */
#profile-menu .menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px; /* Assure un padding cohérent */
}

.profile-section {
    padding: 12px 0; /* Padding vertical pour la section */
    border-bottom: 1px solid #eeeeee;
}
.profile-section:last-of-type,
.profile-section.other-options {
    border-bottom: none;
}
.profile-section.other-options {
    padding: 10px 16px 4px 16px;
}
.profile-section.other-options p {
    font-size: 0.8rem;
    color: #999;
    min-height: 1em;
}

.profile-section-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    padding: 0 16px;
}

.mini-progressbar-container {
    height: 4px;
    width: 90%; /* Un peu plus petit que la carte */
    background-color: #e9ecef;
    border-radius: 2px;
    margin: 10px auto 0 auto; /* Centré avec marge */
    overflow: hidden;
    transition: height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}
.mini-progressbar-container.hidden {
    height: 0;
    margin-top: 0;
    opacity: 0;
}
.mini-progressbar-bar {
    height: 100%;
    width: 0%;
    background-color: #0070c9; /* Bleu par défaut */
    border-radius: 2px;
    transition: width 400ms ease-in-out, background-color 0.3s ease;
}
.mini-progressbar-bar.success {
    background-color: #16a34a; /* Vert succès */
}
.mini-progressbar-bar.error {
    background-color: #dc2626; /* Rouge erreur */
}

.update-feedback {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 5px;
    min-height: 1.2em; /* Empêche le saut de layout */
    font-weight: 500;
}
.update-feedback.error {
    color: #dc2626; /* Rouge erreur */
}

body.dark-mode .profile-section {
    border-bottom-color: #43464a;
}

body.dark-mode .profile-section-title {
    color: #9aa0a6; /* Couleur claire mais discrète */
}
body.dark-mode .profile-section.other-options p {
    color: #777;
}

body.dark-mode .mini-progressbar-container {
    background-color: #3a3d40; /* Fond sombre pour la barre */
}
body.dark-mode .mini-progressbar-bar {
    background-color: #0096cf; /* Bleu plus vif */
}

/* Feedback en mode sombre */
body.dark-mode .update-feedback.error {
    color: #f85149; /* Rouge plus clair */
}

/* =================================================================== */
/* :: 10. STYLES POUR LE NOUVEAU MENU PROFIL                           */
/* =================================================================== */
#profile-menu .menu-item {
    justify-content: center; /* Centre les nouveaux boutons */
    padding: 6px 16px 10px 16px;
}

.segmented-control {
    display: flex;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #5f6368; /* Bordure (dark mode) */
}
.segmented-control button {
    flex: 1;
    padding: 8px 5px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: transparent;
    color: #333;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.segmented-control button + button {
    border-left: 1px solid #5f6368; /* Séparateur (dark mode) */
}
.segmented-control button.active {
    background-color: #0070c9; /* Couleur active */
    color: #ffffff;
    font-weight: 600;
}
.segmented-control button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1); /* Hover (dark mode) */
}

.profile-section.logout-section {
    border-bottom: none; /* Pas de bordure en bas */
    padding-top: 8px;
}
#profile-menu button#logout-btn {
    width: 100%;
    text-align: center; /* Centré */
    padding: 10px 12px;
    font-size: 0.95rem; /* Un peu plus petit que "Dictionnaire" */
    font-weight: 600;
    color: #f28b82; /* Rouge (dark mode) */
    background-color: rgba(242, 139, 130, 0.1); /* Fond teinté rouge */
    border: 1px solid rgba(242, 139, 130, 0.5); /* Bordure rouge */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

#profile-menu button#logout-btn:hover {
    background-color: rgba(242, 139, 130, 0.2);
    border-color: #f28b82;
}

body:not(.dark-mode) .segmented-control {
    border-color: #ccc;
}
body:not(.dark-mode) .segmented-control button {
    color: #333;
}
body:not(.dark-mode) .segmented-control button + button {
    border-left-color: #ccc;
}
body:not(.dark-mode) .segmented-control button:hover:not(.active) {
    background-color: #f0f0f0;
}

body:not(.dark-mode) #profile-menu button#logout-btn {
    color: #d93025;
    background-color: rgba(217, 48, 37, 0.05);
    border-color: rgba(217, 48, 37, 0.4);
}
body:not(.dark-mode) #profile-menu button#logout-btn:hover {
    background-color: rgba(217, 48, 37, 0.1);
    border-color: #d93025;
}

/* =================================================================== */
/* :: 11. CORRECTIONS LISIBILITÉ                                       */
/* =================================================================== */
body:not(.dark-mode) #profile-menu .segmented-control button + button {
    border-left-color: #ccc; /* Séparateur clair */
}
body:not(.dark-mode) #profile-menu .segmented-control button:hover:not(.active) {
    background-color: #f0f0f0; /* Fond de survol léger */
}

body:not(.dark-mode) #profile-menu .segmented-control button.active {
    color: #ffffff; 
}

body:not(.dark-mode) #profile-menu .segmented-control {
    border: 1px solid #ccc;
}

body.dark-mode #profile-menu .segmented-control button {
    color: #c9cdd0 !important; 
}

body.dark-mode #profile-menu .segmented-control button.active {
    color: #ffffff !important; 
}

body.dark-mode #profile-menu .segmented-control {
    border: 1px solid #5f6368;
}
body.dark-mode #profile-menu .segmented-control button + button {
   border-left: 1px solid #5f6368;
}

body.dark-mode #profile-menu .segmented-control button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}
