:root {
    --primary-color: rgb(52, 73, 94); /* Bleu-gris foncé comme couleur primaire */
    --accent-color-1: rgb(255, 87, 50); /* Rouge-orange */
    --accent-color-2: rgb(158, 157, 36); /* Jaune-vert/olive */
    --accent-color-3: rgb(255, 135, 0); /* Orange */
    --accent-color-4: rgb(126, 87, 197); /* Violet */
    --accent-color-5: rgb(0, 172, 193); /* Bleu turquoise */
    --accent-color: #e74c3c; /* Gardé pour compatibilité */
    --bg-color: #f9f9f9;
    --text-color: rgb(52, 73, 94); /* Bleu-gris foncé comme couleur de texte */
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --footer-height: 38px; /* Hauteur fixe du footer */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Définition des polices */
@font-face {
    font-family: Kalam;
    src: url(../ttf/Kalam-Bold.ttf);
}

@font-face {
    font-family: Kalam-reg;
    src: url(../ttf/kalam.regular.ttf);
}

@font-face {
    font-family: OpenSansReg;
    src: url(../ttf/OpenSans-Regular.ttf);
}

@font-face {
    font-family: OpenSansSemiBold;
    src: url(../ttf/OpenSans-SemiBold.ttf);
}

html {
    height: 100%;
    overflow-y: scroll; /* Force la barre de défilement à être toujours présente */
}

body {
    min-height: 100%;
    position: relative;
    padding-bottom: var(--footer-height);
    font-family: OpenSansReg, sans-serif;
    background-color: var(--bg-color);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239e9d24' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text-color);
}

header {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: .3rem 1rem .7rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.08' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.flower-link {
    position: absolute;
    left: 1.8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    cursor: pointer;
}

.flower-decoration {
    height: 3.8rem;
    width: 3.8rem;
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-image: url('flower.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.flower-link:hover .flower-decoration {
    transform: scale(1.05);
    opacity: 1;
    background-image: url('flower-color.svg');
}

.header-content {
    text-align: center;
}

header h1, header p {
    position: relative;
    z-index: 1;
}

header h1 {
    font-family: Kalam;
    font-size: 2.4rem;
    color: var(--accent-color-5);
    color: rgb(38, 198, 218);
    /* margin-bottom: 0.5rem; */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

header p {
    font-family: Kalam-reg;
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto;
}

main {
    max-width: 750px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.search-container {
    display: flex;
    margin-bottom: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow);
    border-radius: 4px;
    overflow: hidden;
}

#searchInput {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--light-gray);
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    transition: var(--transition);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

#searchButton {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#searchButton:hover {
    background-color: var(--accent-color-1);
}

.search-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category {
    background-color: var(--white);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 10px solid transparent;
}

/* Appliquer différentes couleurs aux catégories */
.category:nth-child(5n+1) {
    border-left-color: var(--accent-color-1);
}

.category:nth-child(5n+2) {
    border-left-color: var(--accent-color-2);
}

.category:nth-child(5n+3) {
    border-left-color: var(--accent-color-3);
}

.category:nth-child(5n+4) {
    border-left-color: var(--accent-color-4);
}

.category:nth-child(5n+5) {
    border-left-color: var(--accent-color-5);
}

.category-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: .9rem 1rem .9rem 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

/* Couleurs au survol selon la catégorie */
.category:nth-child(5n+1) .category-header:hover {
    background-color: var(--accent-color-1);
}

.category:nth-child(5n+2) .category-header:hover {
    background-color: var(--accent-color-2);
}

.category:nth-child(5n+3) .category-header:hover {
    background-color: var(--accent-color-3);
}

.category:nth-child(5n+4) .category-header:hover {
    background-color: var(--accent-color-4);
}

.category:nth-child(5n+5) .category-header:hover {
    background-color: var(--accent-color-5);
}

.category-name {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
}

.category-icon {
    margin-right: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.category-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Transitions encore plus rapides pour la fermeture */
.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.15s cubic-bezier(0.55, 0, 1, 0.45);
}

.category.active .category-content {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

.theme {
    border-bottom: 1px solid var(--light-gray);
    margin: 0 1rem;
    padding: 0.3rem 0;
}

.theme:last-child {
    border-bottom: none;
}

.theme-header {
    font-size: 1rem;
    padding: 1rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-color);
    font-weight: 600;
    border-radius: 4px;
    transition: var(--transition);
}

/* Ajout du changement de couleur au survol des thématiques */
.theme-header:hover {
    color: var(--accent-color-4);
    background-color: rgba(126, 87, 197, 0.05);
    transition: var(--transition);
}

/* Également accélérer la fermeture des thèmes */
.theme-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.1s cubic-bezier(0.55, 0, 1, 0.45);
    padding-left: 1.5rem;
}

.theme.active .theme-content {
    max-height: 2000px;
    padding-bottom: 1rem;
    transition: max-height 0.3s ease-in;
}

/* Styles pour les outils */
.tool {
    padding: 0.8rem 0.5rem;
    border-bottom: 1px dashed var(--light-gray);
    transition: var(--transition);
}

.tool:last-child {
    border-bottom: none;
}

.tool:hover {
    background-color: rgba(255, 135, 0, 0.05);
}

/* Disposition des éléments à l'intérieur de l'outil */
.tool-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Style des liens */
.tool a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    flex: 1;
    margin-right: 10px;
}

