@font-face {
  font-display: swap;
  font-family: "Raleway";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/raleway-v37-latin-regular.woff2") format("woff2");
}

* {
  --max-width: 1920px;
  --content-padding-lg: 90px;
  --content-padding-sm: 15px;
  --header-height: 124px;
}

body {
  background-color: #3c5077;
  min-height: 100vh;
  width: 100%;
  font-family: "Raleway", Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-home {
  width: 100%;
  background-color: #3e5480;
  box-shadow: 0px 0px 5px #edcdcdc2;
}

header .container {
  padding: 0 clamp(var(--content-padding-sm), 5vw, var(--content-padding-lg));
  min-height: var(--header-height);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0;
  width: 100%;
}

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

.container .logo img {
  height: clamp(50px, 8vw, 80px);
  width: auto;
}

.container .logo h1 {
  color: white;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: bold;
  margin: 0;
  text-transform: capitalize;
  line-height: 1.2;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  flex-grow: 1;
  justify-content: flex-end;
}

.search-wrapp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.search-wrapp span {
  font-size: clamp(14px, 2vw, 16px);
  white-space: nowrap;
  color: white;
}

.search-wrapp input {
  border-radius: 4px;
  height: clamp(32px, 6vw, 36px);
  border: none;
  padding: 0 12px;
  font-size: clamp(14px, 2vw, 16px);
  width: 100%;
  min-width: 180px;
  max-width: 250px;
}

.search-wrapp img {
  cursor: pointer;
  height: clamp(16px, 3vw, 20px);
  width: auto;
}

.sort-wrapper {
  display: flex;
  align-items: center;
}

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

.wrapper p.body2-fonts {
  margin: 0;
  font-size: clamp(14px, 2vw, 16px);
  color: white;
  white-space: nowrap;
}

.filter-wrap {
  display: flex;
  gap: clamp(12px, 2vw, 26px);
}

.filter-wrap div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-wrap label {
  font-size: clamp(14px, 2vw, 16px);
  cursor: pointer;
  color: white;
  white-space: nowrap;
}

.filter-wrap input {
  cursor: pointer;
  width: clamp(16px, 3vw, 20px);
  height: clamp(16px, 3vw, 20px);
}

.pokemon-list {
  padding: 4px 0;
}

.pokemon-list .container {
  padding: 0 clamp(var(--content-padding-sm), 5vw, var(--content-padding-lg));
}

.list-wrapper {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(150px, 30vw, 200px), 1fr)
  );
  gap: clamp(12px, 3vw, 16px);
  padding: 20px 0;
  margin-bottom: 100px;
}

.list-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  padding: clamp(8px, 2vw, 12px);
  cursor: pointer;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}

.list-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgb(252, 251, 251);
  z-index: 10;
}

.img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60%;
  width: 100%;
}

.img-wrap img {
  width: clamp(80px, 15vw, 130px);
  height: clamp(80px, 15vw, 145px);
  object-fit: contain;
}

.card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 4px;
}

.pokemon-id {
  font-size: clamp(12px, 2.5vw, 14px);
  opacity: 0.8;
}

.pokemon-name {
  font-weight: bold;
  text-transform: capitalize;
  font-size: clamp(14px, 3vw, 16px);
  text-align: center;
  flex-grow: 1;
}

