/* ==========================================
   1. VARIAVÉIS E CONFIGURAÇÕES DE CORES
   ========================================== */
:root {
    --bg-main: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e2e8f0;
    --accent: #e3350d;
    --nav-bg: #1a1a1a;
    --nav-text: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --transition: all 0.25s ease;
}

body.dark-mode {
    --bg-main: #0f141c;
    --bg-card: #1a2331;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #2e3d52;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Cores de Raridade */
.rarity-comum { --rarity-color: #94a3b8; }
.rarity-raro { --rarity-color: #3b82f6; }
.rarity-epico { --rarity-color: #a855f7; }
.rarity-lendario { --rarity-color: #eab308; }
.rarity-mitico { --rarity-color: #ec4899; }

/* Cores dos Tipos Pokémon */
.type-normal { --type-color: #A8A77A; }
.type-fogo { --type-color: #EE8130; }
.type-agua { --type-color: #6390F0; }
.type-planta { --type-color: #7AC74C; }
.type-eletrico { --type-color: #F7D02C; }
.type-gelo { --type-color: #96D9D6; }
.type-lutador { --type-color: #C22E28; }
.type-venenoso { --type-color: #A33EA1; }
.type-terra { --type-color: #E2BF65; }
.type-voador { --type-color: #A98FF3; }
.type-psiquico { --type-color: #F95587; }
.type-inseto { --type-color: #A6B91A; }
.type-pedra { --type-color: #B6A136; }
.type-fantasma { --type-color: #735797; }
.type-dragao { --type-color: #6F35FC; }
.type-sombrio { --type-color: #705746; }
.type-aco { --type-color: #B7B7CE; }
.type-fada { --type-color: #D685AD; }

/* ==========================================
   2. RESET E ESTRUTURA GERAL
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: var(--transition);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================
   3. HEADER E NAVEGAÇÃO
   ========================================== */
header {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pokeball-logo {
    width: 28px;
    height: 28px;
    background: linear-gradient(to bottom, #e3350d 50%, white 50%);
    border-radius: 50%;
    border: 3px solid #000;
    position: relative;
}
.pokeball-logo::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: white;
    border: 2px solid #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 800;
}
.logo-area h1 span { color: var(--accent); }

.main-nav { display: flex; height: 100%; }
.dropdown { position: relative; height: 100%; }

.nav-btn, .sub-nav-btn {
    background: transparent;
    border: none;
    color: var(--nav-text);
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: var(--transition);
}

.nav-btn:hover, .nav-btn.active {
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -4px 0 var(--accent);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--nav-bg);
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
    top: 70px;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content .sub-nav-btn {
    width: 100%;
    padding: 15px 20px;
}
.dropdown-content .sub-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ==========================================
   4. FILTROS E SELETORES
   ========================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 15px 25px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}
.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
}

.category-filters, .select-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

select {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

/* ==========================================
   5. CONTROLE DAS ABAS E ANIMAÇÃO
   ========================================== */
.tab-content {
    display: none;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-content.active { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   6. CARDS / FICHAS (MODO VISUALIZAÇÃO)
   ========================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 25px;
}

.card {
    background: var(--bg-card);
    border-radius: 18px;
    border-left: 6px solid var(--type-color, #a0aec0);
    box-shadow: var(--shadow);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.badges-wrapper {
    display: flex;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}
.badge-type { background: var(--type-color, var(--accent)); }
.badge-rarity { background: var(--rarity-color, #718096); }

/* Imagens */
.image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.img-box {
    background: var(--bg-main);
    border-radius: 10px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.no-img {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Blocos de Dados Clássicos */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
}
.info-field {
    display: flex;
    flex-direction: column;
}
.info-field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.info-field span {
    font-size: 0.9rem;
    background: var(--bg-main);
    padding: 6px 10px;
    border-radius: 6px;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.info-field.full-width { grid-column: span 2; }
.info-field.full-width span { display: block; height: auto; padding: 10px; }

/* Dashboards e Extras */
.hero-section, .about-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 700px;
    margin: 40px auto;
}
.quick-stats { display: flex; justify-content: center; gap: 20px; margin-top: 25px; }
.stat-box { background: var(--bg-main); padding: 15px 25px; border-radius: 10px; font-weight: 600; }

/* ==========================================
   7. RESPONSIVIDADE
   ========================================== */
@media (max-width: 850px) {
    header { flex-direction: column; height: auto; padding: 15px; gap: 10px; }
    .main-nav { width: 100%; justify-content: center; }
    .dropdown-content { top: 50px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .cards-grid { grid-template-columns: 1fr; }
}
