/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Assure une gestion cohérente des tailles */
}

html, body {
    scroll-behavior: smooth; /* Défilement fluide */
}

img, video {
    max-width: 100%; /* Empêche les images/vidéos de déborder */
    height: auto;
}

ul, ol {
    list-style: none; /* Supprime les puces des listes */
}

a {
    text-decoration: none; /* Supprime le soulignement par défaut */
    color: inherit; /* Hérite de la couleur du texte parent */
}

button {
    background: none; /* Supprime les styles par défaut des boutons */
    border: none;
    cursor: pointer;
}

input, textarea, button, select {
    font-family: inherit; /* Hérite de la police du parent */
}

.hidden {
    display: none; /* Masque l'élément */
}


/* Global styling */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #2b5876, #4e4376);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
    overflow-y: auto;
    flex-direction: column;
}


.copy-alert {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50; /* Vert succès */
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}

.copy-alert.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.copy-alert.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}





.container-nombre-mots-de-passe {
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    margin: 15px 0;
    
}

.container-nombre-mots-de-passe input {
    margin-left: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    width: 40px !important;
    padding: 0px !important;
    border-radius: 6px !important;
    text-align: center !important;
    width: 35px !important;
}


.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8em;
}

label {
    display: block;
    margin: 10px 0;
    font-size: 0.9em;
}

input[type="checkbox"], input[type="range"], input[type="number"] {
    margin-top: 5px;
}

button {
    background: #FF7E5F;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #feb47b, #ff7e5f);
}


.output, .history {
    margin-top: 20px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 10px;
    animation: slideIn 0.5s ease-out;
}

.tooltip {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 10px;
    color: #ccc;
    font-weight: bold;
    transition: color 0.4s ease;
}

.tooltip.weak {
    color: #ff4d4d; /* Rouge pour faible */
}

.tooltip.medium {
    color: #ffa500; /* Orange pour moyen */
}

