/* fetch_demo.css — Estilos para el Buscador Pokémon PRO */

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 70px);
  padding: 100px 20px 60px;
  gap: 30px;
}

.page-title {
  font-family: "Outfit", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, #a5b4fc, #c084fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.page-sub {
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
}

/* ── Caja de búsqueda ── */
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 650px;
  width: 100%;
  position: sticky;
  top: 100px;
  z-index: 100;
  background: rgba(11, 17, 32, 0.8);
  padding: 12px;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-input-wrapper {
  flex: 2;
  min-width: 200px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.6);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
}

.search-input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.3);
}

#type-filter {
  flex: 1;
  min-width: 150px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.6);
  color: white;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

#type-filter:focus { border-color: var(--accent-primary); }

/* ── Grid de Pokémon ── */
.poke-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  width: 100%;
  max-width: 1200px;
}

.poke-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp 0.4s ease forwards;
  backdrop-filter: blur(10px);
}

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

.poke-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.poke-num  { font-size: 0.8rem; color: var(--text-secondary); font-weight: 700; margin-bottom: 5px; letter-spacing: 2px; }
.poke-img  { width: 150px; height: 150px; object-fit: contain; margin: 10px 0; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2)); }
.poke-name { font-family: "Outfit", sans-serif; font-size: 1.5rem; font-weight: 700; text-transform: capitalize; margin: 10px 0; color: white; }

.types { display: flex; gap: 8px; margin-bottom: 15px; }

.type-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
}

/* ── Stats ── */
.stats { width: 100%; margin-top: auto; }

.stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.stat-name { font-size: 0.7rem; color: var(--text-secondary); width: 60px; text-align: left; }
.stat-bar  { flex: 1; background: rgba(255,255,255,0.05); height: 6px; border-radius: 3px; overflow: hidden; }
.stat-fill { height: 100%; background: var(--accent-primary); border-radius: 3px; transition: width 0.5s ease; }

/* ── Spinner ── */
.spinner {
  width: 50px; height: 50px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 40px auto;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 50px; width: 100%; }

/* ── Botón Info flotante ── */
.info-btn {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.info-btn:hover {
  transform: scale(1.1) rotate(15deg);
  background: var(--accent-hover);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.7);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  max-width: 800px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 20px; right: 20px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-title {
  font-family: "Outfit", sans-serif;
  font-size: 2rem;
  color: var(--accent-hover);
  margin-bottom: 25px;
  text-align: center;
}

.explanation-step { margin-bottom: 30px; border-left: 3px solid var(--accent-primary); padding-left: 20px; }
.explanation-step h4 { color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.explanation-step p  { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin-bottom: 15px; }

.code-block {
  background: #1e1e1e;
  color: #e5e7eb; /* Texto base blanco/claro para código sin destacar */
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.05);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Colores por tipo Pokémon ── */
.fire     { background: #ef4444; }  .water    { background: #3b82f6; }
.grass    { background: #10b981; }  .electric { background: #f59e0b; }
.psychic  { background: #ec4899; }  .ice      { background: #06b6d4; }
.dragon   { background: #8b5cf6; }  .normal   { background: #94a3b8; }
.poison   { background: #a855f7; }  .ground   { background: #d97706; }
.fairy    { background: #f472b6; }  .rock     { background: #78716c; }
.bug      { background: #84cc16; }  .ghost    { background: #6d28d9; }
.steel    { background: #64748b; }  .fighting { background: #dc2626; }
.flying   { background: #818cf8; }  .dark     { background: #374151; }
