/* Stats container */
#statsContainer {
    text-align: center;
    margin: 20px 0;
}

.total-counter {
    font-size: 1.3em;
    font-weight: bold;
    color: #e0e0e0;
}

/* Types grid layout */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Type button styles */
.type-button {
    background-color: #ffffff;
    border: 3px solid #999;
    border-radius: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column; /* Changé de row (défaut) à column */
    align-items: center; /* Centre horizontalement */
    justify-content: center; /* Centre verticalement */
    gap: 8px; /* Espace entre l'icône et le texte */
    min-height: 120px; /* Augmenté pour accommoder la disposition verticale */
}

.type-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: #E6E6E6;
}

.type-icon {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.type-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.type-name {
    font-size: 1.05em;
    font-weight: bold;
    color: #e0e0e0;
}

.type-count {
    font-size: 0.9em;
    color: #000000;
}

/* Pokemon section (hidden by default) */
.pokemon-section {
    width: 100%;
}

.pokemon-section.hidden {
    display: none;
}

.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin: 0 auto 10px;
    text-align: left;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
    gap: 12px;
}

.section-header h2 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.8em;
    display: flex;
    justify-content: flex-start;
}

.selected-type-icon {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.back-button {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #24222a;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #e6e6e6;
}

/* Grid layout for Pokémon cards (reused from FullPokedex) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Styles for individual Pokémon cards */
.pokemon-card {
    background-color: #ffffff;
    border: 2px solid #24222a;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.pokemon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: #E6E6E6;
}

.pokemon-sprite {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    object-fit: contain;
    object-position: center;
    margin-bottom: 10px;
}

.pokemon-name {
    font-size: 1.1em;
    /* font-weight: bold; */
    color: #000000;
    margin: 0;
    text-transform: capitalize;
}

/* Center the main title on this page */
.container .main_title {
    width: 100%;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .types-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .type-button {
        padding: 16px;
        min-height: 120px;
    }

    .type-icon {
        width: 46px;
        height: 46px;
    }

    .type-name {
        font-size: 1.1em;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .section-header h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 600px) {
    .types-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
        justify-items: stretch;
        box-sizing: border-box;
    }

    .type-button {
        min-height: 140px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .type-icon {
        height: 23px;
        width: auto;
    }

    .grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
        justify-items: stretch;
        box-sizing: border-box;
    }

    .pokemon-card {
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 160px;
        box-sizing: border-box;
    }

    .pokemon-sprite {
        width: 80px;
        height: 80px;
    }

    .pokemon-name {
        font-size: 1em;
    }
}

@media (min-width: 601px) and (max-width: 768px) {
    .type-button {
        min-height: 140px;
    }

    .type-icon {
        width: 120px;
        height: 60px;
    }
}
