#pokemon-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    width: 90%;
    max-width: 450px;
    height: 80vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    background-color: var(--bg-card-base);
    color: #fff;
    border: 2px solid var(--color-type, #333);
}

.overlay-header {
    padding: 20px 20px 0 20px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
}

.overlay-header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.overlay-header-top h2 {
    margin: 0;
    font-size: 32px;
}

.overlay-header-top span {
    font-size: 20px;
    font-weight: bold;
    opacity: 0.8;
}

.close-overlay-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 0 0 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-overlay-btn:hover {
    opacity: 1;
}

.overlay-types {
    width: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

#overlay-image {
    width: 180px;
    height: 180px;
    margin-top: 10px;
    margin-bottom: -50px;
    z-index: 2;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

.overlay-body {
    flex: 1;
    background-color: transparent;
    padding: 60px 20px 20px 20px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.about-section {
    background-color: #2a2a2a;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.about-section h4 {
    margin: 0 0 10px 0;
    color: #aaa;
}

.about-info {
    display: flex;
    justify-content: space-around;
    text-align: center;
    font-size: 16px;
}

.about-info span {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
    color: #aaa;
}

.overlay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    flex: 1;
}

.grid-tile {
    background-color: #2a2a2a;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
    border: 2px solid #333;
    color: #fff;
}

.grid-tile:hover {
    transform: translateY(-3px);
    background-color: #333;
    border-color: #555;
}

.overlay-details {
    flex: 1;
    background-color: #2a2a2a;
    border-radius: 15px;
    padding: 20px;
    overflow-y: auto;
}

.details-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

.back-btn {
    width: 25px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: invert(1);
}

.back-btn:hover {
    transform: scale(1.1);
}

.details-header h3 {
    margin: 0;
    font-size: 18px;
    text-transform: uppercase;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.stat-name {
    width: 75px;
    text-transform: uppercase;
    font-weight: bold;
    color: #aaa;
}

.stat-value {
    width: 30px;
    text-align: right;
    margin-right: 10px;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background-color: #444;
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.bg-stat-high {
    background-color: #78C850;
}

.bg-stat-low {
    background-color: #F08030;
}

.move-item, .ability-item {
    background: #3a3a3a;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-transform: capitalize;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.ability-item {
    flex-direction: column;
    gap: 5px;
}

.ability-desc {
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
    color: #bbb;
}

.move-level {
    color: #aaa;
    font-size: 14px;
}

.loading-text {
    text-align: center;
    color: #aaa;
}

.empty-msg {
    color: #aaa;
    font-style: italic;
}

.hidden-badge {
    font-size: 12px;
    color: #aaa;
}

.shiny-container {
    text-align: center;
    margin-top: 20px;
}

.shiny-container img {
    width: 250px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.nav-arrow {
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    transition: opacity 0.2s;
    z-index: 1001;
}

.nav-arrow:hover {
    opacity: 0.7;
}

.d-none {
    display: none !important;
}

@media (max-width: 768px) {
    .overlay-content {
        width: 95%;
        height: 85vh;
    }

    .nav-arrow {
        font-size: 30px;
        padding: 10px;
    }

    .overlay-header-top h2 {
        font-size: 26px;
    }

    .overlay-header-top span {
        font-size: 18px;
    }

    #overlay-image {
        width: 150px;
        height: 150px;
        margin-bottom: -40px;
    }

    .overlay-body {
        padding: 50px 15px 15px 15px;
    }
}

@media (max-width: 480px) {
    .overlay-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        border: none;
        overflow-y: auto;
    }

    .nav-arrow {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        padding: 15px 8px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 8px;
        z-index: 1002;
    }

    .nav-arrow:first-of-type {
        left: 5px;
    }

    .nav-arrow:last-of-type {
        right: 5px;
    }

    .overlay-header {
        padding: 15px 15px 0 15px;
    }

    .overlay-header-top h2 {
        font-size: 24px;
    }

    .overlay-types .type-badge {
        font-size: 14px;
    }

    #overlay-image {
        width: 140px;
        height: 140px;
        margin-bottom: -40px;
    }

    .overlay-body {
        padding: 50px 35px 10px 35px;
    }

    .about-info {
        font-size: 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .grid-tile {
        font-size: 16px;
        padding: 15px 8px;
    }
}