@import "./components.css";
@import "./pkmn-types.css";
@import "./dialog.css";
@import "./defaults/standard.css";
@import "./defaults/sticky-footer.css";

:root {
  --box-shadow: rgba(149, 157, 165, 0.2);
  --surface-white: #ffffff;
  --surface-soft: #f3f4f7;
  --text-main: #222222;
  --text-soft: #6b7280;
}

body {
  color: var(--text-main);
  background: #f3f4f7;
}

body.dialog-open {
  overflow: hidden;
}

main.container {
  padding-top: 3.2rem;
  padding-bottom: 5.6rem;
}

.hidden {
  display: none;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3.6rem;
  text-align: center;
}

.brand-block {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.6rem;
}

.brand-logo {
  width: min(100%, 60rem);
  height: auto;
  object-fit: contain;
}

.page-title {
  font-size: 3.8rem;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.search-form {
  width: 100%;
  max-width: 58rem;
}

.search-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  padding-left: 1.8rem;
  border-radius: 2.2rem;
  background: #f7f7f7;
  box-shadow:
    0 0.8rem 2rem rgba(0, 0, 0, 0.06),
    inset 0 0.1rem 0 rgba(255, 255, 255, 0.9);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-main);
}

.search-bar input::placeholder {
  color: #6f6f6f;
}

.search-btn {
  width: 4.8rem;
  height: 4.8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #ff7b6b 0%, #f16058 100%);
  box-shadow: 0 0.8rem 1.8rem rgba(241, 96, 88, 0.28);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.search-btn img {
  width: 4rem;
  height: 4rem;
  display: block;
}

.reset-btn {
  height: 4.8rem;
  min-width: 10.8rem;
  flex-shrink: 0;
  padding: 0 1.8rem;
  border-radius: 1.2rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #4c6fff 0%, #6c63ff 100%);
  box-shadow: 0 1rem 2.4rem rgba(76, 111, 255, 0.22);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.search-btn:hover:not(:disabled),
.reset-btn:hover:not(:disabled),
.load-btn:hover:not(:disabled) {
  transform: translateY(-0.2rem);
}

.search-btn:disabled,
.reset-btn:disabled,
.load-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.content-wrapper {
  display: flex;
  justify-content: center;
}

.pkmn-list-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
  max-width: 112rem;
  margin: 0 auto;
}

.pkmn-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.5rem;
  width: 20rem;
  border-radius: 1.8rem;
  box-shadow: var(--box-shadow) 0 1rem 2.5rem;
  padding: 2rem;
  margin-top: 5rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pkmn-card:hover {
  transform: translateY(-0.4rem);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.12);
}

.pkmn-card > img {
  width: 11rem;
  transform: translate(0, -8rem);
  image-rendering: pixelated;
}

.pkmn-card:hover > img {
  animation: bounce 0.4s;
}

@keyframes bounce {
  0% {
    transform: translate(0, -8rem);
  }

  50% {
    transform: translate(0, -9rem);
  }

  100% {
    transform: translate(0, -8rem);
  }
}

.pkmn-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -9rem;
  gap: 2rem;
}

.pkmn-card-info > h2 {
  font-size: 2.5rem;
  line-height: 1rem;
  text-transform: capitalize;
}

.pkmn-card-info > p {
  font-size: 1.2rem;
  font-weight: 600;
  color: grey;
  line-height: 1rem;
}

.pkmn-list-wrapper > p {
  width: 100%;
  max-width: 50rem;
  padding: 2.4rem;
  border-radius: 2rem;
  background: var(--surface-white);
  text-align: center;
  color: var(--text-soft);
  box-shadow: 0 1.2rem 3rem rgba(15, 23, 42, 0.06);
}

.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 4.8rem;
}

.load-btn {
  min-width: 26rem;
  min-height: 5.2rem;
  padding: 0 2.4rem;
  border-radius: 999px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #4c6fff 0%, #6c63ff 100%);
  box-shadow: 0 1.2rem 2.6rem rgba(76, 111, 255, 0.22);
}

.page-footer {
  margin-top: 4.8rem;
  border-top: 1px solid #dfe5ee;
  background: #eef2f7;
}

.page-footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: 1.3rem;
  color: #6b7280;
  text-align: center;
}

@media (max-width: 768px) {
  main.container {
    padding-top: 2.4rem;
    padding-bottom: 4rem;
  }

  .page-header {
    margin-bottom: 2.8rem;
  }

  .brand-block {
    margin-bottom: 1.2rem;
  }

  .brand-logo {
    width: min(100%, 50rem);
  }

  .page-title {
    font-size: 3rem;
    margin-bottom: 1.6rem;
  }

  .search-form {
    max-width: 100%;
  }

  .search-bar {
    padding: 0.7rem;
    padding-left: 1.4rem;
    gap: 0.8rem;
    border-radius: 1.8rem;
  }

  .search-bar input {
    font-size: 1.3rem;
  }

  .search-btn {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 1rem;
  }

  .search-btn img {
    width: 3rem;
    height: 3rem;
  }

  .reset-btn {
    min-width: 9.4rem;
    height: 4.2rem;
    padding: 0 1.4rem;
    border-radius: 1rem;
    font-size: 1.2rem;
  }

  .load-btn {
    min-width: 100%;
  }
}

@media (max-width: 520px) {
  .brand-logo {
    width: min(100%, 45rem);
  }

  .page-title {
    font-size: 2.5rem;
  }

  .search-bar {
    flex-wrap: nowrap;
    gap: 0.8rem;
    padding: 0.8rem;
    padding-left: 1.2rem;
    border-radius: 1.8rem;
  }

  .search-bar input {
    flex: 1;
    min-width: 0;
    width: auto;
    font-size: 1.3rem;
  }

  .search-btn,
  .reset-btn {
    height: 4rem;
    border-radius: 1rem;
    flex-shrink: 0;
  }

  .search-btn {
    width: 4rem;
  }

  .search-btn img {
    width: 4rem;
    height: 4rem;
  }

  .reset-btn {
    min-width: 7.2rem;
    padding: 0 1rem;
    font-size: 1.15rem;
  }
}
