/**
 * Pokeplasma - Glassmorphism Design v3
 * With podium design, single flag dropdown, and infinite scroll
 */

:root {
  --type-normal: #A8A77A;
  --type-fire: #EE8130;
  --type-water: #6390F0;
  --type-electric: #F7D02C;
  --type-grass: #7AC74C;
  --type-ice: #96D9D6;
  --type-fighting: #C22E28;
  --type-poison: #A33EA1;
  --type-ground: #E2BF65;
  --type-flying: #A98FF3;
  --type-psychic: #F95587;
  --type-bug: #A6B91A;
  --type-rock: #B6A136;
  --type-ghost: #735797;
  --type-dragon: #6F35FC;
  --type-dark: #705746;
  --type-steel: #B7B7CE;
  --type-fairy: #D685AD;

  --stat-hp: #FF5959;
  --stat-attack: #F5AC78;
  --stat-defense: #FAE078;
  --stat-sp-attack: #9DB7F5;
  --stat-sp-defense: #A7DB8D;
  --stat-speed: #FA92B2;

  --category-legendary: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  --category-mythical: linear-gradient(135deg, #E040FB 0%, #7C4DFF 100%);
  --category-ultra-beast: linear-gradient(135deg, #00BCD4 0%, #00838F 100%);
  --category-mega: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  --category-gmax: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);

  --bg-dark: #0f0f23;
  --bg-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.15);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;

  --container-max: 1600px;
  --grid-gap: 20px;
}

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

/* Hide all scrollbars */
* {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

*::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-gradient);
  overflow: hidden;
}

.bg-particles::before,
.bg-particles::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.bg-particles::before {
  background: var(--accent-primary);
  top: 10%;
  left: 10%;
}

.bg-particles::after {
  background: var(--type-psychic);
  bottom: 10%;
  right: 10%;
  animation-delay: -10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.header-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

/* Header Back Button (hidden by default) */
.header-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.header-back-btn svg {
  width: 20px;
  height: 20px;
}

.header-back-btn.visible {
  display: flex;
}

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

.logo h1 {
  font-weight: 700;
  font-size: 1.5rem;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
}

.pokeball {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.pokeball-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
}

.pokeball-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
}

.pokeball-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: white;
  border: 3px solid #333;
  border-radius: 50%;
  z-index: 2;
}

/* Single Flag Language Selector */
.lang-selector-wrapper {
  position: relative;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-selector:hover {
  background: var(--glass-highlight);
}

.lang-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.lang-selector:hover .lang-chevron {
  transform: translateY(2px);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-base);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.lang-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-option:hover {
  background: var(--glass-highlight);
}

.lang-option img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

/* Search */
.search-container {
  position: relative;
  flex: 1;
  max-width: 700px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 4px;
  transition: var(--transition-base);
}

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

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
  margin-left: 8px;
}

#searchInput {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 100px;
}

#searchInput:focus {
  outline: none;
}

#searchInput::placeholder {
  color: var(--text-muted);
}

.search-clear {
  width: 24px;
  height: 24px;
  background: var(--glass-highlight);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition-fast);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  opacity: 1;
}

.search-clear:hover {
  background: var(--text-muted);
  color: var(--bg-dark);
}

/* Language selector inside search bar */
.search-lang {
  flex-shrink: 0;
}

.search-lang .lang-selector {
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--glass-border);
  border-radius: 0;
  border-top-left-radius: calc(var(--radius-lg) - 4px);
  border-bottom-left-radius: calc(var(--radius-lg) - 4px);
}

.search-lang .lang-selector:hover {
  background: var(--glass-highlight);
}

/* Filters button inside search bar */
.search-filters-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin: 0 4px;
}

.search-filters-btn:hover {
  background: var(--glass-highlight);
}

.search-filters-btn.active {
  background: var(--accent-primary);
  color: white;
}

.search-filters-btn svg {
  width: 16px;
  height: 16px;
}

/* Stats counter inside search bar */
.search-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: transparent;
  padding: 6px 10px;
  border: none;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-stats span:first-child {
  font-weight: 700;
  color: var(--accent-primary);
}

.stats-counter {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--glass-bg);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

.stats-counter span:first-child {
  font-weight: 700;
  color: var(--accent-primary);
}

