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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.main-content {
    display: flex;
    gap: 30px;
}

/* Sidebar de Filtros */
.filters-sidebar {
    flex: 0 0 280px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.filters-sidebar h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.btn-reset {
    width: 100%;
    padding: 10px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.btn-reset:hover {
    background: #ff5252;
}

.btn-apply {
    width: 100%;
    padding: 12px;
    background: #51cf66;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: background 0.3s;
    font-size: 1em;
}

.btn-apply:hover {
    background: #40c057;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.filter-group-checkbox {
    margin-bottom: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
}

.filter-group-checkbox label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.95em;
}

.filter-group-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Área de Resultados */
.results-area {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
}

.results-header h2 {
    color: #667eea;
    font-size: 1.5em;
}

#result-count {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

/* Grid de Pokémons */
.pokemons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.pokemon-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.pokemon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.pokemon-number {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 5px;
}

.pokemon-sprite {
    width: 120px;
    height: 120px;
    margin: 10px auto;
    object-fit: contain;
}

.pokemon-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.pokemon-types {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 10px 0;
    flex-wrap: wrap;
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
}

.type-badge.normal { background: #A8A878; }
.type-badge.fogo { background: #F08030; }
.type-badge.agua { background: #6890F0; }
.type-badge.eletrico { background: #F8D030; color: #333; }
.type-badge.grama { background: #78C850; }
.type-badge.gelo { background: #98D8D8; color: #333; }
.type-badge.lutador { background: #C03028; }
.type-badge.voo { background: #A890F0; }
.type-badge.psiquico { background: #F85888; }
.type-badge.inseto { background: #A8B820; }
.type-badge.rocha { background: #B8A038; }
.type-badge.fantasma { background: #705898; }
.type-badge.dragao { background: #7038F8; }
.type-badge.escuro { background: #705848; }
.type-badge.aco { background: #B8B8D0; }
.type-badge.fada { background: #EE99AC; }
.type-badge.venenoso { background: #A040A0; }
.type-badge.terra { background: #E0C068; color: #333; }

.pokemon-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 10px;
    flex-grow: 1;
}

.pokemon-info p {
    margin: 3px 0;
}

.pokemon-price {
    background: #fff3cd;
    border-radius: 5px;
    padding: 8px;
    margin-top: 10px;
    font-weight: bold;
    color: #856404;
    font-size: 0.9em;
    border: 1px solid #ffc107;
}

.pokemon-balls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.ball-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: white;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 0.75em;
    font-weight: bold;
    color: #333;
}

.ball-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ball-count {
    font-size: 0.8em;
    color: #667eea;
    font-weight: bold;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1em;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1em;
}

/* Responsividade */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .filters-sidebar {
        flex: 1;
        position: static;
        max-height: none;
    }

    .pokemons-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .filters-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .filters-sidebar h2 {
        grid-column: 1 / -1;
    }

    .btn-reset {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .btn-apply {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .filter-group {
        margin-bottom: 0;
    }

    .filter-group-checkbox {
        margin-bottom: 0;
    }

    .pokemons-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .pokemon-sprite {
        width: 80px;
        height: 80px;
    }

    .pokemon-balls {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .main-content {
        gap: 15px;
    }

    .filters-sidebar {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .results-area {
        padding: 15px;
    }

    .pokemons-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .pokemon-card {
        padding: 10px;
    }

    .pokemon-sprite {
        width: 60px;
        height: 60px;
    }

    .pokemon-name {
        font-size: 0.9em;
    }
}
