/*
Theme Name: PokeDB Pro Theme
Theme URI: https://yoursite.com/pokedb-pro
Author: Your Name
Description: Professional Pokemon GO database theme compatible with PokeGO Hub Pro plugin. Modern dark design with automatic 404 fix.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: pokedb-pro
Tags: gaming, dark, pokemon, database

PokeDB Pro Theme v2.1.0 - With automatic permalink fix
*/

:root {
    --pokedb-primary: #e94560;
    --pokedb-secondary: #533483;
    --pokedb-accent: #00d4ff;
    --pokedb-success: #48bb78;
    --pokedb-warning: #ecc94b;
    --pokedb-danger: #f56565;
    --pokedb-bg-body: #0f0f1a;
    --pokedb-bg-dark: #1a1a2e;
    --pokedb-bg-card: #16213e;
    --pokedb-bg-elevated: #1f2b47;
    --pokedb-bg-header: #0d0d1a;
    --pokedb-text-primary: #ffffff;
    --pokedb-text-secondary: #a0aec0;
    --pokedb-text-muted: #718096;
    --pokedb-text-link: #00d4ff;
    --pokedb-border: #2d3748;
    --pokedb-radius: 8px;
    --pokedb-radius-lg: 12px;
    --pokedb-shadow: 0 4px 20px rgba(0,0,0,0.4);
    --pokedb-shadow-hover: 0 8px 30px rgba(233,69,96,0.3);
    --pokedb-container: 1400px;
    --pokedb-header-height: 70px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--pokedb-text-primary);
    background: var(--pokedb-bg-body);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pokedb-text-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--pokedb-primary); }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pokedb-text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin: 0 0 1rem 0; color: var(--pokedb-text-secondary); }
ul, ol { margin: 0 0 1rem 0; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; color: var(--pokedb-text-secondary); }

.container {
    max-width: var(--pokedb-container);
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    min-height: calc(100vh - var(--pokedb-header-height) - 200px);
    padding: 40px 0;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--pokedb-bg-header);
    border-bottom: 1px solid var(--pokedb-border);
    height: var(--pokedb-header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--pokedb-container);
    margin: 0 auto;
    padding: 0 20px;
}

.site-branding a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pokedb-text-primary);
}

.site-branding a:hover { color: var(--pokedb-primary); }

.site-title {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--pokedb-primary), var(--pokedb-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-navigation ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li { margin: 0; }

.main-navigation a {
    padding: 8px 0;
    color: var(--pokedb-text-secondary);
    font-weight: 500;
    font-size: 15px;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a { color: var(--pokedb-primary); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--pokedb-text-primary);
    font-size: 24px;
    cursor: pointer;
}

.header-search input {
    width: 250px;
    padding: 10px 16px;
    background: var(--pokedb-bg-card);
    border: 1px solid var(--pokedb-border);
    border-radius: 25px;
    color: var(--pokedb-text-primary);
    font-size: 14px;
    outline: none;
}

.header-search input:focus {
    border-color: var(--pokedb-primary);
    box-shadow: 0 0 0 3px rgba(233,69,96,0.2);
}

/* Footer */
.site-footer {
    background: var(--pokedb-bg-header);
    border-top: 1px solid var(--pokedb-border);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h4 { color: var(--pokedb-text-primary); margin-bottom: 20px; }
.footer-widget ul { list-style: none; padding: 0; }
.footer-widget li { margin-bottom: 12px; }
.footer-widget a { color: var(--pokedb-text-secondary); }
.footer-widget a:hover { color: var(--pokedb-primary); }

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--pokedb-border);
    text-align: center;
    color: var(--pokedb-text-muted);
    font-size: 14px;
}

/* Type Badges */
.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin: 2px;
}

