:root {
  --dark: #0d1b2aff;
  --dark-accent: #1b263bff;
  --light-accent: #415a77ff;
  --light: #778da9ff;
  --white: #e0e1ddff;
}

/* Reset CSS */
html,
body,
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
code,
img,
small,
strong,
sub,
sup,
b,
u,
i,
center,
ul,
li,
fieldset,
form,
label,
legend,
caption,
article,
aside,
details,
figure,
figcaption,
footer,
header,
menu,
nav,
section,
summary {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

*:focus {
  outline: none;
}

::placeholder {
  color: var(--dark-accent);
  opacity: 0.9;
}

body {
  line-height: 1;
  background: var(--dark-accent);
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 2rem;
}

.nav-bar {
  background: var(--dark);
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

navigation {
  position: relative;
  align-items: center;
  color: var(--white);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: auto;
  width: 100%;
  max-width: 900px;

  a,
  a:visited {
    color: var(--white);
    text-decoration: none;
  }

  button {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    color: var(--white);
  }

  svg {
    width: 2rem;
    height: 2rem;
  }

  button,
  svg,
  a {
    transition: 0.3s;

    &:hover {
      color: var(--light);
    }
  }

  details {
    nav {
      position: absolute;
      top: 100%;
      left: 0;
      background: var(--light-accent);
      padding: 1rem;
      border-radius: 0.5rem;

      ul {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;

        a {
          font-size: 1.25rem;
        }
      }
    }
  }
}

main {
  padding: 1rem;
  color: var(--white);
}

section {
  margin-bottom: 1rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
}

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

@media (min-width: 1024px) {
  .movie-grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

.movie-card {
  transition: transform 0.2s;
  position: relative;
  text-decoration: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  display: flex;

  img {
    background: var(--light);
    width: 100%;
    border-radius: 0.5rem;
    color: var(--dark);
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    line-height: 1.5;
    font-size: 1rem;
  }

  svg {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    color: green;
  }
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-details {
  margin-top: 1rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;

  h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  p {
    text-wrap: balance;
    line-height: 1.5;
  }

  img {
    float: right;
    margin-left: 1rem;
    max-width: 30vw;
    border-radius: 0.5rem;
  }

  form {
    margin: 2rem auto;
    width: auto;

    button {
      cursor: pointer;
      background: var(--light);
      color: var(--dark-accent);
      padding: 1rem;
      border-radius: 0.5rem;
      border-width: 0;
      transition: 0.3s;

      &:hover {
        background: var(--light-accent);
      }
    }
  }
}

.search {
  text-align: center;

  form {
    display: flex;
    width: fit-content;
    margin: auto;
    margin-bottom: 2rem;
  }

  input {
    padding: 6px;
    margin-top: 8px;
    font-size: 1rem;
    border: none;
    max-width: 600px;
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;

    &:focus {
      border: none;
    }
  }

  button {
    float: right;
    padding: 6px 10px;
    margin-top: 8px;
    margin-right: 16px;
    background: var(--light);
    color: var(--dark);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    transition: 0.3s;

    &:hover {
      background: var(--light-accent);
    }

    svg {
      width: 25px;
      color: var(--dark);
    }
  }
}

.form-card {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  gap: 1rem;
  color: var(--dark);
  margin: auto;
  max-width: fit-content;
  background: var(--light);
  padding: 2rem;
  border-radius: 0.5rem;

  button {
    background: var(--dark-accent);
    border: none;
    border-radius: 0.5rem;
    margin: 0;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--white);
    font-size: 1rem;
    transition: 0.3s;

    &:hover {
      background: var(--dark);
    }
  }

  label {
    font-size: 1rem;
    color: var(--dark);
    font-weight: bold;
    display: block;
    font-family: sans-serif;
  }

  legend {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
  }

  fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;

    input {
      margin-left: 0.5rem;
    }
  }

  input,
  select {
    font-size: 1rem;
    color: var(--dark);
  }
}

.no-movies {
  max-width: fit-content;

  h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  p,
  a,
  a:active {
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.25;
  }
}

.alert {
  background: var(--light-accent);
  padding: 1rem;
  border-radius: 0.5rem;
  color: var(--white);
  text-align: center;
}

details>summary {
  list-style: none;
}

details>summary::-webkit-details-marker {
  display: none;
}