.tool a:hover {
    color: var(--accent-color-1);
    transform: translateX(5px);
}

/* Conteneur des tags/icônes */
.tool-tags {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Style des icônes */
.tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.85rem;
    color: var(--white);
    min-width: 24px;
    height: 24px;
    transition: var(--transition);
    background-color: rgba(52, 73, 94, 0.8)
}

.tag-text {
    margin-left: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.arrow svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Rotation du chevron pour les catégories */
.category.active .arrow {
    transform: rotate(180deg);
}

/* Orientation initiale des flèches des thèmes */
.theme-header .arrow svg {
    transform: rotate(0deg);
}

/* Conserver la rotation quand actif */
.theme.active .theme-header .arrow {
    transform: rotate(180deg);
}

/* Footer */
footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    padding: 0 .5rem;
    background-color: var(--primary-color);
    color: var(--white);
    z-index: 100;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
}

/* Styles pour les éléments à l'intérieur du footer */
footer span, footer a {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
}

footer a {
    color: var(--white);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: rgba(255, 255, 255, 0.8);
}

.separator {
    margin: 0 0.75rem;
}

.license-part {
    margin: 0 0.5rem;
}

.contact-part a {
    margin-left: 4px; /* Ajoute un espace entre "Contact :" et le lien */
}

.mobile-text {
    display: none;
}

@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
    }
    
    .flower-link {
        display: none;
    }
    header h1 {
        font-size: 2rem;
    }
    
    .category-name {
        font-size: .9rem;
    }

    :root {
        --footer-height: 50px; /* Hauteur pour deux lignes */
    }
    
    footer {
        flex-wrap: wrap; /* Permet le retour à la ligne */
        justify-content: center;
        padding: .4rem 0;
    }
    
    .copyright-part {
        flex-basis: 100%; /* Force le passage à la ligne suivante */
        text-align: center;
    }
    
    /* Cache le premier séparateur */
    .copyright-part + .separator {
        display: none;
    }
    
    /* Centre les éléments de la seconde ligne */
    .license-part, .contact-part, .license-part + .separator {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 635px) {
    header p {
        max-width: 360px;
    }
}

@media (max-width: 600px) {
    .tool-tags {
        gap: 4px;
    }
    
    .tag-icon {
        padding: 3px 4px;
        min-width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }
    
    .tag-text {
        display: none;
    }
}

@media (max-width: 405px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1.3rem;
    }

    footer {
        display: block;
        padding: .4rem 0;
        text-align: center;
    }

    /* Copyright sur une ligne séparée */
    .copyright-part {
    display: block;
    width: 100%;
    }
    
    /* License et Contact sur la même ligne */
    .license-part, .contact-part {
        display: inline-block;
    }
    
    /* Par défaut, cacher tous les séparateurs */
    .separator {
        display: none !important;
        margin: 0;
    }
    
    /* Afficher uniquement le séparateur entre License et Contact */
    .license-part + .separator {
        display: inline-block !important;
    }
    
    /* Gestion du texte Contact */
    .contact-part .contact-text, 
    .contact-part .email-text {
        display: none;
    }
    
    .contact-part .mobile-text {
        display: inline;
    }
}

@media (max-width: 368px) {
    header h1 {
        font-size: 1.6rem;
    }
    header p {
        font-size: 1.2rem;
    }
}


/* Animation pour l'apparition des éléments */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les messages d'erreur */
.error {
    color: var(--accent-color-1);
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 87, 50, 0.1);
    border-radius: 8px;
    margin: 1rem 0;
}

/* Pour les appareils tactiles, désactiver l'état de survol persistant */
@media (hover: none) {
    /* Désactiver les effets de survol sur appareils tactiles */
    .category-header:hover {
        background-color: var(--primary-color) !important;
        color: var(--white) !important; /* Assurer que le texte reste visible */
    }
    
    /* S'assurer que l'icône et le texte restent visibles */
    .category-header:hover .category-name,
    .category-header:hover .category-icon {
        opacity: 1 !important;
        visibility: visible !important;
        color: var(--white) !important;
    }
    
    /* Pour la catégorie active, appliquer un style distinctif */
    .category.active .category-header {
        border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    }
}

