/* ============================================
   ESTILOS GENERALES - POKÉBOLA THEME
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Fondo con círculos tipo pokebola */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 20%);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    border: 3px solid #2d2d2d;
}

/* ============================================
   ENCABEZADO CON ESTILO POKÉBOLA
   ============================================ */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

/* Círculo central tipo pokebola */
header::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: white;
    border: 5px solid #2d2d2d;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.1;
}

header::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #e33535;
    border: 3px solid #2d2d2d;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
}

h1 {
    font-size: 3em;
    color: #2d2d2d;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0 rgba(227, 53, 53, 0.3);
}

h1 span {
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.subtitle span {
    background: #2d2d2d;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9em;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ============================================
   ESTADÍSTICAS ROJAS
   ============================================ */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(227, 53, 53, 0.3);
    transition: transform 0.3s;
    border: 2px solid #2d2d2d;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* ============================================
   BARRA DE BÚSQUEDA
   ============================================ */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 3px solid #2d2d2d;
    border-radius: 30px;
    font-size: 1.1em;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #e33535;
    box-shadow: 0 5px 20px rgba(227, 53, 53, 0.2);
}

.search-box button {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s;
    border: 2px solid #2d2d2d;
    font-weight: bold;
}

.search-box button:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

/* ============================================
   FILTROS
   ============================================ */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #2d2d2d;
    border-radius: 25px;
    background: white;
    color: #2d2d2d;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 0.9em;
}

.filter-btn:hover {
    background: #e33535;
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #e33535;
    color: white;
    border-color: #2d2d2d;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #e33535;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ERROR
   ============================================ */
.error-message {
    text-align: center;
    padding: 40px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
    font-weight: bold;
}

/* ============================================
   GRILLA DE POKÉMON
   ============================================ */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pokemon-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
    border: 2px solid #2d2d2d;
}

/* Mitad roja tipo pokebola */
.pokemon-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    opacity: 0.1;
    z-index: 0;
}

.pokemon-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(227, 53, 53, 0.3);
}

/* ============================================
   IMAGEN
   ============================================ */
.pokemon-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 3px solid #2d2d2d;
    position: relative;
    z-index: 1;
}

/* Botón central tipo pokebola */
.pokemon-image::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #2d2d2d;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pokemon-card:hover .pokemon-image {
    transform: scale(1.1) rotate(5deg);
}

.pokemon-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 5px rgba(0,0,0,0.3));
    position: relative;
    z-index: 2;
}

/* ============================================
   NÚMERO Y NOMBRE
   ============================================ */
.pokemon-number {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.pokemon-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* ============================================
   TIPOS
   ============================================ */
.pokemon-types {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.type-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    border: 1px solid #2d2d2d;
}

.type-normal { background: #A8A878; }
.type-fuego { background: #F08030; }
.type-agua { background: #6890F0; }
.type-planta { background: #78C850; }
.type-electrico { background: #F8D030; }
.type-hielo { background: #98D8D8; }
.type-lucha { background: #C03028; }
.type-veneno { background: #A040A0; }
.type-tierra { background: #E0C068; }
.type-volador { background: #A890F0; }
.type-psiquico { background: #F85888; }
.type-bicho { background: #A8B820; }
.type-roca { background: #B8A038; }
.type-fantasma { background: #705898; }
.type-dragon { background: #7038F8; }

/* ============================================
   ESTADÍSTICAS
   ============================================ */
.pokemon-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.stat-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.stat-item .stat-label {
    font-size: 0.7em;
    color: #666;
}

.stat-item .stat-value {
    font-weight: bold;
    color: #333;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0 20px;
}

.pagination button {
    padding: 10px 25px;
    border: 2px solid #2d2d2d;
    border-radius: 25px;
    background: linear-gradient(135deg, #e33535 0%, #b32e2e 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.pagination button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(227, 53, 53, 0.4);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 1.1em;
    color: #2d2d2d;
    font-weight: bold;
}

/* ============================================
   PIE DE PÁGINA
   ============================================ */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 3px solid #e33535;
    color: #2d2d2d;
    position: relative;
}

footer code {
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    border: 1px solid #2d2d2d;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .pagination {
        flex-direction: column;
    }
}