.tooltip.strong {
    color: #4caf50; /* Vert pour fort */
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

/* 🌟 Mode Clair amélioré */
body.light-mode {
    background: linear-gradient(135deg, #f0f4f8, #e6ecf3); /* Dégradé clair et doux */
    color: #333333;
}

/* Conteneur principal (effet verre) */
body.light-mode .container {
    background: rgba(255, 255, 255, 0.85); /* Légère transparence */
    backdrop-filter: blur(10px); /* Effet verre */
    color: #333333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(200, 200, 200, 0.6) !important;
}

/* 🌟 Boutons */
body.light-mode button {
    background: #FF7E5F; /* Dégradé chaleureux */
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.light-mode button:hover {
    background: linear-gradient(135deg, #feb47b, #ff7e5f);
    transform: translateY(-2px);
}

/* 🌟 Labels et textes */
body.light-mode label {
    color: #444;
}

/* 🌟 Inputs et sliders */
body.light-mode input[type="text"],
body.light-mode input[type="number"],
body.light-mode input[type="checkbox"] {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #d1d5db;
    padding: 8px;
    border-radius: 8px;
    transition: border 0.3s ease;
}

body.light-mode input:focus {
    border-color: #ff7e5f;
    outline: none;
}

/* 🌟 Cases à cocher */
body.light-mode input[type="checkbox"] {
    accent-color: #ff7e5f;
}

/* 🌟 Barre de progression */
body.light-mode .progress-bar {
    background: rgba(200, 200, 200, 0.5);
}

body.light-mode #progressStrength {
    background: #ff7e5f;
}

/* 🌟 Liens */
body.light-mode a {
    color: #ff7e5f;
    text-decoration: none;
}

body.light-mode a:hover {
    color: #feb47b;
}

/* 🌟 Footer */
body.light-mode .footer {
    background: rgba(240, 244, 248, 0.85);
    color: #333;
    border-top: 1px solid rgba(200, 200, 200, 0.3);
    padding: 15px 10px;
}

/* 🌟 Effet survol des options */
body.light-mode .settings label {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s, transform 0.2s;
    cursor: pointer;
}

body.light-mode .settings label:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}

/* 🌟 Design du slider */
body.light-mode input[type="range"] {
    background: #ff7e5f;
    height: 4px;
    border-radius: 5px;
}

body.light-mode input[type="range"]::-webkit-slider-thumb {
    background: #feb47b;
    border-radius: 50%;
    width: 16px;
    height: 16px;
}

body.light-mode input#passwordCount,
body.light-mode .language-switch select,
body.light-mode select#category,
body.light-mode .settings label {
    border: 1px solid rgba(200, 200, 200, 0.6) !important;
}



/* Styling pour les labels avec des icônes */
.settings label {
    display: flex;
    align-items: center; /* Aligne verticalement la case et le texte */
    justify-content: flex-start; /* Aligne horizontalement à gauche */
    gap: 10px; /* Ajoute un espace entre la case à cocher et le texte */
    margin: 10px 0;
    font-size: 1em;
    color: #fff; /* Assure une couleur de texte lisible */
    background: rgba(255, 255, 255, 0.1); /* Couleur de fond légèrement visible */
    padding: 10px;
    border-radius: 8px; /* Ajoute des coins arrondis */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Ajoute une légère ombre */
    transition: transform 0.2s, background 0.3s;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

.settings label:hover {
    background: rgba(255, 255, 255, 0.2); /* Change légèrement la couleur au survol */
    transform: translateY(-3px);
}

.settings label input {
    margin-right: 10px;
    transform: scale(1.3);
    accent-color: #ff7e5f; /* Couleur des cases cochées */
}

.settings label span {
    flex: 1; /* Prend toute la place restante pour le texte */
    text-align: left; /* Aligne le texte à gauche */
    font-size: 1em; /* Taille de texte uniforme */
}

/* Icônes ou badges pour chaque option */
.settings label::before {
    font-size: 1.2em;
    margin-right: 10px;
    color: #ff7e5f;
}

/* Styling pour le slider */
.range-slider input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #FF7E5F;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #feb47b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #feb47b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Style pour la valeur de la longueur */
.range-slider span {
    display: inline-block;
    font-size: 1em;
    color: #333;
    margin-top: 5px;
    text-align: center;
}

/* Champ de nombre stylisé */
input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: center;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    border-color: #ff7e5f;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 126, 95, 0.5);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar div {
    height: 100%;
    transition: width 0.3s;
}



/* Petits écrans (mobiles, <768px) */
@media (max-width: 768px) {
    .container {
        width: 95%; /* Utilisation maximale de l'espace */
        padding: 15px;
        box-shadow: unset;
        background: unset;
    }

    h1 {
        font-size: 1.4rem; /* Taille relative */
    }

    .settings label {
        flex-direction: column;
        font-size: 0.9rem; /* Réduit légèrement la police */
        width: 100%;
    }

    input[type="number"], input[type="range"] {
        width: 100%; /* Élargit les champs pour remplir la largeur */
    }

    button {
        font-size: 1rem;
        padding: 10px;
    }

    .range-slider span {
        font-size: 0.9rem;
    }

    .container-nombre-mots-de-passe input {
         text-align: unset !important; 
    }
    
    body.light-mode .container {
        background: unset !important;
        backdrop-filter: blur(10px);
        color: #333333;
        box-shadow: unset !important; 
        border-radius: 12px;
        border: unset !important;
    }
}

/* Très petits écrans (moins de 480px) */
@media (max-width: 480px) {

.container-nombre-mots-de-passe input {
        text-align: unset !important; 
   }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .settings label {
        font-size: 0.8rem; /* Réduit davantage la taille des textes */
        padding: 8px; /* Réduit le padding des labels */
    }

    .range-slider span {
        font-size: 0.8rem;
    }

    button {
        font-size: 0.9rem;
        padding: 8px 12px;
        margin-top: 10px;
    }

    input[type="number"] {
        font-size: 0.9rem;
        padding: 8px;
    }

    body.light-mode .container {
        background: unset !important;
        backdrop-filter: blur(10px);
        color: #333333;
        box-shadow: unset !important; 
        border-radius: 12px;
        border: unset !important;
    }
}

/* Grands écrans (plus de 1200px) */
@media (min-width: 1200px) {
    .container {
        width: 500px; /* Élargit le conteneur pour grands écrans */
        padding: 40px;
        margin-top: 20px;
    }

    h1 {
        font-size: 25px; /* Police plus grande */
    }

    .settings label {
        font-size: 1.1rem; /* Police légèrement augmentée */
    }

    button {
        font-size: 1.2rem;
        padding: 12px 24px;
    }

    .range-slider span {
        font-size: 1.1rem;
    }
}



.language-switch {
    text-align: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.language-switch select,
select#category{

    appearance: none; /* Supprime l'apparence native */
    -webkit-appearance: none; /* Safari & Chrome */
    -moz-appearance: none; /* Firefox */
    text-align: center;
    padding: 5px 10px;
    border-radius: 5px;
    border: none;
    font-size: 1em;
    background-color: white;
    cursor: pointer;
    width: 100px;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

.nav-password {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Conteneur principal du switch */
.theme-switch {
   
}

.toggle-container {
    position: relative;
    width: 60px;
    height: 30px;
    display: inline-block;
}

/* Input invisible */
.toggle-input {
    display: none;
}

/* Label (slider) */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 15px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0 5px;
    transition: background-color 0.3s ease;
}

/* Icônes soleil et lune */
.toggle-icon {
    font-size: 18px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.sun {
    color: #f9d71c;
}

.moon {
    color: #1e90ff;
}

/* Slider (cercle) */
.toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

/* Mode sombre activé */
.toggle-input:checked + .toggle-label {
    background-color: #4caf50;
}

.toggle-input:checked + .toggle-label::after {
    transform: translateX(30px);
}

.toggle-input:checked + .toggle-label .sun {
    opacity: 0.5;
}

.toggle-input:checked + .toggle-label .moon {
    opacity: 1;
}

.toggle-label .sun {
    opacity: 1;
}

.toggle-input:checked + .toggle-label .sun {
    opacity: 0.5;
}



.footer {
    text-align: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #2b5876, #4e4376); /* Couleur similaire à l'arrière-plan global */
    color: #fff; /* Couleur du texte */
    font-size: 0.9em;
    position: fixed; /* Fixé en bas de la page */
    bottom: 0;
    left: 0;
    width: 100%; /* Prend toute la largeur */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3); /* Ombre subtile */
    z-index: 10; /* Assure que le footer est au-dessus des autres éléments */
    animation: fadeInFooter 1s ease-in-out;

}

.footer a {
    color: #ff7e5f; /* Couleur du lien harmonisée avec les boutons */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #feb47b; /* Couleur du lien au survol */
}

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

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Espacement entre les icônes */
    margin-top: 20px;
    margin-bottom: 80px;
}

.social-icons a {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff; /* Couleur du texte */
    transition: color 0.3s ease-in-out;
}

.social-icons a svg {
    width: 25px;
    height: 25px;
    margin-right: 10px;
    fill: #ffffff;
}
.social-icons a svg {
    transition: fill 0.3s ease-in-out;
}

.social-icons a:hover svg {
 fill: #FF7E5F;
}

body.light-mode .social-icons a:hover svg {
    fill: #feb47b;
   }



body.light-mode .social-icons a svg {
    fill: #ff7e5f;
}

.social-icons a:hover {
    color: #ff7e5f; /* Changement de couleur au survol */
}

.social-icon {
    width: 28px; /* Taille des icônes */
    height: 28px;
    margin-right: 8px; /* Espacement entre l'icône et le texte */
    transition: transform 0.3s ease-in-out;
}

.social-icons a:hover .social-icon {
    transform: scale(1.1); /* Zoom léger sur l'icône au survol */
}