.type-normal { background: linear-gradient(135deg, #A8A878, #8a8a5c); }
.type-fire { background: linear-gradient(135deg, #F08030, #dd6610); }
.type-water { background: linear-gradient(135deg, #6890F0, #4a6fc4); }
.type-electric { background: linear-gradient(135deg, #F8D030, #e6b800); }
.type-grass { background: linear-gradient(135deg, #78C850, #5ca935); }
.type-ice { background: linear-gradient(135deg, #98D8D8, #69c6c6); }
.type-fighting { background: linear-gradient(135deg, #C03028, #9d1f18); }
.type-poison { background: linear-gradient(135deg, #A040A0, #803380); }
.type-ground { background: linear-gradient(135deg, #E0C068, #c9a43e); }
.type-flying { background: linear-gradient(135deg, #A890F0, #7a5de8); }
.type-psychic { background: linear-gradient(135deg, #F85888, #e62e63); }
.type-bug { background: linear-gradient(135deg, #A8B820, #8a9a1b); }
.type-rock { background: linear-gradient(135deg, #B8A038, #93802d); }
.type-ghost { background: linear-gradient(135deg, #705898, #554374); }
.type-dragon { background: linear-gradient(135deg, #7038F8, #4c11db); }
.type-dark { background: linear-gradient(135deg, #705848, #513e30); }
.type-steel { background: linear-gradient(135deg, #B8B8D0, #9898b0); }
.type-fairy { background: linear-gradient(135deg, #EE99AC, #e66a87); }

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

.pokemon-card {
    display: block;
    background: var(--pokedb-bg-card);
    border: 1px solid var(--pokedb-border);
    border-radius: var(--pokedb-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.pokemon-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pokedb-shadow-hover);
    border-color: var(--pokedb-primary);
}

.pokemon-card-image {
    background: var(--pokedb-bg-elevated);
    padding: 20px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokemon-card-image img { max-height: 100px; object-fit: contain; }

.pokemon-card-body { padding: 15px; text-align: center; }

.pokemon-card-dex {
    display: block;
    color: var(--pokedb-text-muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.pokemon-card-name {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--pokedb-text-primary);
}

.pokemon-card-cp {
    display: block;
    color: var(--pokedb-text-secondary);
    font-size: 13px;
}

/* Infobox */
.pokemon-infobox {
    background: var(--pokedb-bg-card);
    border: 1px solid var(--pokedb-border);
    border-radius: var(--pokedb-radius-lg);
    overflow: hidden;
}

.pokemon-infobox-header {
    background: linear-gradient(135deg, var(--pokedb-primary), var(--pokedb-secondary));
    padding: 20px;
    text-align: center;
}

.pokemon-infobox-dex {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.pokemon-infobox-name {
    margin: 5px 0 0 0;
    color: #fff;
    font-size: 28px;
}

.pokemon-infobox-image {
    background: var(--pokedb-bg-elevated);
    padding: 30px;
    text-align: center;
    position: relative;
}

.pokemon-infobox-image img { max-width: 200px; max-height: 200px; }

.pokemon-infobox-types { padding: 15px; text-align: center; border-bottom: 1px solid var(--pokedb-border); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pokedb-bg-card);
    border-radius: var(--pokedb-radius);
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--pokedb-border);
}

.data-table th {
    background: var(--pokedb-bg-elevated);
    color: var(--pokedb-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.data-table td { color: var(--pokedb-text-primary); }
.data-table tr:hover td { background: var(--pokedb-bg-elevated); }

/* Stat Bars */
.stat-bar {
    display: inline-block;
    width: 100px;
    height: 8px;
    background: var(--pokedb-bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
    vertical-align: middle;
}

.stat-fill { height: 100%; border-radius: 4px; }
.stat-fill.attack { background: linear-gradient(90deg, #f56565, #e53e3e); }
.stat-fill.defense { background: linear-gradient(90deg, #4299e1, #3182ce); }
.stat-fill.stamina { background: linear-gradient(90deg, #48bb78, #38a169); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--pokedb-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pokedb-primary), var(--pokedb-secondary));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--pokedb-shadow-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--pokedb-bg-elevated);
    color: var(--pokedb-text-primary);
    border: 1px solid var(--pokedb-border);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 14px;
    color: var(--pokedb-text-muted);
}

.breadcrumbs a { color: var(--pokedb-text-secondary); }
.breadcrumbs a:hover { color: var(--pokedb-primary); }
.breadcrumbs span { margin: 0 8px; }

/* Archive Header */
.archive-header {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--pokedb-primary), var(--pokedb-secondary));
    border-radius: var(--pokedb-radius-lg);
    color: #fff;
}

.archive-title { font-size: 48px; margin: 0 0 15px 0; }
.archive-desc { font-size: 18px; opacity: 0.9; max-width: 600px; margin: 0 auto 20px; color: rgba(255,255,255,0.9); }
.archive-count { display: inline-block; background: rgba(255,255,255,0.2); padding: 8px 20px; border-radius: 20px; font-size: 14px; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 15px;
    background: var(--pokedb-bg-card);
    border: 1px solid var(--pokedb-border);
    border-radius: var(--pokedb-radius);
    color: var(--pokedb-text-secondary);
    font-weight: 500;
}

.pagination a:hover {
    background: var(--pokedb-bg-elevated);
    border-color: var(--pokedb-primary);
}

.pagination .current {
    background: var(--pokedb-primary);
    border-color: var(--pokedb-primary);
    color: #fff;
}

/* 404 Page */
.error-404 { text-align: center; padding: 100px 20px; }

.error-404 h1 {
    font-size: 150px;
    margin: 0;
    background: linear-gradient(135deg, var(--pokedb-primary), var(--pokedb-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.error-404 h2 { font-size: 36px; margin: 20px 0; }
.error-404 p { font-size: 18px; margin-bottom: 30px; }
.error-actions { display: flex; gap: 15px; justify-content: center; margin-bottom: 40px; }

/* Single Pokemon Layout */
.single-pokemon-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
}

.pokemon-sidebar {
    position: sticky;
    top: calc(var(--pokedb-header-height) + 20px);
    align-self: start;
}

.pokemon-content { line-height: 1.8; }
.pokemon-content h2 { margin: 40px 0 20px; padding-bottom: 10px; border-bottom: 2px solid var(--pokedb-primary); }

/* Filters */
.archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--pokedb-bg-card);
    border-radius: var(--pokedb-radius-lg);
}

.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-group label { color: var(--pokedb-text-secondary); font-size: 14px; }

.filter-group select {
    padding: 10px 15px;
    background: var(--pokedb-bg-elevated);
    border: 1px solid var(--pokedb-border);
    border-radius: var(--pokedb-radius);
    color: var(--pokedb-text-primary);
    font-size: 14px;
}

/* Search Form */
.search-form { display: flex; position: relative; }

.search-field {
    flex: 1;
    padding: 12px 16px;
    background: var(--pokedb-bg-card);
    border: 1px solid var(--pokedb-border);
    border-radius: 25px;
    color: var(--pokedb-text-primary);
    font-size: 14px;
    outline: none;
}

.search-field:focus {
    border-color: var(--pokedb-primary);
    box-shadow: 0 0 0 3px rgba(233,69,96,0.2);
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--pokedb-text-muted);
    cursor: pointer;
    padding: 8px;
}

/* Responsive */
@media (max-width: 992px) {
    .main-navigation ul { display: none; }
    .menu-toggle { display: block; }
    .main-navigation.active ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--pokedb-header-height);
        left: 0;
        right: 0;
        background: var(--pokedb-bg-header);
        padding: 20px;
        border-bottom: 1px solid var(--pokedb-border);
        gap: 15px;
    }
    .single-pokemon-layout { grid-template-columns: 1fr; }
    .pokemon-sidebar { position: static; }
}

@media (max-width: 768px) {
    h1, .archive-title { font-size: 2rem; }
    .header-search { display: none; }
    .pokemon-grid { grid-template-columns: repeat(2, 1fr); }
    .archive-filters { flex-direction: column; }
}

@media (max-width: 480px) {
    .pokemon-grid { grid-template-columns: 1fr; }
}
