body, html {
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #0d0d0d;
    color: #fff;
}

body {
    display: flex;
    flex-direction: column;
}

header, footer {
    background-color: #282c34;
    color: white;
    padding: 10px;
}

footer {
    text-align: center;
}

main {
    flex: 1;
    padding: 20px;
    display: flex;
    gap: 20px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background-color: #0056b3;
}

nav {
    display: flex;
    gap: 10px;
}

nav input {
    padding: 5px;
}

#categories, #cheat-sheet {
    background: #0b0c2a;
    border: 2px solid #00ffff;
    padding: 10px;
    box-shadow: 0 0 8px #ff00ff, 0 0 15px #00ffff;
}

#categories {
    width: 20%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#cheat-sheet {
    width: 80%;
}

button {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(45deg, #220a22, #0d5a5a);
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px #ff00ff, 0 0 15px #00ffff;
}

button:hover {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    box-shadow: 0 0 15px #ff00ff, 0 0 25px #00ffff;
    transform: scale(1.1);
}

button:disabled {
    background: #333;
    color: #666;
    border: 2px solid #444;
    box-shadow: none;
    cursor: not-allowed;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 8px #ff00ff, 0 0 15px #00ffff;
    }
    50% {
        box-shadow: 0 0 15px #ff00ff, 0 0 25px #00ffff;
    }
    100% {
        box-shadow: 0 0 8px #ff00ff, 0 0 15px #00ffff;
    }
}

button {
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

button::before,
button::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #ff00ff;
    clip-path: inset(0 0 50% 0);
    animation: glitch 1.5s infinite;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }
    33% {
        transform: translate(-2px, -2px);
    }
    66% {
        transform: translate(2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}
/* --- RESPONSIVE DESIGN --- */

/* Pour les écrans de petite taille (smartphones, jusqu'à 768px) */
@media (max-width: 768px) {
    body {
        /* Pas de changement majeur ici, flex-direction: column est déjà sur body */
    }

    header {
        flex-direction: column; /* Empile les éléments de l'en-tête (titre, nav) */
        align-items: center; /* Centre les éléments */
        padding: 15px; /* Ajuste le padding */
    }

    header h1 {
        font-size: 1.8em; /* Réduit la taille du titre */
        margin-bottom: 10px;
    }

    nav {
        flex-direction: column; /* Empile les boutons et la barre de recherche */
        width: 100%; /* La nav prend toute la largeur */
        gap: 15px; /* Plus d'espace entre les éléments */
    }

    nav button,
    nav input {
        width: 90%; /* Les éléments prennent presque toute la largeur disponible */
        margin: 0 auto; /* Centre-les */
        box-sizing: border-box; /* Inclut padding et border dans la largeur */
    }

    main {
        flex-direction: column; /* Les sections (catégories et notes) s'empilent */
        padding: 15px; /* Ajuste le padding de la section principale */
        gap: 20px; /* Espace entre les sections empilées */
    }

    #categories,
    #cheat-sheet {
        width: 100%; /* Chaque section prend toute la largeur */
    }

    #categories {
        flex-direction: column; /* Les boutons de catégorie s'empilent */
        gap: 10px;
    }

    /* Ajustement des boutons de catégorie pour mobile */
    #categories div {
        flex-direction: row; /* Garde les boutons modifier/supprimer sur la même ligne */
        justify-content: center; /* Centre les boutons si l'espace est suffisant */
        flex-wrap: wrap; /* Permet aux boutons de passer à la ligne si nécessaire */
        gap: 5px; /* Réduit l'espace entre les boutons d'édition/suppression */
    }

    #categories button {
        padding: 8px 15px; /* Réduit le padding des boutons */
        font-size: 14px; /* Réduit la taille de la police */
    }

    #categories button:nth-child(2), /* Edit button */
    #categories button:nth-child(3) { /* Delete button */
        padding: 8px; /* Padding plus petit pour les icônes */
        width: 40px; /* Taille fixe pour les boutons icônes */
        height: 40px;
        font-size: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Ajustement des notes pour mobile */
    #cheat-sheet div {
        flex-direction: column; /* Empile le texte de la note et les boutons */
        align-items: flex-start; /* Aligne le texte à gauche */
        gap: 5px;
    }

    #cheat-sheet p {
        margin-bottom: 5px; /* Espace sous le texte de la note */
    }

    #cheat-sheet button {
        width: auto; /* Laisse les boutons prendre la largeur naturelle */
        padding: 8px 15px; /* Padding ajusté */
        font-size: 14px;
    }
}

/* Pour les écrans de très petite taille (mobiles étroits) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    nav button,
    nav input {
        width: 95%; /* Encore plus de largeur */
    }

    #categories button,
    #cheat-sheet button {
        font-size: 13px;
        padding: 6px 12px;
    }

    #categories button:nth-child(2),
    #categories button:nth-child(3) {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}
