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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #ef5350;
    color: #333;
    position: relative;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.search-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    position: relative;
}

/* Modern search bar styles - exact as provided */
.group {
    display: flex;
    line-height: 28px;
    align-items: center;
    position: relative;
    max-width: 190px;
}

.input {
    font-family: "Montserrat", sans-serif;
    width: 100%;
    height: 45px;
    padding-left: 2.5rem;
    box-shadow: 0 0 0 1.5px #2b2c37, 0 0 25px -17px #000;
    border: 0;
    border-radius: 12px;
    background-color: #272727;
    outline: none;
    color: #bdbecb;
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    cursor: text;
    z-index: 0;
}

.input::placeholder {
    color: #bdbecb;
}

.input:hover {
    box-shadow: 0 0 0 2.5px #2f303d, 0px 0px 25px -15px #000;
}

.input:active {
    transform: scale(0.95);
}

.input:focus {
    box-shadow: 0 0 0 2.5px #2f303d;
}

.search-icon {
    position: absolute;
    left: 1rem;
    fill: #bdbecb;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    z-index: 1;
}

.sort-group {
    display: flex;
    align-items: center;
    max-width: 190px;
    position: relative;
}

.sort-input {
    font-family: "Montserrat", sans-serif;
    width: 100%;
    height: 45px;
    padding: 0 2.5rem 0 1rem;
    text-align: center;
    box-shadow: 0 0 0 1.5px #2b2c37, 0 0 25px -17px #000;
    border: 0;
    border-radius: 12px;
    background-color: #272727;
    outline: none;
    color: #bdbecb;
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    cursor: pointer;
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    z-index: 0;
}

.sort-input:focus {
    box-shadow: 0 0 0 2.5px #2f303d;
}