.type-container {
  display: flex;
  gap: clamp(4px, 1vw, 8px);
  margin-top: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.type-badge,
.type {
  padding: clamp(3px, 1vw, 4px) clamp(8px, 2vw, 7px);
  border-radius: 999px;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: bold;
  text-transform: uppercase;
  color: white;
}

.type-fire {
  background: linear-gradient(135deg, #f12711, #f5af19);
}
.type-water {
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
}
.type-grass {
  background: linear-gradient(135deg, #56ab2f, #a8e063);
}
.type-electric {
  background: linear-gradient(135deg, #f7971e, #ffd200);
}
.type-ice {
  background: linear-gradient(135deg, #83a4d4, #b6fbff);
}
.type-fighting {
  background: linear-gradient(135deg, #cb2d3e, #ef473a);
}
.type-poison {
  background: linear-gradient(135deg, #7f00ff, #e100ff);
}
.type-ground {
  background: linear-gradient(135deg, #ba8b02, #181818);
}
.type-flying {
  background: linear-gradient(135deg, #89f7fe, #66a6ff);
}
.type-psychic {
  background: linear-gradient(135deg, #ff0844, #ffb199);
}
.type-bug {
  background: linear-gradient(135deg, #a8e063, #56ab2f);
}
.type-rock {
  background: linear-gradient(135deg, #3c3b3f, #605c3c);
}
.type-ghost {
  background: linear-gradient(135deg, #41295a, #2f0743);
}
.type-dragon {
  background: linear-gradient(135deg, #20002c, #cbb4d4);
}
.type-dark {
  background: linear-gradient(135deg, #232526, #414345);
}
.type-steel {
  background: linear-gradient(135deg, #bdc3c7, #2c3e50);
}
.type-fairy {
  background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
}
.type-normal {
  background: linear-gradient(135deg, #e6dada, #274046);
}

#not-found-message {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: clamp(20px, 6vw, 32px);
  font-weight: bold;
  color: white;
  text-align: center;
  padding: 20px;
  pointer-events: none;
  z-index: 998;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  /* padding: 20px; */
}

.modal-overlay.active {
  display: flex;
}

.modal {
  color: white;
  width: min(95%, 350px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 14px;
  animation: popup 0.25s ease;
  background: #3e5480;
}

/* Modal Background */
.modal.type-fire {
  background: linear-gradient(135deg, #f12711, #f5af19);
}
.modal.type-water {
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
}
.modal.type-grass {
  background: linear-gradient(135deg, #56ab2f, #a8e063);
}
.modal.type-electric {
  background: linear-gradient(135deg, #f7971e, #ffd200);
}
.modal.type-ice {
  background: linear-gradient(135deg, #83a4d4, #b6fbff);
}
.modal.type-fighting {
  background: linear-gradient(135deg, #cb2d3e, #ef473a);
}
.modal.type-poison {
  background: linear-gradient(135deg, #7f00ff, #e100ff);
}
.modal.type-ground {
  background: linear-gradient(135deg, #ba8b02, #181818);
}
.modal.type-flying {
  background: linear-gradient(135deg, #89f7fe, #66a6ff);
}
.modal.type-psychic {
  background: linear-gradient(135deg, #ff0844, #ffb199);
}
.modal.type-bug {
  background: linear-gradient(135deg, #a8e063, #56ab2f);
}
.modal.type-rock {
  background: linear-gradient(135deg, #3c3b3f, #605c3c);
}
.modal.type-ghost {
  background: linear-gradient(135deg, #41295a, #2f0743);
}
.modal.type-dragon {
  background: linear-gradient(135deg, #20002c, #cbb4d4);
}
.modal.type-dark {
  background: linear-gradient(135deg, #232526, #414345);
}
.modal.type-steel {
  background: linear-gradient(135deg, #bdc3c7, #2c3e50);
}
.modal.type-fairy {
  background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
}
.modal.type-normal {
  background: linear-gradient(135deg, #e6dada, #274046);
}

.modal-header,
.modal-tabs,
.modal-content {
  background: inherit;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 15px);
  border-radius: 14px 14px 0 0;
  background: rgba(0, 0, 0, 0.2);
}

#modal-id {
  font-size: clamp(14px, 3vw, 16px);
}

#modal-name {
  font-size: clamp(18px, 4vw, 24px);
  margin: 0;
  text-transform: capitalize;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: clamp(20px, 4vw, 24px);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-image {
  text-align: center;
  padding: clamp(10px, 3vw, 15px);
  position: relative;
  background: rgba(0, 0, 0, 0.1);
}

.modal-image img {
  width: clamp(120px, 25vw, 150px);
  height: auto;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  padding: 0 10px;
}

.modal-nav button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.modal-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-prev img,
.modal-next img {
  width: clamp(24px, 5vw, 30px);
  height: clamp(24px, 5vw, 30px);
}

.modal-types {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

.modal-tabs {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  height: clamp(36px, 8vw, 40px);
  background: rgba(0, 0, 0, 0.2);
}

.tab {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: clamp(14px, 3vw, 17px);
  font-weight: bold;
  padding: 8px 4px;
  flex: 1;
  text-align: center;
  transition: color 0.2s;
}

.tab.active {
  color: white;
  border-bottom: 2px solid white;
}

.modal-content {
  padding: clamp(12px, 3vw, 13px);
  border-radius: 0 0 14px 14px;
  height: 230px;
  background: rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  line-height: 16px;
}

.tab-content p {
  display: flex;
  justify-content: space-between;
  margin: clamp(6px, 1.5vw, 8px) 0;
  font-size: clamp(14px, 3vw, 16px);
  line-height: 26px;
  align-items: center;
  padding-top: 10px;
}

.tab-content span {
  font-weight: bold;
}

.stat {
  margin-bottom: clamp(6px, 1.5vw, 8px);
}

.stat small {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(12px, 2.5vw, 14px);
  text-transform: capitalize;
}

.stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  background: white;
  border-radius: 6px;
}

#modal-evolution {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px;
  min-height: 150px;
}

#modal-evolution img {
  width: clamp(60px, 15vw, 80px);
  height: auto;
  transition: transform 0.2s;
}

#modal-evolution img:hover {
  transform: scale(1.1);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(50px, 10vw, 80px);
  padding-top: clamp(15px, 4vw, 30px);
  box-shadow: 0px 0px 5px #edcdcdc2;
  background-color: #3e5480;
  z-index: 100;
}

footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 0 clamp(var(--content-padding-sm), 5vw, var(--content-padding-lg));
}

footer .p-footer {
  font-size: clamp(12px, 3vw, 16px);
  color: #fff;
  text-align: center;
  margin: 0;
}

@media (min-width: 1921px) {
  .container {
    max-width: var(--max-width);
  }
}

@media (max-width: 1023px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .container .logo {
    justify-content: center;
    width: 100%;
  }

  .search-wrapper {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .search-wrapp {
    width: 100%;
    justify-content: center;
  }

  .search-wrapp input {
    max-width: 100%;
  }

  .sort-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .wrapper {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    text-align: center;
  }

  .filter-wrap {
    justify-content: center;
  }
}

@keyframes popup {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 1023px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .search-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .wrapper {
    justify-content: center;
  }

  .search-wrapp {
    justify-content: center;
  }

  .search-wrapp input {
    max-width: 300px;
  }

  .list-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 767px) {
  header .container {
    padding: 0 var(--content-padding-sm);
  }

  .pokemon-list .container {
    padding: 0 var(--content-padding-sm);
  }

  .header-content {
    gap: 12px;
  }

  .container .logo {
    justify-content: center;
    width: 100%;
  }

  .search-wrapper {
    gap: 12px;
  }

  .search-wrapp {
    align-items: center;
    gap: 8px;
  }

  .search-wrapp span {
    display: none;
  }

  .search-wrapp input {
    width: 100%;
    max-width: 100%;
  }

  .wrapper {
    align-items: center;
    gap: 8px;
  }

  .filter-wrap {
    justify-content: center;
  }



/* -------------------------- */

.list-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(12px, 3vw, 16px);
}

.list-item {
  align-self: stretch;
}


.img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}




  .modal {
    width: calc(100% - 30px);
    max-width: 320px;
    max-height: 460px;
  }
}

@media (max-width: 479px) {
  .container .logo h1 {
    font-size: 24px;
  }

  .logo img {
    height: 45px;
  }

  .list-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .list-item {
    aspect-ratio: 1;
  }

  .img-wrap img {
    width: 70px;
    height: 70px;
  }

  .pokemon-name {
    font-size: 13px;
  }

  .type-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}