/* Filters - Sidebar on desktop */
.filters-section {
  position: fixed;
  top: 80px;
  left: 0;
  width: 320px;
  height: calc(100vh - 80px);
  z-index: 150;
  background: linear-gradient(180deg, rgba(15, 15, 35, 0.98) 0%, rgba(26, 26, 62, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filters-section::-webkit-scrollbar {
  display: none;
}

.filters-section.sidebar-visible {
  transform: translateX(0);
}

/* Close button for sidebar */
.filters-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.filters-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ef4444;
}

/* Sidebar header */
.filters-section::before {
  content: 'Filtres';
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
  width: fit-content;
}

.filters-toggle:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

.filters-toggle svg {
  width: 18px;
  height: 18px;
}

.filters-toggle .chevron {
  margin-left: 4px;
  transition: transform var(--transition-base);
}

.filters-toggle.active .chevron {
  transform: rotate(180deg);
}

.filters-content {
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px 24px;
  padding-bottom: 100px;
  backdrop-filter: none;
}

/* Overlay behind sidebar */
.filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filters-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.filter-mode-container {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.filter-mode-toggle {
  display: flex;
  gap: 8px;
}

.mode-btn {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.mode-btn:hover {
  background: var(--glass-highlight);
}

.mode-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

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

.filter-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.type-filters,
.generation-filters,
.category-filters,
.region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-fast);
  opacity: 0.6;
}

.type-pill-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.type-pill:hover,
.type-pill.active {
  opacity: 1;
  transform: scale(1.05);
}

.type-pill.active {
  border-color: white;
  box-shadow: var(--shadow-md);
}

.generation-pill,
.category-pill,
.region-pill {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.generation-pill:hover,
.category-pill:hover,
.region-pill:hover,
.generation-pill.active,
.category-pill.active,
.region-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.region-pill[data-region="alola"] {
  --region-color: #F4A460;
}

.region-pill[data-region="galar"] {
  --region-color: #9370DB;
}

.region-pill[data-region="hisui"] {
  --region-color: #87CEEB;
}

.region-pill[data-region="paldea"] {
  --region-color: #FF6B6B;
}

.region-pill.active {
  background: var(--region-color, var(--accent-primary));
  border-color: var(--region-color, var(--accent-primary));
}

.filter-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.range-filter {
  flex: 1;
  min-width: 200px;
}

.range-container {
  position: relative;
  padding-top: 8px;
}

.range-container input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--glass-border);
  border-radius: 2px;
  cursor: pointer;
}

.range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.range-values {
  text-align: center;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.reset-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-base);
  margin-top: 16px;
}

.reset-filters:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.reset-filters svg {
  width: 16px;
  height: 16px;
}

/* Grid */
.pokemon-grid-container {
  max-width: var(--container-max);
  margin: 0 auto;
  margin-top: 120px;
  /* Compensate for fixed header */
  padding: 0 24px 48px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: calc(var(--grid-gap) + 0px);
}

.load-more-trigger {
  height: 50px;
  width: 100%;
}

.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.no-results.visible {
  display: flex;
}

.no-results svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* ==========================================================================
   Skeleton Loader
   ========================================================================== */

.skeleton-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: 280px;
  overflow: hidden;
}

