:root {
    --color_entete: rgb(21, 85, 8);
    --color_en_bckgrnd: rgb(81, 152, 91);
    --color_en_bckgrnd_lighter: rgb(156, 225, 165);
    --color_en_texte: rgb(205, 148, 189);
    --color_hover: rgb(252, 0, 181);
    --color_visited: rgb(83, 17, 64);
    --color_texte: rgb(86, 86, 86);
    --color_title: rgb(14, 40, 2);
    --color_bckgrnd: rgb(83, 130, 96);
    --color_error_text: rgb(213, 39, 39);
    --color_error_bckgrnd: rgb(239, 148, 148);
    --color_warning_text: rgb(253, 98, 2);
    --color_warning_bckgrnd: rgb(239, 187, 148);
}

/* ici on retire les marges de merde autour de la page */
html, body, header, footer {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    background-color: var(--bs-light-bg-subtle);
}
header{
    background-color: var(--color_entete);
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.en_links {
    color: var(--color_en_texte);
    padding: 10px;
    background-color: var(--color_en_bckgrnd);
    border-radius: 10px;
    text-decoration: none;
}

.en_links:visited {
    color: var(--color_visited);
}

.en_links:hover {
    color: var(--color_hover);
    background-color: var(--color_en_bckgrnd_lighter);
}


nav{
    display: flex;
}

.head_ul{
    width: 360px;
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

h1 {
    margin: auto;
    color: var(--color_title);
}

h2 {
    margin: auto;
}

section {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    margin-bottom: 10px;
}

.table_container {
    justify-content: center;
}

table{
    border-collapse: collapse;
    border-color: var(--color_entete);
    border-width: 2px;
    width: 720px;
    margin: auto;
}

thead {
    border-width: 5px;
    border-color: var(--color_entete);
    background-color: var(--color_en_bckgrnd);
}
td {
    border-width: 2px;
    border-color: var(--color_entete);
    background-color: var(--color_en_bckgrnd_lighter);
}

img {
    width: 50px;
}

p {
    color: var(--color_texte);
    place-self: center;
    width: 720px;
    text-wrap: wrap;
}

.search_container{
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

form {
    display: flex;
    flex-direction: column;
    margin: auto;
    margin-bottom: 10px;
}

#search {
    width: 100%;
    margin-top: 10px;
    border-radius: 10px;
    border-color: var(--color_entete);
    padding: 2px;
}

#search:focus {
    border-color: var(--color_visited);
    outline: none;
}

#search:hover {
    border-color: var(--color_hover);
}

#buttons {
    display: flex;
    justify-content: space-evenly;
    padding-top: 10px;
    border-radius: 10px;
}

#buttons input {
    width: 100px;
    border-radius: 12px;
    border-color: var(--color_entete);
    color: var(--color_en_texte);
    background-color: var(--color_en_bckgrnd);
}

#buttons input:hover {
    background-color: var(--color_en_bckgrnd_lighter);
    color: var(--color_hover);
}

#search_bar {
    display: flex;
    flex-direction: column;
    width: 600px;
}

span {
    display: flex;
    justify-content: center;
    border-width: 2px;
    margin: auto;
    width: 250px;
    padding: 5px;
    border-radius: 10px;
}

.error_display {
    color: var(--color_error_text);
    background-color: var(--color_error_bckgrnd);
}

.successful_search {
    color: var(--color_entete);
    background-color: var(--color_en_bckgrnd_lighter);
    margin-bottom: 10px;
}

footer{
    background-color: var(--color_entete);
}

footer p {
    color: var(--color_en_bckgrnd_lighter);
}

@media (max-width: 576px) {

    header {
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
    }

    h1 {
        font-size: 1.3rem;
        text-align: center;
        padding: 5px 10px;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .head_ul {
        width: 100%;
        padding: 0 5px;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .en_links {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    /* Table scrollable horizontalement */
    .table_container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        width: 100%;
        min-width: 400px;
        font-size: 0.85rem;
    }

    td, th {
        padding: 4px 6px;
    }

    img {
        width: 35px;
    }

    p {
        width: 90%;
        font-size: 0.9rem;
    }

    #search_bar {
        width: 90%;
    }

    form {
        width: 90%;
    }

    span {
        width: 90%;
        max-width: 250px;
    }

    #buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    #buttons input {
        width: 90px;
        font-size: 0.85rem;
    }

    footer p {
        text-align: center;
        width: 90%;
        font-size: 0.85rem;
    }
}