* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #FFD29D;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #A41623;
    font-size: 3rem;
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid #918450;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    background: white;
    transition: all 0.3s;
}

#searchInput:focus {
    border-color: #A41623;
    box-shadow: 0 0 0 3px rgba(164, 22, 35, 0.2);
}

/* Pokemon Grid */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

.pokemon-card-small {
    background: #FFB563;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #918450;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pokemon-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #A41623;
}

.pokemon-card-small img {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.pokemon-card-small h3 {
    color: #A41623;
    font-size: 1.2rem;
    margin-bottom: 5px;
    text-transform: capitalize;
}

.pokemon-card-small .pokemon-id {
    background: #A41623;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.pokemon-card-small .pokemon-types {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pokemon-card-small .type-badge {
    padding: 5px 10px;
    font-size: 0.7rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: #FFB563;
    margin: 5% auto;
    padding: 30px;
    border: 3px solid #A41623;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s;
    position: relative;
}

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

.close {
    color: #A41623;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #F85E00;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pokemon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#pokemonName {
    color: #A41623;
    font-size: 2rem;
    text-transform: capitalize;
}

.pokemon-id {
    background: #A41623;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
}

#pokemonImage {
    display: block;
    margin: 0 auto 20px;
    width: 200px;
    height: 200px;
}

.pokemon-types {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.type-badge {
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: subtleFloat 3s ease-in-out infinite;
}

.type-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

.type-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: none;
}

@keyframes shine {
    0%, 100% {
        transform: translateX(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.pokemon-stats {
    margin: 20px 0;
}

.pokemon-stats h3,
.pokemon-abilities h3 {
    color: #A41623;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.stat-bar {
    margin-bottom: 12px;
}

.stat-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
    color: #A41623;
    text-transform: capitalize;
}

.stat-progress {
    height: 20px;
    background: rgba(145, 132, 80, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: #F85E00;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.pokemon-info {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 210, 157, 0.6);
    border-radius: 8px;
}

.info-item {
    text-align: center;
}

.label {
    display: block;
    color: #A41623;
    font-weight: bold;
    margin-bottom: 5px;
}

#pokemonHeight,
#pokemonWeight {
    font-size: 1.2rem;
    color: #333;
}

.pokemon-abilities {
    margin-top: 20px;
}

#abilitiesList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ability-badge {
    padding: 8px 15px;
    background: rgba(145, 132, 80, 0.4);
    color: #333;
    border-radius: 4px;
    font-weight: bold;
    text-transform: capitalize;
    border: 1px solid #918450;
}

.error-message {
    background: #A41623;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.loading {
    text-align: center;
    color: #A41623;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 20px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hidden {
    display: none;
}

/* Type colors */
.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-dark { background: #705848; }
.type-steel { background: #B8B8D0; }
.type-fairy { background: #EE99AC; }