:root {
    --color-primary: #ffcb05;
    --color-secondary: #ff8000;
    --color-bg: #0f172a;
    --color-bg-alt: rgba(30, 41, 59, 0.7);
    --color-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --input-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --color-bg: #f8f9ff;
    --color-bg-alt: #ffffff;
    --color-border: #e0e4f8;
    --card-shadow: 0 8px 32px rgba(125, 137, 221, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: #e0e4f8;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --input-bg: rgba(0, 0, 0, 0.03);
}

body {
    background-color: var(--color-bg);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
}

.tool-container {
    max-width: 1300px;
    width: 100%;
    margin: 20px auto;
    padding: 0;
}


.tool-header {
    text-align: left;
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: 25px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px;
    line-height: 1.1;
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}


.tool-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1100px) {
    .tool-body {
        grid-template-columns: 1fr;
    }
}

.glass-panel {
    background: var(--color-bg-alt);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    height: 100%;
    box-sizing: border-box;
}


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

#pogo-search {
    flex: 0 0 50%;
    padding: 15px 20px 15px 45px;
    background: var(--input-bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 15px center;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s;
}

[data-theme="light"] #pogo-search {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23636e72" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
}

#pogo-search:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--input-bg);
}

.filter-controls {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

#gen-filter {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

#gen-filter option {
    background: var(--color-bg-alt);
    color: var(--text-primary);
}

.selection-panel {
    display: flex;
    flex-direction: column;
    height: 900px;
    overflow: hidden;
}


.pogo-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
    padding-right: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pogo-grid-container::-webkit-scrollbar { 
    display: none;
}

.grid-item {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.grid-item:hover {
    background: var(--input-bg);
    opacity: 0.8;
    transform: translateY(-3px);
    border-color: var(--color-primary);
}

.grid-item.active {
    background: rgba(255, 203, 5, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(255, 203, 5, 0.2);
}

.grid-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.grid-item span {
    display: block;
    margin-top: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.hud-section-top {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .hud-section-top {
        flex-direction: column;
        align-items: center;
    }
}

.selected-pkmn-hero {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.selected-pkmn-hero img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.selected-pkmn-hero h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.iv-simulator-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hud-section-top .perfection-wrap {
    margin-top: 5px;
}

.hud-section-middle {
    margin-bottom: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}


.perfection-wrap {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.perfection-badge {
    background: linear-gradient(135deg, #ffcb05 0%, #ff8000 100%);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(255, 203, 5, 0.3);
}

.iv-stats-display {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-secondary);
}


.pvp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 500px) {
    .pvp-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.pvp-card {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.pvp-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.league-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.league-header h4 {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.rank-display {
    padding: 10px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

.rank-display .label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.rank-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-primary);
}

.league-stats {
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.stat-row strong {
    color: var(--text-primary);
}


.league-gl { border-bottom: 3px solid #3b82f6; } 
.league-ul { border-bottom: 3px solid #eab308; } 
.league-ml { border-bottom: 3px solid #ef4444; } 


.hud-section-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.ai-pvp-alert {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ai-pvp-alert::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--color-primary);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.ai-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-content strong {
    color: var(--color-primary);
}


.bc-guide-box {
    margin-top: 3rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.bc-guide-box details { width: 100%; }

.bc-guide-box details summary {
    padding: 1.25rem 1.5rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--color-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.bc-guide-box details summary::-webkit-details-marker { display: none; }

.bc-guide-box details summary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bc-guide-box details summary::after {
    content: "▼";
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.bc-guide-box details[open] summary::after {
    transform: rotate(180deg);
}

.bc-guide-box details[open] summary {
    border-bottom: 1px solid var(--color-border);
}

.bc-guide-content {
    padding: 2.5rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.bc-guide-content h2 { color: var(--color-primary); margin: 2.5rem 0 1.25rem; font-size: 1.6rem; font-weight: 900; }
.bc-guide-content h3 { color: #ff4d4d; margin: 2rem 0 1rem; font-size: 1.3rem; font-weight: 800; }
.bc-guide-content p { margin-bottom: 1.5rem; }
.bc-guide-content ul { margin: 0 0 1.5rem 1.5rem; }
.bc-guide-content li { margin-bottom: 0.75rem; }


.shiny-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shiny-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ff4444;
    letter-spacing: 0.05em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--input-bg);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 4px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #ff4444; }
input:checked + .slider:before { transform: translateX(22px); }
