/* Import de la fonte spéciale pour le titre principal et les titres secondaires */
@font-face {
    font-family: 'PokemonSolid';
    src: url('../font/Pokemon_Solid.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Style général du corps de la page */
body {
    background: #353336; /* Fond sombre */
    color: #fff; /* Texte blanc */
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
} 

/* En-tête centré avec marge en haut */
header {
    text-align: center;
    margin-top: 20px;
}

/* Titre principal avec police spéciale, couleur rouge et contour noir/jaune */
.pokedex-title {
    font-family: 'PokemonSolid', Arial, sans-serif;
    color: #ff2222;
    font-size: 2.5rem;
    letter-spacing: 2px;
    /* Contour noir épais autour du texte pour la lisibilité */
    text-shadow:
        0 0 2px #000,
        0 0 4px #000,
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        4px 4px 0 white;
    margin-bottom: 30px;
}

/* Conteneur principal centré et vertical */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 70vh;
}

/* Formulaire de recherche stylisé */
#search-form {
    background: #23232b;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

#search-form label {
    font-size: 1.1rem;
}

/* Champ de saisie de l'ID du Pokémon */
#pokemon-id {
    width: 60px;
    padding: 6px;
    border: none;
    border-radius: 4px;
    background: #ff2222;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
}

/* Bouton de recherche stylisé */
#search-form button {
    background: #ff2222;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#search-form button:hover {
    background: #d90000;
}

/* Conteneur d'affichage du Pokémon avec bordure colorée */
.pokemon-container {
    background: #23232b;
    border: 3px solid yellow; /* Couleur modifiable dynamiquement par JS */
    border-radius: 8px;
    padding: 25px 35px;
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    min-width: 350px;
    max-width: 600px;
    margin-bottom: 30px;
    box-shadow: 0 0 12px #000a;
}

/* Colonne d'infos textuelles du Pokémon */
.pokemon-info {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

/* Titre du Pokémon (nom + id) avec police spéciale et contour */
#pokemon-name {
    font-family: 'PokemonSolid', Arial, sans-serif;
    color: #3ee6e6;
    font-size: 2rem;
    margin: 0 0 10px 0;
    /* Contour noir épais autour du texte */
    text-shadow:
        0 0 2px #000,
        0 0 4px #000,
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #fff200;
}

/* Taux de capture (texte) */
#pokemon-capture {
    color: #b2ffb2;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* Famille du Pokémon */
#pokemon-family {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Description du Pokémon */
#pokemon-description {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 10px;
    max-width: 320px;
    line-height: 1.4;
}

/* Colonne image du Pokémon */
.pokemon-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image officielle du Pokémon */
#pokemon-img {
    max-width: 150px;
    max-height: 150px;
    border: 2px dashed #444;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

/* Message d'erreur en rouge */
.error-message {
    color: #ff2222;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
}

/* Barre de progression du taux de capture */
.capture-bar {
    width: 100%;
    height: 22px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #444;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px #0004 inset;
}

/* Barre interne animée et colorée dynamiquement */
.capture-bar-inner {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.4,0,0.2,1), background 0.6s;
    opacity: 0;
    animation: fadeInBar 1s forwards;
}

@keyframes fadeInBar {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive : adaptation sur mobile */
@media (max-width: 700px) {
    .pokemon-container {
        flex-direction: column;
        align-items: center;
        padding: 18px 10px;
        min-width: unset;
        max-width: 98vw;
    }
    .pokemon-info {
        align-items: center;
    }
    #pokemon-description {
        max-width: 95vw;
        text-align: center;
    }
}
