:root {
  --bg-primary: #f6f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;

  --accent-primary: #4f46e5;
  --accent-secondary: #f59e0b;
  --accent-tertiary: #ef4444;
  --accent-success: #10b981;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;

  --color-anil: #22c55e;
  --color-opalo: #a855f7;
  --color-z: #14b8a6;

  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #fb7185 100%);
  --gradient-accent: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-hero: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #8b5cf6 100%);
  --gradient-soft: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.15), transparent 55%);

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-glow: rgba(79, 70, 229, 0.3);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 28px;

  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 16px 30px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.2);
  --shadow-glow-sm: 0 0 12px rgba(79, 70, 229, 0.15);

  --max-width: 1200px;
  --transition: all 0.25s ease;
  --transition-fast: all 0.15s ease;
}

/* === BODY === */
body {
  background: var(--bg-primary);
  background-image:
    var(--gradient-soft),
    radial-gradient(circle at 80% 0%, rgba(148, 163, 184, 0.2), transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* === HEADER === */
header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0.9;
}

/* === NAV CONTAINER === */
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

/* === LOGO === */
.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  position: relative;
  transition: var(--transition);
}

.logo::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 34px;
  background: url('https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/poke-ball.png') no-repeat center;
  background-size: contain;
  filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.3));
  animation: pokeball-float 4s ease-in-out infinite;
}

@keyframes pokeball-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

.logo span {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo:hover {
  transform: scale(1.02);
}

.logo:hover::before {
  animation-duration: 0.5s;
}

/* === NAV LINKS === */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  padding: 0.2rem 0;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--accent-primary);
  border-color: rgba(79, 70, 229, 0.3);
}

.nav-link.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* === SUB-NAVIGATION === */
.sub-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0 1rem;
}

.sub-nav .nav-container {
  height: auto;
  min-height: 44px;
  justify-content: center;
  gap: 0.75rem;
}

.sub-nav .nav-link {
  font-size: 0.85rem;
  padding: 0.45rem 1.2rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
}

.sub-nav .nav-link:hover {
  color: var(--accent-primary);
  border-color: rgba(79, 70, 229, 0.3);
  transform: none;
}

.sub-nav .nav-link.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow-sm);
}

/* === SEARCH === */
.search-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 320px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow-sm);
}

.search-icon {
  font-size: 1rem;
  opacity: 0.6;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-main);
  width: 100%;
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* === LANGUAGE SELECTOR === */
.lang-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* === SEARCH HERO SECTION === */
.search-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.search-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  pointer-events: none;
}

.search-hero-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-hero .search-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
  width: 100%;
  padding: 1rem;
}

.search-hero .search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow-sm);
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

.card:hover::before {
  opacity: 1;
}

.card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: url('https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/poke-ball.png') no-repeat center;
  background-size: contain;
  opacity: 0.05;
  pointer-events: none;
}

.card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.card-tag {
  background: var(--gradient-secondary);
  color: #1f2937;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-block;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.card-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.15));
}

.btn-link {
  color: var(--accent-primary);
  font-weight: 700;
  transition: var(--transition-fast);
}

.btn-link:hover {
  color: var(--accent-secondary);
}

/* === HERO === */
.hero {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #dbeafe 100%);
  color: var(--text-main);
  padding: 3.2rem 1.5rem 3.6rem;
  border-radius: 0 0 36px 36px;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(79, 70, 229, 0.12);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 50%);
  pointer-events: none;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 1.15rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.2rem;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3.5rem;
  flex-wrap: wrap;
}

.hero-stat {
  min-width: 120px;
}

.hero-stat-value {
  font-size: 2.3rem;
  font-weight: 900;
  display: block;
}

