@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Inter:wght@300;400;600&display=swap');

:root {
  --bg-1: #f8f4ea;
  --bg-2: #e3edff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-border: rgba(15, 23, 42, 0.08);
  --text: #101827;
  --muted: #5f6880;
  --accent: #ef4444;
  --accent-2: #f7c948;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}



* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(247, 201, 72, 0.36), transparent 30%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 28%),
    linear-gradient(160deg, var(--bg-1) 0%, #fdfdfb 48%, var(--bg-2) 100%);
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(18px);
  opacity: 0.7;
}

body::before {
  width: 280px;
  height: 280px;
  top: -90px;
  left: -70px;
  background: rgba(239, 68, 68, 0.12);
}

body::after {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -140px;
  background: rgba(59, 130, 246, 0.14);
}

.container {
  width: min(100%, 920px);
  padding: clamp(20px, 3vw, 34px);
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.container header {
  display: grid;
  gap: 10px;
  text-align: center;
  margin-bottom: 22px;
}

.container header h1 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.2em;
}

.container header p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--surface-border);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.search-container:focus-within {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 18px 38px rgba(239, 68, 68, 0.12);
  transform: translateY(-1px);
}

.search-container input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 10px 14px;
}

.search-container input::placeholder {
  color: #7b8397;
}

button {
  border: 0;
  border-radius: 18px;
  padding: 12px 20px;
  cursor: pointer;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ef4444, #c81e1e);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.28);
}

button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  box-shadow: none;
  transform: none;
}

.loading-container,
.result-container,
.error-container {
  margin-top: 18px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--surface-border);
  background: var(--surface-strong);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  color: var(--accent);
  font-weight: 700;
}

.result-container {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px 22px;
  align-items: start;
  animation: pop-in 0.35s ease-out;
}

.error-container {
  width: 100%;
  text-align: center;
  color: #b91c1c;
  font-weight: 700;
}

#pokemon-name {
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: capitalize;
}

#pokemon-sprite {
  grid-row: 2 / span 3;
  width: 100%;
  max-width: 240px;
  justify-self: center;
  align-self: center;
  padding: 14px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(247, 201, 72, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(15, 23, 42, 0.08);
  filter: drop-shadow(0 14px 18px rgba(15, 23, 42, 0.12));
  animation: float 3.4s ease-in-out infinite;
}

#pokemon-types,
#abilities,
#species {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  align-content: flex-start;
}

#pokemon-types {
  grid-column: 2;
}

#abilities,
#species {
  grid-column: 2;
  flex-direction: column;
}

#abilities {
  margin-top: -4px;
}

#species p,
#abilities .form-label {
  margin: 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(15, 23, 42, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none;
}

.type,
.form-label {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 20px;
  text-transform: capitalize;
  font-size: 0.92rem;
  line-height: 1.2;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 242, 255, 0.92));
  color: #1f2a44;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.type {
  letter-spacing: 0.02em;
}

.form-label {
  width: 50%;
  justify-content: center;
}

.normal {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.fire {
  background: linear-gradient(135deg, #fee2e2, #fdba74);
}

.water {
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
}

.grass {
  background: linear-gradient(135deg, #dcfce7, #86efac);
}

.electric {
  background: linear-gradient(135deg, #fef9c3, #fde047);
}

.ice {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
}

.fighting {
  background: linear-gradient(135deg, #fecaca, #fb7185);
}

.poison {
  background: linear-gradient(135deg, #ede9fe, #c4b5fd);
}

.ground {
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
}

.flying {
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
}

.psychic {
  background: linear-gradient(135deg, #fbcfe8, #f9a8d4);
}

.bug {
  background: linear-gradient(135deg, #dcfce7, #bef264);
}

.rock {
  background: linear-gradient(135deg, #e7e5e4, #cbd5e1);
}

.ghost {
  background: linear-gradient(135deg, #e9d5ff, #c084fc);
}

.dragon {
  background: linear-gradient(135deg, #dbeafe, #818cf8);
}

.dark {
  background: linear-gradient(135deg, #d1d5db, #6b7280);
}

.steel {
  background: linear-gradient(135deg, #e5e7eb, #94a3b8);
}

.fairy {
  background: linear-gradient(135deg, #fce7f3, #f9a8d4);
}

.unknown {
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}

.result-container.hidden {
  display: none;
}

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

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

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

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

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

@media (max-width: 760px) {
  .container {
    padding: 18px;
  }

  .result-container {
    grid-template-columns: 1fr;
  }

  #pokemon-sprite,
  #pokemon-types,
  #abilities,
  #species {
    grid-column: 1;
  }

  #pokemon-sprite {
    grid-row: auto;
    max-width: 210px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  body {
    padding: 12px;
  }

  .container {
    border-radius: 24px;
  }

  .search-container {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .loading-container,
  .result-container,
  .error-container {
    padding: 16px;
    border-radius: 22px;
  }

  #abilities,
  #species {
    gap: 8px;
  }
}