.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.skeleton-image {
  width: 80%;
  height: 120px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  margin: 12px 16px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-types {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.skeleton-type {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* ==========================================================================
   Pokemon Card with Podium Design
   ========================================================================== */

.pokemon-card {
  position: relative;
  background: var(--glass-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 16px 16px 12px;
  cursor: pointer;
  transition: var(--transition-base);
  overflow: visible;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  /* Flashy type-based border glow */
  background-image:
    linear-gradient(var(--glass-bg), var(--glass-bg)),
    var(--card-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 0 12px 2px color-mix(in srgb, var(--card-gradient-start, #6366f1) 50%, transparent),
    0 0 24px 4px color-mix(in srgb, var(--card-gradient-end, #8b5cf6) 30%, transparent);
  animation: cardGlow 3s ease-in-out infinite alternate;
}

@keyframes cardGlow {
  0% {
    box-shadow:
      0 0 8px 1px color-mix(in srgb, var(--card-gradient-start, #6366f1) 40%, transparent),
      0 0 16px 2px color-mix(in srgb, var(--card-gradient-end, #8b5cf6) 20%, transparent);
  }

  100% {
    box-shadow:
      0 0 16px 3px color-mix(in srgb, var(--card-gradient-start, #6366f1) 60%, transparent),
      0 0 32px 6px color-mix(in srgb, var(--card-gradient-end, #8b5cf6) 40%, transparent);
  }
}

.pokemon-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-gradient);
  opacity: 0.3;
  z-index: 0;
  transition: opacity var(--transition-base);
  border-radius: inherit;
}

.pokemon-card::after {
  content: attr(data-number);
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  -webkit-text-stroke: 2px var(--card-gradient-start, rgba(255, 255, 255, 0.3));
  text-shadow:
    0 0 15px color-mix(in srgb, var(--card-gradient-start, #6366f1) 40%, transparent),
    0 0 30px color-mix(in srgb, var(--card-gradient-end, #8b5cf6) 30%, transparent);
  z-index: 0;
  pointer-events: none;
  line-height: 1;
}

.pokemon-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 0 20px 4px color-mix(in srgb, var(--card-gradient-start, #6366f1) 70%, transparent),
    0 0 40px 8px color-mix(in srgb, var(--card-gradient-end, #8b5cf6) 50%, transparent);
  animation: none;
}

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

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

.pokemon-id {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.7;
  z-index: 2;
  background: var(--glass-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Image Container */
.pokemon-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  z-index: 1;
}

/* Ground shadow for depth effect */
.pokemon-image-container::after {
  content: '';
  position: absolute;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 20%;
  background: radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.25) 40%,
      transparent 70%);
  border-radius: 50%;
  z-index: 0;
  filter: blur(4px);
}

.pokemon-image {
  position: absolute;
  top: 15%;
  left: 0;
  width: 100%;
  height: 85%;
  object-fit: contain;
  transition: transform var(--transition-base);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  z-index: 1;
}

/* Card Podium - hidden, using shadow only */
.card-podium {
  display: none;
}

.pokemon-image.lazy {
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pokemon-image.loaded {
  opacity: 1;
}

/* Card Shiny Button - Top left corner */
.card-shiny-btn {
  position: absolute;
  top: -4px;
  left: -4px;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 5;
  transition: var(--transition-fast);
  opacity: 0.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-shiny-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px gold);
}

.card-shiny-btn.active {
  opacity: 1;
  filter: drop-shadow(0 0 8px gold);
}

/* Card Favorite Button - Top right corner (minimal) */
.card-favorite-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition-fast);
  opacity: 0.7;
  color: white;
}

.card-favorite-btn svg {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.card-favorite-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #ff4d6d;
}

.card-favorite-btn.active {
  opacity: 1;
  color: #ff4d6d;
}

.card-favorite-btn.active svg {
  filter: drop-shadow(0 0 4px #ff4d6d);
}

/* Favorites Toggle Button - Transparent, no border */
.favorites-toggle-btn {
  position: relative;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.favorites-toggle-btn:hover {
  background: transparent !important;
  color: #ff4d6d;
}

.favorites-toggle-btn.active {
  color: #ff4d6d;
  background: transparent !important;
}

.favorites-toggle-btn.active svg {
  fill: currentColor;
}

.favorites-count {
  position: absolute;
  top: -4px;
  right: -2px;
  background: #ff4d6d;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

/* Theme Toggle - Transparent, no border */
.theme-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.theme-toggle:hover {
  background: transparent !important;
}

/* Favorites View Mode - Special Header */
.pokemon-grid-container.favorites-view::before {
  content: '❤️ Mes Favoris';
  display: block;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff4d6d;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 77, 109, 0.3);
  text-shadow: 0 0 20px rgba(255, 77, 109, 0.5);
}

.pokemon-grid-container.favorites-view .pokemon-card {
  box-shadow:
    0 0 15px 3px rgba(255, 77, 109, 0.2),
    0 0 30px 6px rgba(255, 77, 109, 0.1);
}

/* Detail View - Name Row with Favorite Button */
.detail-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.detail-favorite-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition-fast);
}

.detail-favorite-btn svg {
  width: 28px;
  height: 28px;
}

.detail-favorite-btn:hover {
  color: #ff4d6d;
  transform: scale(1.15);
}

.detail-favorite-btn.active {
  color: #ff4d6d;
}

.detail-favorite-btn.active svg {
  fill: currentColor;
  filter: drop-shadow(0 0 8px #ff4d6d);
}

/* Podium - Platform under the Pokémon */
.pokemon-podium {
  position: relative;
  z-index: 2;
  margin: -15px auto 10px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.podium-types {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.podium-type {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.podium-type img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Pokemon Name - Above image */
.pokemon-name {
  position: relative;
  z-index: 2;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 5px;
}

/* Type Icons Row */
.pokemon-types {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.type-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.type-icon-badge img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Card Info (legacy) */
.pokemon-info {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* Category Badge */
.category-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 50px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: white;
  z-index: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-badge.legendary {
  background: var(--category-legendary);
}

.category-badge.mythical {
  background: var(--category-mythical);
}

.category-badge.ultra-beast {
  background: var(--category-ultra-beast);
}

.category-badge.mega {
  background: var(--category-mega);
}

.category-badge.gmax {
  background: var(--category-gmax);
}

.region-badge {
  position: absolute;
  bottom: 28px;
  left: 8px;
  width: 50px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  z-index: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-badge.alola {
  background: linear-gradient(135deg, #F4A460 0%, #D2691E 100%);
}

.region-badge.galar {
  background: linear-gradient(135deg, #9370DB 0%, #6A5ACD 100%);
}

.region-badge.hisui {
  background: linear-gradient(135deg, #87CEEB 0%, #5F9EA0 100%);
}

.region-badge.paldea {
  background: linear-gradient(135deg, #FF6B6B 0%, #EE5A5A 100%);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
}

/* Colorful gradient background on modal (same as cards) */
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-gradient);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.modal-content {
  position: relative;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-content {
  overflow-y: auto;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 100%);
}

.modal-image-container {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  animation: modalEntry 0.5s ease;
  transition: opacity 0.3s ease;
}

@keyframes modalEntry {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.shiny-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  white-space: nowrap;
  z-index: 10;
}

.shiny-toggle:hover {
  color: gold;
}

.shiny-toggle:hover .shiny-icon-img {
  filter: drop-shadow(0 0 6px gold);
}

.shiny-toggle.active {
  color: gold;
}

.shiny-toggle.active .shiny-icon-img {
  filter: drop-shadow(0 0 8px gold);
}

.shiny-icon {
  font-size: 1.2rem;
}

.shiny-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: filter 0.2s ease;
}

.modal-info {
  flex: 1;
}

.modal-id {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

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

/* Type badge with icon in modal */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.type-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.type-text {
  display: inline;
}

.modal-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-body {
  padding: 0 32px 32px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-description {
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-characteristics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.characteristic {
  text-align: center;
  padding: 16px;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.characteristic-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.characteristic-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.stats-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-label {
  width: 70px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stat-bar-container {
  flex: 1;
  height: 8px;
  background: var(--glass-bg);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.stat-value {
  width: 40px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
}

.weaknesses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Scroll Top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow:
    var(--shadow-lg),
    0 0 20px rgba(99, 102, 241, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.68, -0.3, 0.265, 1.3);
  z-index: 100;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: scrollTopPulse 2s ease-in-out infinite;
}

@keyframes scrollTopPulse {

  0%,
  100% {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.4);
  }

  50% {
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.6);
  }
}

.scroll-top:hover {
  transform: translateY(-4px) scale(1.1);
  animation: none;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.8);
}

.scroll-top svg {
  width: 24px;
  height: 24px;
}

/* Responsive - voir mobile.css pour les styles 768px et moins */

@media (min-width: 1200px) {
  .pokemon-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1600px) {
  .pokemon-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Hide shiny label text */
.shiny-label {
  display: none;
}

/* Modal Type Icons Only */
.type-icon-only {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: help;
}

.type-icon-only img {
  width: 20px;
  height: 20px;
  object-fit: contain;

}

/* Card Structure - Header/Body/Footer */
.card-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.card-header .pokemon-name {
  margin: 0;
  text-align: center;
}

.card-header .card-shiny-btn {
  position: absolute;
  top: -6px;
  left: -2px;
}

.card-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-footer {
  position: relative;
  z-index: 3;
  padding: 8px 0;
}

/* Shiny button icon */
.shiny-btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card-shiny-btn:hover .shiny-btn-icon {
  filter: drop-shadow(0 0 6px gold);
}

.card-shiny-btn.active .shiny-btn-icon {
  filter: drop-shadow(0 0 8px gold);
}

/* Category Icons - In footer, left side */
.category-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card-footer .category-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  position: relative;
}

/* Unified Toolbar */
.unified-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
}

/* Override for filters button inside search bar - no relief */
.search-filters-btn.toolbar-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Override for stats counter inside search bar - no relief */
.search-stats.stats-counter {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Footer alignment fix */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}

.card-footer .pokemon-types {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =============================================================================
   Sort Dropdown
   ============================================================================= */

.sort-selector-wrapper {
  position: relative;
}

.search-sort-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.search-sort-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.search-sort-btn:hover svg,
.search-sort-btn.active svg {
  color: var(--primary);
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 180px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-base);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.sort-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.sort-option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sort-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sort-option.active {
  background: var(--primary);
  color: white;
}

.sort-option.active svg {
  color: white;
}

/* =============================================================================
   Evolution Chain - Vertical Layout
   ============================================================================= */

.evolution-section {
  margin-top: 24px;
}

.evolution-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 16px 0;
}

/* Main evolution line (vertical) */
.evolution-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.evolution-pokemon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-base);
  min-width: 100px;
}

.evolution-pokemon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border);
  transform: scale(1.02);
}

.evolution-pokemon.current {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
}

.evolution-pokemon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.evolution-pokemon .evo-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

/* Vertical arrow between evolutions */
.evolution-arrow-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  color: var(--text-tertiary);
}

.evolution-arrow-vertical svg {
  width: 20px;
  height: 20px;
}

/* Special forms branching (Mega, Gigamax) */
.evolution-branches {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
  position: relative;
}

.evolution-branches::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: var(--glass-border);
}

.evolution-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.evolution-branch .branch-line {
  width: 1px;
  height: 12px;
  background: var(--glass-border);
}

.evolution-branch .evolution-pokemon {
  padding: 10px 14px;
  min-width: 90px;
}

.evolution-branch .evolution-pokemon img {
  width: 56px;
  height: 56px;
}

.evolution-branch .evolution-pokemon .evo-name {
  font-size: 0.8rem;
}

/* Alternative forms section */
.alternative-forms-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  width: 100%;
}

.alternative-forms-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.alternative-forms-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.alternative-form-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
  min-width: 80px;
}

.alternative-form-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.alternative-form-link.current {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.alternative-form-link img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* No evolution message */
.no-evolution {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  padding: 16px;
}

/* =============================================================================
   Fullscreen Pokemon Detail Page
   ============================================================================= */

.pokemon-detail-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--detail-gradient, linear-gradient(135deg, var(--detail-color-light, #78C850) 0%, var(--detail-color-dark, #5CA935) 100%));
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 70px;
  /* Space for the detail header bar */
}

.pokemon-detail-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.pokemon-detail-page.visible {
  display: flex;
}

/* Detail Header Bar */
.detail-header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.detail-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.detail-back-btn svg {
  width: 20px;
  height: 20px;
}

/* Detail Language Selector */
.detail-lang {
  position: relative;
}

.detail-lang .lang-selector {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.detail-lang .lang-selector:hover {
  background: rgba(255, 255, 255, 0.2);
}

.detail-lang .lang-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

.detail-lang .lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(20, 20, 40, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-fast);
  min-width: 140px;
}

.detail-lang .lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.detail-lang .lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.detail-lang .lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.detail-lang .lang-option img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

/* Detail Controls (right side) */
.detail-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Detail Theme Toggle */
.detail-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.detail-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.detail-theme-toggle .theme-toggle-icon {
  width: 20px;
  height: 20px;
  color: white;
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.detail-theme-toggle .theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.detail-theme-toggle .theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .detail-theme-toggle .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .detail-theme-toggle .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .detail-theme-toggle {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .detail-theme-toggle .theme-toggle-icon {
  color: #1a1a2e;
}

[data-theme="light"] .detail-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Hide main header when detail page is visible */
.pokemon-detail-page.visible~.header {
  display: none;
}


/* Detail Content - 3 Columns */
.detail-content {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 24px;
  padding: 24px;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.detail-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Glass Card Effect - Enhanced */
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  z-index: 1;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Info Cards */
.info-card {
  /* inherits from glass-card */
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-value {
  font-size: 0.95rem;
  color: white;
  font-weight: 600;
}

.shiny-label-icon {
  width: 18px;
  height: 18px;
}

.info-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.info-types .type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  /* Ensure solid background - no transparency */
  background-color: var(--type-color, #777);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.info-types .type-badge img {
  width: 14px;
  height: 14px;
}

.info-weaknesses {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.info-weaknesses .type-icon-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-weaknesses .type-icon-small img {
  width: 14px;
  height: 14px;
}

.info-forms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.info-forms .form-badge {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.info-forms .form-badge.current {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: default;
}

.info-forms .form-badge:not(.current) {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-forms .form-badge:not(.current):hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Toggle Switch for Shiny */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(24px);
}

/* Center Column - Pokemon */
.detail-center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px;
}

.pokemon-detail-name {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.pokemon-detail-category {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.pokemon-detail-category:empty {
  display: none;
}

/* Pokemon Showcase with Navigation Arrows */
.pokemon-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
}

.nav-arrow {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.nav-arrow svg {
  width: 28px;
  height: 28px;
}

.pokemon-display {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 480px;
}

.pokemon-detail-image {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Pokemon Podium */
.pokemon-podium {
  width: 180px;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
  border-radius: 50%;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

.pokemon-detail-description {
  max-width: 500px;
  color: white;
  font-size: 0.95rem;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  margin-top: 16px;
  padding: 0 20px;
  opacity: 0.9;
}

/* Stats Column - inherits from glass-card */
.stats-header {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 12px;
  align-items: center;
}

.stats-header-spacer {
  display: none;
}

.stats-header-spacer {
  /* Empty spacer for stat name column */
}

.stats-tab {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.stats-tab:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.stats-tab.active {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.stat-name {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.stat-bar-container {
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.stat-bar {
  height: 100%;
  border-radius: 6px;
  background-color: var(--stat-color, #78C850);
  background-image:
    linear-gradient(90deg, var(--stat-color, #78C850) 0%, var(--stat-color-light, #9AE878) 100%),
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0px,
      rgba(255, 255, 255, 0.15) 10px,
      transparent 10px,
      transparent 20px);
  background-blend-mode: normal, overlay;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transition: width 0.5s ease;
}

@keyframes stat-stripes {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 20px 0;
  }
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  text-align: right;
}

.stats-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 12px;
}

.stats-total-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}

.stats-total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
}

/* Evolution Chain - Horizontal */
.detail-evolution {
  padding: 24px;
  margin: 0 24px 24px;
  position: relative;
  z-index: 1;
}

.evolution-title {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-lg);
  display: block;
  width: fit-content;
  margin: 0 auto 20px;
}

.evolution-chain-horizontal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.evo-main-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.evo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.evo-pokemon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.1);
}

.evo-pokemon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.evo-pokemon.current {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px white;
}

.evo-pokemon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.evo-pokemon .evo-id {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
}

.evo-pokemon .evo-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
}

.evo-pokemon .evo-types {
  display: flex;
  gap: 4px;
}

.evo-pokemon .evo-types .type-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evo-pokemon .evo-types .type-dot img {
  width: 12px;
  height: 12px;
}

.evo-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.7);
}

.evo-arrow svg {
  width: 24px;
  height: 24px;
  color: white;
}

.evo-arrow .evo-level {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* Special forms section (Mega/Gmax) in evolution */
.evo-special-forms {
  width: 100%;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.evo-special-divider {
  text-align: center;
  margin-bottom: 16px;
}

.evo-special-label {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.evo-special-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  max-width: 400px;
  margin: 0 auto;
}

.evo-pokemon.evo-special {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
}

.evo-pokemon.evo-special:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.evo-pokemon.evo-special img {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.evo-pokemon.evo-special .evo-name {
  font-size: 0.85rem;
  text-align: left;
}

/* Shiny card styling - same as other info cards */
.shiny-card .info-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shiny-label-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* =============================================================================
   Toast Notifications
============================================================================= */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 0.95rem;
  min-width: 280px;
  max-width: 400px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.68, -0.3, 0.265, 1.3), opacity 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-success {
  border-left: 4px solid #4ade80;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-info {
  border-left: 4px solid var(--accent-primary);
}

/* Mobile toast positioning */
@media (max-width: 768px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 80px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }
}