.hero-stat-label {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.home-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === TYPE TAGS === */
.type-tag {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* Pokémon Types Colors - Enhanced */
.type-grass { background: linear-gradient(135deg, #78C850 0%, #5a9a3c 100%); }
.type-poison { background: linear-gradient(135deg, #A040A0 0%, #803380 100%); }
.type-fire { background: linear-gradient(135deg, #F08030 0%, #d66a20 100%); }
.type-water { background: linear-gradient(135deg, #6890F0 0%, #4a70d0 100%); }
.type-bug { background: linear-gradient(135deg, #A8B820 0%, #8a9a18 100%); }
.type-normal { background: linear-gradient(135deg, #A8A878 0%, #8a8a5a 100%); }
.type-electric { background: linear-gradient(135deg, #F8D030 0%, #dab820 100%); color: #333; }
.type-ground { background: linear-gradient(135deg, #E0C068 0%, #c4a450 100%); }
.type-fairy { background: linear-gradient(135deg, #EE99AC 0%, #d67a8a 100%); }
.type-fighting { background: linear-gradient(135deg, #C03028 0%, #9a2420 100%); }
.type-psychic { background: linear-gradient(135deg, #F85888 0%, #d64070 100%); }
.type-rock { background: linear-gradient(135deg, #B8A038 0%, #9a8430 100%); }
.type-steel { background: linear-gradient(135deg, #B8B8D0 0%, #9a9ab8 100%); }
.type-ice { background: linear-gradient(135deg, #98D8D8 0%, #70c0c0 100%); color: #333; }
.type-ghost { background: linear-gradient(135deg, #705898 0%, #584080 100%); }
.type-dragon { background: linear-gradient(135deg, #7038F8 0%, #5820d8 100%); }
.type-dark { background: linear-gradient(135deg, #705848 0%, #584030 100%); }
.type-flying { background: linear-gradient(135deg, #A890F0 0%, #8870d0 100%); }

/* === STATS BARS === */
.stat-bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 80px 45px 1fr;
  align-items: center;
  gap: 1rem;
}

.stat-label {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-weight: 800;
  font-size: 0.9rem;
  text-align: right;
  color: var(--text-main);
}

.stat-bar-bg {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease-out;
  box-shadow: 0 0 10px currentColor;
}

/* === APP CONTAINER LAYOUT === */
.app-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* === SIDEBAR === */
aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-group {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filter-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* === TOGGLE BUTTONS (Radio/Checkbox styled) === */
.toggle-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toggle-option {
  padding: 0.6rem 1.1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-option:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
  background: rgba(79, 70, 229, 0.08);
}

input[type="radio"]:checked + .toggle-option,
input[type="checkbox"]:checked + .toggle-option {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow-sm);
}

.inicialIMG {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: var(--transition);
}

input[type="radio"]:checked + .toggle-option .inicialIMG,
input[type="checkbox"]:checked + .toggle-option .inicialIMG {
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.5));
  transform: scale(1.1);
}

/* === ITEM LIST (Trainers, etc.) === */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.item-list::-webkit-scrollbar {
  width: 6px;
}

.item-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.item-list::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}

.item-list li {
  padding: 0.7rem 0.9rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.item-list li:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-main);
  transform: translateX(4px);
}

.item-list li.active,
.item-list li.selected,
.item-list li.selected-trainer {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow-sm);
}

.item-list li img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-color);
}

.numeroDeOrden {
  font-weight: 800;
  color: var(--text-muted);
  min-width: 22px;
}

.nombreEntrenador {
  font-weight: 700;
  color: inherit;
  min-width: 80px;
}

.numeroDePokemon {
  font-weight: 700;
  color: inherit;
}

.pokeballIMG {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* === DETAIL VIEW === */
.detail-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

#pokemon-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* === POKEMON DETAILS HEADER === */
.pkm-detail-header {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(260px, 1fr);
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.trainer-sprite-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.pkm-main-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.15));
}

.type-interactions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.interaction-category {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.interaction-category h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.types p {
  margin: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

/* === POKEMON GRID === */
.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.pokemon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pokemon-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.pokemon-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.pokemon-card:hover::before {
  opacity: 1;
}

.pokemon-card .number {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
}

.pokemon-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0.75rem 0;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.15));
  transition: var(--transition);
}

.pokemon-card .pokemonIMG {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0.75rem 0;
}

.pokemon-card:hover img {
  transform: scale(1.08) translateY(-4px);
  filter: drop-shadow(0 12px 24px rgba(79, 70, 229, 0.25));
}

.pokemon-card .name {
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

/* === LOCATION/ENCOUNTERS === */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.location-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.location-item[open] {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-sm);
}

/* === POKERADAR ENCOUNTER GROUPS === */
.encounter-group {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.encounter-type-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
}

.encounter-type-header img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.encounter-type-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.location-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
  list-style: none;
}

.location-summary::-webkit-details-marker { display: none; }

.location-details {
  padding: 0.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.encounter-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.encounter-method img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.encounter-info {
  display: flex;
  flex-direction: column;
}

.encounter-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
}

.encounter-levels {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === SELECT DROPDOWN === */
select.search-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

select.search-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: var(--shadow-glow-sm);
}

select.search-input option {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem;
}

/* === MAP === */
#map-container {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
}

#map-image {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

#zone-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-tertiary);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
  transform: translate(-50%, -50%);
  display: none;
}

/* === TRAINER / ENCOUNTERS DETAILS === */
.trainer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.5rem;
}

.trainer1,
.trainer2 {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.trainer-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  margin: 0.5rem 0;
}

.tipo,
.Tipo-Combate {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
  margin: 0.35rem 0;
}

.tipo {
  background: var(--gradient-primary);
}

.Tipo-Combate {
  background: var(--gradient-success);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.objCurativo,
.cantPokemon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ubicacion {
  text-align: center;
  padding: 0.6rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
  font-weight: 700;
  margin-top: 1rem;
}

.trainer3 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.resumenPokemon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.resumenPokemon img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border-color);
}

.type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.moveTypeWrapper {
  display: grid;
  grid-template-columns: 26px 1fr 26px auto auto;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem;
  margin: 0.4rem 0;
}

.moveTypeWrapper img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.moveTypeWrapper p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.PowerBox,
.AccBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.abilities {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ability-tooltip,
.move-tooltip {
  font-weight: 700;
  cursor: pointer;
}

/* === FLOATING DESCRIPTIONS === */
#floating-description,
#floating-description-moves {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  max-width: 300px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  pointer-events: none;
}

#floating-description.hidden,
#floating-description-moves.hidden {
  display: none;
}

/* === HELPER CLASSES === */
.flex { display: flex; align-items: center; gap: 0.5rem; }
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}
.span-2 { grid-column: span 2; }
@media (max-width: 768px) { .span-2 { grid-column: span 1; } }

.hidden {
  display: none !important;
}

/* === FOOTER === */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
}

footer a {
  color: var(--accent-primary);
  transition: var(--transition);
}

footer a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-container {
    height: auto;
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .search-container {
    max-width: 100%;
    order: 4;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .pokemon-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .trainer-card {
    grid-template-columns: 1fr;
  }

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

  .pkm-detail-header {
    grid-template-columns: 1fr;
  }

  .pkm-main-img {
    width: 160px;
    height: 160px;
  }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% { box-shadow: var(--shadow-glow-sm); }
  50% { box-shadow: var(--shadow-glow); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-glow {
  animation: glow 2s infinite;
}
