* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --pokemon-color-red-primary : #FF0000;
    --pokemon-color-red-second : #CC0000;
    --pokemon-color-blue-primary : #3B4CCA;
    --pokemon-color-yellow-primary :  #FFDE00;
    --pokemon-color-yellow-secondary : #B3A125;
    --bg-color: #f6f8fc;
    --font-color: #2f3640
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    padding: 20px;
    background-image: url("/images/pokeball.svg");
    background-repeat: no-repeat;
    background-position: left -210px top -180px;
    background-size: 710px;
}

a {
    text-decoration: none;
    color: inherit;
}

nav {
    background-color: white;
    padding: 30px 50px;
    border-radius: 16px;
    font-weight: bold;
    margin-bottom: 30px;
}

footer {height: 100px;}

/* --------------------
   COMPONENTS
-------------------- */
/* Les types */
.type {
    color: white;
    font-weight: bold;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 12px;
    text-transform: capitalize;
}

.fire { background-color: #E72324;}
.water { background-color: #2481EF;}
.grass { background-color: #3DA224;}
.electric { background-color: #FAC100;}
.ice { background-color: #3DD9FF;}
.fighting { background-color: #FF8100;}
.poison { background-color: #923FCC;}
.ground { background-color: #92501B;}
.flying { background-color: #82BAEF;}
.psychic { background-color: #EF3F7A;}
.bug { background-color: #92A212;}
.rock { background-color: #B0AA82;}
.ghost { background-color: #703F70;}
.dark { background-color: #4F3F3D;}
.dragon { background-color: #4F60E2;}
.steel { background-color: #60A2B9;}
.fairy { background-color: #EF70EF;}
.normal { background-color: #A0A2A0;}

.alert {
    position: relative;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Barre de recherche */
.pokemonSearch {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.pokemonSearch form div {
    display: flex;
    gap: 10px;
}

.pokemonSearch input[type="text"] {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    width: 250px;
}

.pokemonSearch input[type="text"]:focus {
    border-color: #ffcb05;
}

.pokemonSearch button,
.pokemonSearch input[type="submit"] {
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    background-color: #ef5350;
    color: white;
    cursor: pointer;
}

.pokemonSearch button:hover,
.pokemonSearch input[type="submit"]:hover {
    background-color: #d32f2f;
}
.btn-primary {
    padding: 0.6rem 1rem;
    background-color: #30a7d7;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    margin: 10px 0;
    border: none;
    cursor: pointer;
}

/* --------------------
   PAGE ACCUEIL
-------------------- */
.pokemonGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.pokemon {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 15px;
    display: block;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pokemon:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.pokemon img {
    max-width: 100%;
}

.pokemon > div:nth-child(2) {
    font-weight: bold;
    font-size: 18px;
    text-transform: capitalize;
    margin-bottom: 8px;
}

.pokemon > div:nth-child(3) {
    display: flex;
    justify-content: center;
    gap: 6px;
}


/* --------------------
   FICHE POKÉMON
-------------------- */
.pokemonWidget {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
.pokemonDetail {
    text-align: center;
}

.pokemonDetail h1 {
    text-transform: capitalize;
}

.pokemonDetail img {
    margin: 15px 0;
    width: 200px;
}

.pokemonDetail .infos {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    font-weight: bold;
}

.stat {
    margin-bottom: 12px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.stat-fill.low {
    background-color: #ef4444; 
}
.stat-fill.medium {
    background-color: #ed7e1b; 
}
.stat-fill.good{
    background-color: #edc81b;
} 
.stat-fill.high {
    background-color: #22c55e;
}
.stat.total {
    margin-top: 15px;
    font-weight: bold;
}

.titleForceFaiblesse {
    border-bottom: 1px solid lightgray;
    margin-bottom: 18px;
}   

.pokemonForceFaiblesse {
    height: fit-content;
}


/* --------------------
   TEAM BUILD
-------------------- */
.pokemonTeambuild img{
    width: 260px;
}

.teambuildForm div {
    margin-bottom: 10px;
}

.teambuildForm label {
    width: 130px;
}
.teambuildForm input[type="text"] {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    width: 250px;
}
.teambuildForm input[type="text"]:focus {
    border-color: #ffcb05;
}

.teambuildPokemonRecap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}
.teambuildPokemonRecapUnit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.teambuildPokemonRecap img {
    width: 90px;
}

/* --------------------
   PAGE COBBLEVERSE
-------------------- */
.cobbleverseGym .pokemonWidget{
    width: 190px;
    transition: 0.3s all;
}

.cobbleverseGym .pokemonWidget:hover{
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}


@media all and (min-width: 1281px) {
    
    body {
        padding: 0;
    }
    
    nav {
        margin-top: 30px !important;
        margin-bottom: 40px !important;
    }

    .container {
        width: 1280px;
        margin: 0 auto;
    }

    .pokemonDetail {
        width: 300px;
    }

    .pokemonStats {
        width: 400px;
    }

    .pokemonForceFaiblesse {
        width: 530px;
    }

    .pokemonAbilities {
        width: 500px;
    }

}