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

/* Remove default padding */
ul,
ol {
  padding: 0;
  list-style: none;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
figure,
figcaption,
blockquote {
  margin: 0;
}

:root {
  --bkg-color-light: #e5e5e5;
  --bkg-color-dark: #0c061e;
  --bkg-color-darkgray: #202020;
  --display-color-01: #e70388;
  --display-color-02: #23c0ec;
  --display-color-03: #7a2a8d;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  scroll-behavior: smooth;
  text-rendering: optimizeSpeed;
  line-height: 1;
  font-family: "Poppins", sans-serif;
  background-color: var(--bkg-color-dark);
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* styles */

.main-container {
  min-height: 100vh;
}

.top {
  background-color: var(--bkg-color-light);
}
.top-wrapper {
  padding: 1rem;
}

.search-wrapper {
  padding: 0 0 1rem;
  text-align: center;
  color: var(--bkg-color-light);
}

.search-wrapper h2 {
  font-size: 1.5rem;
  font-weight: 600;
  padding: 2rem 0 2rem;
}

.search-box {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--display-color-01);
  margin: 0 2rem;
}

.search-input,
.search-btn {
  width: 100%;
  font-size: 0.875rem;
}

.search-input {
  padding: 0.625rem;
  font-weight: 600;
  outline: 0;
  border: 0;
  color: var(--bkg-color-darkgray);
}

.search-input:focus {
  background-color: #fde4f3;
}
.search-input::placeholder {
  color: #666;
}

.search-btn {
  color: #fff;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  width: 30%;
  background-color: var(--display-color-01);

  transition: background-color 0.3s linear;
}

.search-btn:hover {
  background-color: #fc40ae;
}

.search-result {
  margin: 0 0 2rem;
}

.result-wrapper {
  padding: 1rem 1.5rem;
  text-align: center;
  margin: 0 auto;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.result-wrapper.not-found {
  color: var(--display-color-01);
  grid-template-columns: auto;
}

.not-found strong {
  display: block;
  width: 100%;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 3rem;
}

/* Card */

.card {
  margin: 0;
  overflow: hidden;
}

.character-name {
  font-size: 0.75rem;
  display: block;
  font-weight: 600;
  line-height: 1.1em;
  padding: 0.4375rem 0 0;
  color: var(--bkg-color-light);

  transition: color 0.3s;
}

.show-details {
  display: block;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  border: 4px solid var(--display-color-03);

  transition: border-color 0.3s;
}

.show-details:hover {
  border-color: var(--display-color-01);
}

.show-details:hover + .character-name {
  color: var(--display-color-01);
}

.show-details img {
  object-fit: cover;
  min-height: 80px;
}

.show-details,
.show-details img {
  width: 80px;
  height: 80px;
}
/* Modal */

.details-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bkg-color-dark);
  color: var(--bkg-color-light);
  text-align: center;
  width: 90%;
  height: 90%;
  overflow-y: scroll;
  box-shadow: rgba(240, 46, 170, 0.95) 5px 5px;
  z-index: 100;

  padding: 2rem;
  max-width: 720px;
  min-width: 328px;

  animation: fadein 0.3s;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 10;

  animation: fadein 0.3s;
}

@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hidden {
  display: none;
}

/* Modal Scrollbar */

.details-modal::-webkit-scrollbar {
  width: 10px;
}
.details-modal::-webkit-scrollbar-thumb {
  background-color: var(--display-color-02);
  border-radius: 2rem;
}

.close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: block;
  text-decoration: none;
  color: #fff;
  background-color: var(--display-color-01);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 7px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  z-index: 999;

  transition: opacity 0.3s;
}

.close-btn:hover {
  opacity: 1;
}

.character-title,
.character-series,
.character-events {
  color: var(--display-color-02);
  letter-spacing: 1px;
}

.character-title {
  font-size: 1.375rem;
  padding: 1rem 0 1rem;
  line-height: 1.1em;
  text-transform: uppercase;
  font-style: italic;
}

.character-series,
.character-events {
  font-size: 1rem;
  padding: 1rem 0;
}

.character-description {
  font-size: 0.875rem;
  line-height: 1.4285em; /* 20px / 14px */
  margin: 0 auto;
  padding: 0 0 1rem 0;
}

.character-info ul li {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.4285em;
  font-style: italic;
  margin: 0 0 0.4375rem 0;
}

.character-img img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto;
  object-fit: cover;
}
footer {
  text-align: center;
  padding: 2rem 0 0 0;
}
footer a {
  font-size: 12px;
  color: var(--display-color-02);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

@media screen and (min-width: 480px) {
  .show-details,
  .show-details img {
    width: 100px;
    height: 100px;
  }
}
@media screen and (min-width: 600px) {
  .search-box {
    width: 540px;
    margin-left: auto;
    margin-right: auto;
  }
  .search-input {
    padding: 1rem;
  }
  .search-input,
  .search-btn {
    font-size: 1rem;
  }
  .result-wrapper {
    padding: 2rem;
  }
  .show-details,
  .show-details img {
    width: 120px;
    height: 120px;
  }

  .character-name {
    font-size: 0.875rem;
  }
}

@media screen and (min-width: 768px) {
  .result-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
  .show-details,
  .show-details img {
    width: 130px;
    height: 130px;
  }
  .character-name {
    font-size: 0.875rem;
  }
  .details-modal {
    width: 700px;
  }
  .character-description {
    width: 70%;
    margin: 0 auto;
  }
}

@media screen and (min-width: 992px) {
  .result-wrapper {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media screen and (min-width: 1080px) {
  .result-wrapper {
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
  }
  .show-details,
  .show-details img {
    width: 150px;
    height: 150px;
  }
}
