* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1420 0%, #1a1f35 100%);
    font-family: 'Outfit', sans-serif;
    color: #fff;
    
}

.d-none {
    display: none !important;
}

.header {
    background: rgba(15, 20, 32, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pokeball-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #EE8130;
    background: radial-gradient(circle at 40% 40%,
            #fff 30%,
            #EE8130 31%,
            #EE8130 48%,
            #1a1f35 49%,
            #1a1f35 52%,
            #fff 53%);
}

.logo-area h1 {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.search-area {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 400px;
    min-width: 200px;
}

.search-area input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.search-area input:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.search-area input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#searchBtn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    cursor: not-allowed;
    opacity: 0.4;
    transition: all 0.2s;
}

#searchBtn.active {
    background: #EE8130;
    cursor: pointer;
    opacity: 1;
}

#searchBtn.active:hover {
    background: #d9722a;
}

.clear-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.search-error {
    text-align: center;
    padding: 32px 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 16px;
    margin: 0 0 24px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.search-error-icon {
    font-size: 36px;
}

.search-error p {
    color: #fca5a5;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.pokemon-card {
    border-radius: 16px;
    padding: 16px 16px 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 200px;
}

.pokemon-card:hover {
    transform: translateY(-6px) scale(1.03);
}

.pokemon-card-id {
    display: block;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-bottom: 4px;
}

.pokemon-card-inner {
    position: relative;
    z-index: 1;
}

.pokemon-card-img {
    width: 75%;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.pokemon-card-name {
    margin: 8px 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    word-break: break-word;
}

.pokemon-card-types {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.type-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.pokemon-card-circle {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #EE8130;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner span {
    font-size: 16px;
    color: #a0aec0;
    font-weight: 600;
}

.load-more-area {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    padding: 14px 40px;
    border-radius: 99px;
    border: none;
    background: linear-gradient(135deg, #EE8130, #F7D02C);
    color: #1a1f35;
    font-size: 16px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(238, 129, 48, 0.4);
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(238, 129, 48, 0.5);
}

.load-more-btn:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: #a0aec0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.pokemon-dialog {
    border: none;
    background: transparent;
    padding: 16px;
    max-width: 540px;
    width: 100%;
    margin: auto;
    overflow: visible;
}

.pokemon-dialog::backdrop {
    background: rgba(15, 20, 30, 0.7);
    backdrop-filter: blur(8px);
}

.overlay-card {
    background: #fff;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    margin: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.overlay-header {
    border-radius: 24px 24px 0 0;
    padding: 24px 24px 60px;
    position: relative;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.overlay-id-label {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

.overlay-circle {
    position: absolute;
    bottom: -40px;
    right: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.overlay-image {
    width: 65%;
    margin: 0 auto;
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background 0.2s;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.nav-arrow-left {
    left: -10px;
}

.nav-arrow-right {
    right: -10px;
}

.overlay-body {
    padding: 20px 24px 24px;
    margin-top: -36px;
    position: relative;
}

.overlay-info-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.overlay-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.overlay-name-row h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #1a202c;
    font-family: 'Outfit', sans-serif;
    word-break: break-word;
}

.overlay-types {
    display: flex;
    gap: 6px;
}

.overlay-type-badge {
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.overlay-metrics {
    display: flex;
    gap: 20px;
    margin: 12px 0 16px;
    justify-content: center;
}

.metric {
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 16px;
    color: #5a6578;
    font-weight: 600;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
}

.metric-divider {
    width: 1px;
    background: #e8ecf1;
}

.stats-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.stat-label {
    width: 56px;
    font-size: 16px;
    font-weight: 700;
    color: #5a6578;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-value {
    width: 32px;
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    color: #1a202c;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background: #e8ecf1;
    border-radius: 99px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo-area {
        justify-content: center;
    }

    .search-area {
        max-width: 100%;
    }

    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .nav-arrow-left {
        left: 10px;
    }

    .nav-arrow-right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .main-content {
        padding: 16px 12px 32px;
    }

    .pokemon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pokemon-card {
        min-height: 170px;
        padding: 12px 12px 10px;
    }

    .overlay-card {
        max-width: 100%;
    }

    .overlay-metrics {
        gap: 12px;
    }

    .stat-label {
        width: 50px;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 10px 10px;
    }

    .main-content {
        padding: 12px 8px 24px;
    }

    .search-area {
        flex-wrap: wrap;
        min-width: 0;
    }

    .search-area input {
        min-width: 0;
        flex: 1 1 100%;
    }

    #searchBtn {
        flex: 1;
    }

    .clear-btn {
        flex: 1;
    }

    .pokemon-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pokemon-card {
        min-height: 150px;
        padding: 10px 10px 8px;
    }

    .load-more-btn {
        padding: 12px 24px;
    }

    .overlay-card {
        max-width: 100%;
        border-radius: 16px;
    }

    .overlay-header {
        padding: 16px 16px 50px;
        border-radius: 16px 16px 0 0;
    }

    .overlay-body {
        padding: 16px 12px 16px;
    }

    .overlay-info-card {
        padding: 12px 12px;
    }


    .overlay-name-row h2 {
        font-size: 18px;
    }

    .overlay-metrics {
        gap: 8px;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .nav-arrow-left {
        left: 4px;
    }

    .nav-arrow-right {
        right: 4px;
    }

    .pokemon-dialog {
        max-width: 100%;

    }

    .close-btn {
        width: 28px;
        height: 28px;
    }

    .logo-area h1 {
        font-size: 18px;
    }

    .pokeball-logo {
        width: 30px;
        height: 30px;
    }

    .search-error {
        padding: 20px 12px;
    }

    .stat-label {
        width: 44px;
    }
}