:root {
    --primary-neon: #00f2ff;
    --secondary-neon: #7000ff;
    --bg-dark: #0a0b10;
    --glass-bg: rgba(15, 17, 26, 0.7);
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

h1,
h2,
#search-btn,
#copy-btn,
.label,
#live-indicator,
.ad-label {
    font-family: 'Orbitron', sans-serif;
}

/* Header & Search */
header {
    padding: 20px;
    z-index: 100;
    background: linear-gradient(to bottom, var(--bg-dark), transparent);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.glass-bar {
    width: 90%;
    max-width: 600px;
    margin: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
}

#pokemon-search {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
}

#search-btn {
    background: linear-gradient(45deg, var(--primary-neon), var(--secondary-neon));
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    margin-left: 10px;
    font-size: 12px;
}

#live-indicator {
    font-size: 9px;
    color: var(--primary-neon);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    white-space: nowrap;
}

#live-indicator.hidden-indicator {
    display: none;
}

.dot {
    height: 6px;
    width: 6px;
    background-color: var(--primary-neon);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-neon);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

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

    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Map & Layout */
main {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#map {
    width: 100%;
    height: 100%;
}

/* Ad Units */
.top-ad {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 728px;
    z-index: 50;
    border-radius: 8px;
    padding: 5px;
}

.ad-label {
    font-size: 8px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 2px;
}

/* Suggestions Dropdown */
#suggestions {
    position: absolute;
    top: calc(100% + 5px);
    max-width: 600px;
    left: 0;
    margin-left: 19px;
    right: 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 110;
}

.hidden {
    display: none;
}

/* Handle Empty Ad Units gracefully during review (Status 400) */
.ad-unit:empty,
.ad-unit:has(ins[data-ad-status="unfilled"]) {
    display: none;
}

ins.adsbygoogle {
    background: transparent !important;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.suggestion-item:hover {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary-neon);
}

/* Info Panel */
#info-panel {
    position: absolute;
    right: 20px;
    top: 100px;
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    z-index: 60;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

#info-img {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 5px;
}

#info-name {
    font-size: 18px;
    margin-bottom: 0;
}

/* Stats & Buttons */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 10px;
}

.label {
    display: block;
    font-size: 9px;
    color: var(--text-dim);
}

.value {
    font-size: 16px;
    color: var(--primary-neon);
}

.coords-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.coords-values {
    font-size: 12px;
    margin-bottom: 8px;
}

#copy-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--primary-neon);
    color: var(--primary-neon);
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

/* Footer Overlay */
footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    padding: 15px 20px;
    z-index: 50;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

footer p {
    font-size: 10px;
    color: var(--text-dim);
}

footer nav {
    display: flex;
    gap: 15px;
}

footer nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 10px;
}

footer nav a:hover {
    color: var(--primary-neon);
}

@media (max-width: 768px) {
    header {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
    }

    .glass-bar {
        width: 100%;
        min-width: unset;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    #pokemon-search {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    .filter-bar {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    #info-panel {
        width: calc(100% - 40px);
        left: 20px;
        top: auto;
        bottom: 120px;
        /* Make room for stacked footer */
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding-bottom: 10px;
    }
}

.loader-icon {
    display: inline-block;
    height: 10px;
    width: 10px;
    border: 2px solid rgba(0, 242, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-neon);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#alert-modal.hidden {
    display: none;
}

.alert-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
}

#alert-email {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-neon);
    color: white;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.alert-dropdown {
    width: 100%;
    padding: 12px;
    margin-bottom: 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-neon);
    color: white;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.alert-dropdown option {
    background: #111;
    color: white;
}

#save-alert-btn,
#close-alert-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    transition: 0.2s;
}

#save-alert-btn {
    background: var(--primary-neon);
    color: black;
}

#save-alert-btn:hover {
    background: #00d0db;
}

#close-alert-btn {
    background: #333;
    color: white;
    border: 1px solid #555;
}

#close-alert-btn:hover {
    background: #444;
}

.dot.red {
    background-color: #ff3366;
    box-shadow: 0 0 8px #ff3366;
}

/* Quick Filter Bar (Top Right) */
.filter-bar {
    /* background: var(--glass-bg); */
    /* backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); */
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    /* border-radius: 12px; */
    /* padding: 8px 15px; */
    display: flex;
    align-items: center;
    gap: 10px;
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); */
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Quick Filter Buttons */
.filter-btn {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

#filter-shiny:active {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

#filter-legendary:active {
    background: rgba(255, 136, 0, 0.2);
    border-color: rgba(255, 136, 0, 0.5);
    color: #ffaa00;
}