.sort-group::after {
    content: '';
    position: absolute;
    right: 1.2rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    transform: translateY(-50%);
    background: url('data:image/svg+xml;utf8,<svg fill="%23bdbecb" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat center center;
    background-size: contain;
    z-index: 1;
}

.sort-input option {
    background: #272727;
    color: #bdbecb;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: #b71c1c;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: capitalize;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #a31515;
}

.filter-btn.active {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 0 4px #7f1010;
    background-color: #a31515;
}

.filter-container:has(.filter-btn.active:not([data-type="all"])) .filter-btn:not(.active) {
    opacity: 0.7;
    filter: brightness(0.7);
    transition: opacity 0.2s, filter 0.2s;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 32px 32px 24px 32px;
    border-radius: 20px;
    max-width: 420px;
    width: 95vw;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
    margin: 32px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Type-based modal backgrounds */
.modal-content.type-normal { background-color: #F5F5DC; }
.modal-content.type-fire { background-color: #FFE4C4; }
.modal-content.type-water { background-color: #E0F7FF; }
.modal-content.type-electric { background-color: #FFFACD; }
.modal-content.type-grass { background-color: #F0FFF0; }
.modal-content.type-ice { background-color: #F0FFFF; }
.modal-content.type-fighting { background-color: #FFE4E1; }
.modal-content.type-poison { background-color: #F8F0FF; }
.modal-content.type-ground { background-color: #F5DEB3; }
.modal-content.type-flying { background-color: #F0F8FF; }
.modal-content.type-psychic { background-color: #FFE4E8; }
.modal-content.type-bug { background-color: #F0FFF0; }
.modal-content.type-rock { background-color: #F5F5F5; }
.modal-content.type-ghost { background-color: #F8F8FF; }
.modal-content.type-dragon { background-color: #E6E6FA; }
.modal-content.type-dark { background-color: #E8E8E8; }
.modal-content.type-steel { background-color: #F5F5F5; }
.modal-content.type-fairy { background-color: #FFE4E1; }

.modal-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
    text-transform: capitalize;
    font-weight: 600;
}

.modal-id {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.modal-image {
    width: 140px;
    height: 140px;
    margin: 0 auto 10px auto;
    display: block;
    object-fit: contain;
}

.modal-types {
    margin-bottom: 10px;
}

.about-section {
    width: 100%;
    margin-bottom: 10px;
}

.about-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 10px;
    gap: 8px;
}

.about-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 0 8px 0;
    min-width: 0;
    min-height: 80px;
    min-width: 110px;
    max-width: 140px;
    box-sizing: border-box;
}

.about-icon {
    color: #b87333;
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.about-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 2px;
    font-weight: 500;
}

.about-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    width: 100%;
    max-width: 120px;
    overflow-wrap: break-word;
    hyphens: auto;
}

.about-item.description {
    margin-top: 8px;
    text-align: center;
    background: none;
    padding: 0;
}

.description-text {
    font-size: 0.97rem;
    line-height: 1.5;
    color: #444;
    margin: 0 auto;
    max-width: 95%;
}

.stats-section {
    width: 100%;
    margin-top: 18px;
}

.stats-section h3 {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: #222;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-name {
    width: 48px;
    font-weight: 700;
    color: #b87333;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.stat-value {
    width: 32px;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
    text-align: right;
}

.stat-bar {
    flex: 1;
    height: 7px;
    border-radius: 4px;
    background: #f0e0d6;
    overflow: hidden;
    margin-left: 8px;
}

.stat-bar-inner {
    height: 100%;
    border-radius: 4px;
    background: #b87333;
    transition: width 0.5s;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background-color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: -60px;
}

.nav-next {
    right: -60px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

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

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

.pokemon-card {
    display: flex;
    flex-direction: column;
    height: 320px;
    justify-content: flex-start;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.pokemon-card:hover {
    transform: translateY(-5px);
}

.pokemon-image-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.pokemon-image {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pokemon-name {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: capitalize;
}

.pokemon-id {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

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

.type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-transform: capitalize;
    color: white;
}

.loading {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.dot-spinner {
    --uib-size: 2.8rem;
    --uib-speed: .9s;
    --uib-color: #183153;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--uib-size);
    width: var(--uib-size);
}

.dot-spinner__dot {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
}

.dot-spinner__dot::before {
    content: '';
    height: 20%;
    width: 20%;
    border-radius: 50%;
    background-color: var(--uib-color);
    transform: scale(0);
    opacity: 0.5;
    animation: pulse0112 calc(var(--uib-speed) * 1.111) ease-in-out infinite;
    box-shadow: 0 0 20px rgba(18, 31, 53, 0.3);
}

.dot-spinner__dot:nth-child(2) {
    transform: rotate(45deg);
}

.dot-spinner__dot:nth-child(2)::before {
    animation-delay: calc(var(--uib-speed) * -0.875);
}

.dot-spinner__dot:nth-child(3) {
    transform: rotate(90deg);
}

.dot-spinner__dot:nth-child(3)::before {
    animation-delay: calc(var(--uib-speed) * -0.75);
}

.dot-spinner__dot:nth-child(4) {
    transform: rotate(135deg);
}

.dot-spinner__dot:nth-child(4)::before {
    animation-delay: calc(var(--uib-speed) * -0.625);
}

.dot-spinner__dot:nth-child(5) {
    transform: rotate(180deg);
}

.dot-spinner__dot:nth-child(5)::before {
    animation-delay: calc(var(--uib-speed) * -0.5);
}

.dot-spinner__dot:nth-child(6) {
    transform: rotate(225deg);
}

.dot-spinner__dot:nth-child(6)::before {
    animation-delay: calc(var(--uib-speed) * -0.375);
}

.dot-spinner__dot:nth-child(7) {
    transform: rotate(270deg);
}

.dot-spinner__dot:nth-child(7)::before {
    animation-delay: calc(var(--uib-speed) * -0.25);
}

.dot-spinner__dot:nth-child(8) {
    transform: rotate(315deg);
}

.dot-spinner__dot:nth-child(8)::before {
    animation-delay: calc(var(--uib-speed) * -0.125);
}

@keyframes pulse0112 {
    0%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: column;
        align-items: center;
    }

    #searchInput {
        width: 100%;
        max-width: 300px;
    }

    .filter-container {
        gap: 5px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .pokemon-image {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        padding: 12px 2vw 12px 2vw;
        max-width: 99vw;
    }
    .about-row {
        flex-direction: column;
        gap: 6px;
    }
    .about-col {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 8px 0;
    }
    .about-value {
        max-width: 100%;
    }
    .modal-header {
        flex-direction: column;
        gap: 2px;
    }
}

.pokeball-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    height: 340px;
    opacity: 0.20;
    z-index: 0;
    pointer-events: none;
    background: url('pokeball.png') no-repeat center center;
    background-size: contain;
}

.pokemon-info {
    margin-top: auto;
    background: rgba(200, 200, 200, 0.5);
    border-radius: 10px 10px 15px 15px;
    padding: 18px 10px 14px 10px;
    margin: 0 -20px -20px -20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
} 