:root {
    --rich-black: #171a21ff;
    --paynes-gray: #617073ff;
    --air-superiority-blue: #7a93acff;
    --jordy-blue: #171a21;
    --periwinkle: #F5F5F0;
    --white: #ffffff;
}

/* Reset & global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

html, body {
    height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--periwinkle);
    color: var(--rich-black);
    line-height: 1.5;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.content {
    flex:1;
}

.pageTitle {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--rich-black);
    margin-bottom: 20px;
}

/* Navbar */
#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--jordy-blue);
    padding: 12px 30px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#navTitle {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
}

#navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navElementsText {
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.navElementsText:hover {
    color: var(--air-superiority-blue);
    transform: translateY(-2px);
}

/* Forms */
form {
    max-width: 400px;
    margin: 40px auto;
    padding:2%;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

form p,
form > p {
    font-weight: 500;
    color: var(--rich-black);
    margin-bottom: 3px;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--paynes-gray);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

form input:focus {
    outline: none;
    border-color: var(--jordy-blue);
    box-shadow: 0 0 0 3px rgba(146, 188, 234, 0.2);
}

form input[type="submit"] {
    padding: 10px 16px;
    background-color: var(--jordy-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

form input[type="submit"]:hover {
    background-color: var(--air-superiority-blue);
    transform: translateY(-1px);
}


form a {
    color: var(--jordy-blue);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

form a:hover {
    color: var(--air-superiority-blue);
}

p {
    text-align: center;
    color: var(--rich-black);
    font-weight: 500;
    margin-top: 15px;
    margin-bottom: 8px;
}

h1, h2, h3 {
    text-align: center;
    color: var(--rich-black);
    margin-top: 15px;
    margin-bottom: 8px;
}

/* Notes */

/* Notes Header */
.notes-header {
    max-width: 1200px;
    margin: 30px auto 20px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.notes-header .pageTitle {
    margin: 0;
}

/* Buttons */
.btn-primary {
    padding: 12px 20px;
    background-color: var(--jordy-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(23, 26, 33, 0.15);
}

.btn-primary:hover {
    background-color: var(--air-superiority-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 26, 33, 0.2);
}

.btn-secondary {
    padding: 12px 20px;
    background-color: var(--paynes-gray);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-secondary:hover {
    background-color: var(--air-superiority-blue);
    transform: translateY(-2px);
}

.btn-edit {
    padding: 8px 16px;
    background-color: var(--air-superiority-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    height: fit-content;
    align-self: center;
}

.btn-edit:hover {
    background-color: var(--jordy-blue);
    transform: translateY(-1px);
}

.btn-delete {
    padding: 8px 16px;
    background-color: #dc3545;
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    align-self: flex-end;
}

.btn-delete:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Note Form */
.note-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 25px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.note-form p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--rich-black);
    margin-bottom: 15px;
    text-align: left;
}

.note-form input[type="text"],
.note-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--paynes-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.note-form input[type="text"]:focus,
.note-form textarea:focus {
    outline: none;
    border-color: var(--jordy-blue);
    box-shadow: 0 0 0 3px rgba(23, 26, 33, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    flex: 1;
}

/* Notes Container */
.notes-container {
    align-items: flex-start;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    gap : 0.8%;
}

/* Note Card */
.note-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 19.3%;
    height: 400px;
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 1%;
    
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.note-content {
    flex: 1;
    overflow: hidden;
}

.note-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--jordy-blue);
    margin: 0 0 10px 0;
    word-wrap: break-word;
    text-align: left;
}

.note-text {
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.note-actions {
    width: 100%;
    display: flex;
    gap : 1%;
    align-self: flex-end;
    margin-bottom: -35px;
}

.note-actions button,
.note-actions form {
    flex: 1;
}

.note-actions form button {
    width: 100%;
}

.alert {
    max-width: 600px;
    margin: 20px auto;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3a3;
    border: 1px solid #cfc;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--paynes-gray);
    margin: 10px 0;
}

.empty-subtitle {
    font-size: 1rem !important;
    color: var(--air-superiority-blue) !important;
}

/* Responsive */

@media (max-width: 768px) {
    /* Header */
    .notes-header {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin: 20px auto;
        text-align: center;
    }

    .notes-header .pageTitle {
        font-size: 1.4rem;
    }

    .notes-header .btn-primary {
        width: 90%;
        padding: 14px;
    }

    /* Conteneur des notes */
    .notes-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
        width: 95%;
        padding: 0 10px;
    }

    /* Cartes */
    .note-card {
        width: 100%;
        height: auto;
        padding: 18px;
        text-align: left;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .note-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .note-text {
        font-size: 0.95rem;
        -webkit-line-clamp: 6;
    }

    .note-actions {
        flex-direction: row;
        gap: 10px;
        margin-top: 12px;
    }

    .btn-edit,
    .btn-delete {
        flex: 1;
        font-size: 0.95rem;
        padding: 10px;
    }

    /* Formulaire */
    .note-form {
        width: 90%;
        margin: 25px auto;
        padding: 20px;
    }

    .note-form input,
    .note-form textarea {
        font-size: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* Footer */
    footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    #footerText {
        font-size: 0.85rem;
    }

    footer a {
        font-size: 0.85rem;
        margin: 0;
    }
}

#burger-toggle {
    display: none;
}

/* Bouton burger */
.burger {
    display: none;
    font-size: 1.8rem;
    color: var(--white);
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.burger:hover {
    transform: scale(1.1);
}

@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    .note-title {
        font-size: 1.1rem;
    }

    .note-text {
        font-size: 0.9rem;
        -webkit-line-clamp: 5;
    }

    .btn-edit,
    .btn-delete {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .btn-primary {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    footer {
        padding: 10px;
    }

    .burger {
        display: block;
        color: var(--periwinkle);
    }

    #navbar ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--jordy-blue);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 10px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        border-top: 1px solid rgba(255,255,255,0.2);
        animation: slideDown 0.3s ease;
    }


    #burger-toggle:checked + .burger + ul {
        display: flex;
    }


    .navElements {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .navElementsText {
        display: block;
        width: 100%;
        font-size: 1.1rem;
    }
     @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Site Map */

#sitemapContainer {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
}

#sitemapList {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sitemapLink {
    display: block;
    padding: 10px 15px;
    background-color: var(--white);
    border-radius: 8px;
    color: var(--jordy-blue);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--paynes-gray);
    transition: background-color 0.2s, transform 0.2s, color 0.2s;
}

.sitemapLink:hover {
    background-color: var(--air-superiority-blue);
    color: var(--white);
    transform: translateY(-1px);
}

/* Footer */
footer {
    width: 100%;
    background-color: var(--jordy-blue);
    border-top: 1px solid var(--air-superiority-blue);
    padding: 16px;
    display: flex; 
    justify-content: center;
    align-items: center;
    align-self: flex-end;
    flex-direction: column;
}

footer a{
    text-decoration: none;
    color: var(--white);
    margin-left: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 15px;
    margin-bottom: 8px;
}

footer a:hover {
    text-decoration: underline; 
}

#footerText {
    color: var(--white);
    font-size: 0.9rem;
    text-align: center;
}

#footerIconsPart {
    margin: 8px;
}
