@import 'movie-posters.css';
/* Import movie posters CSS to declutter the style.css file*/

::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

::-webkit-scrollbar-button {
  width: 2px;
  height: 2px;
}

body {
  background-color: black;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans,
    Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: wheat;
}

a {
  color: thistle;
  text-decoration: none;
}

.text-center {
  text-align: center;
}

/* Header Organism */
.site-header {
  position: fixed;
  top: 0;
  left: 0%;
  width: 100vw;
  margin: 0 auto;
  padding: 1rem 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.site-header__inner {
  border: 3px solid white;
  padding: 4px 5px;
  max-width: 100vw;
  margin: 40px auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

@media only screen and (max-width: 1024px) {
  .site-header__inner {
    flex-direction: column;
    padding: 10px;
    margin: 10px auto;
  }
}

.site-header__inner img {
  height: 50px;
  vertical-align: middle;
}

.site-header__inner figcaption {
  font-size: 0.3rem;
  line-height: 0.3rem;
  font-weight: lighter;
  font-family: 'Courier New', Courier, monospace;
  color: gray;
}

.site-header__title {
  font-family: 'Coda', cursive;
  text-transform: uppercase;
  font-weight: 800;
  color: white;
  font-size: 1rem;
  padding: 0;
}

/* Layout Controls */
.site-header__controls {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.layout-toggle-btn {
  display: none;
  /* Hidden by default (mobile/tablet) */
  background: red;
  color: white;
  border: 2px solid white;
  padding: 8px 16px;
  font-family: 'Coda', cursive;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.layout-toggle-btn:hover {
  background: white;
  color: red;
  border-color: red;
}

@media only screen and (min-width: 1025px) {
  .layout-toggle-btn {
    display: inline-block;
  }
}

/* Movies Grid (Organism) */
.movies {
  position: relative;
  left: 0;
  width: 98vw;
  height: auto;
  display: grid;
  padding-top: 15rem;
  /* Increased padding to clear the fixed header */
  grid-row-gap: 10px;
  grid-column-gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  justify-items: center;
  margin: 0 auto;
}

/* Horizontal Layout (Toggled on Desktop) */
@media only screen and (min-width: 1025px) {
  body.layout-horizontal .movies {
    position: absolute;
    display: block;
    top: 15vh;
    /* Reduced from 30vh */
    left: -100vh;
    width: 85vh;
    /* Increased width (which is viewport height) to allow more vertical room */
    height: 120vw;
    margin: 0;
    padding-top: 70vw;
    overflow-y: auto;
    overflow-x: hidden;
    transform: rotate(-90deg) translateY(-80px);
    transform-origin: right top;
  }
}

.movies:hover .movie-card__number:not(:hover) {
  opacity: 0.5;
}

.movie-phase {
  font-family: 'Coda', cursive;
  text-transform: uppercase;
  font-weight: 800;
  color: red;
  font-size: 1.5rem;
  padding: 20px 0;
  margin-top: 0;
  border-bottom: 1px dashed red;
  text-align: center;
}

@media only screen and (min-width: 1025px) {
  body.layout-horizontal .movie-phase {
    transform: rotate(0deg) translateY(-595px);
    transform-origin: left top;
  }

  body:not(.layout-horizontal) .movie-phase {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media only screen and (max-width: 1024px) {
  .movie-phase {
    display: contents;
    place-self: center;
  }
}

/* Movie Card (Molecule/Organism) */
.movie-card {
  position: relative;
  box-sizing: border-box;
  padding: 20px 0;
  border-bottom: 6px solid red;
  width: fit-content;
  margin: 0 auto;
}

@media only screen and (min-width: 1025px) {
  body.layout-horizontal .movie-card {
    padding: 20px 125px;
  }
}

@media only screen and (min-width: 1025px) {
  body.layout-horizontal .movie-card {
    transform: rotate(90deg);
    transform-origin: right top;
  }
}

.movie-card__number {
  transition: opacity 0.2s;
}

.movie-card__poster {
  width: 320px;
  height: 500px;
  border-radius: 15px;
  border: 1px solid black;
  display: flex;
  flex-direction: column-reverse;
  background-size: cover;
  box-shadow: 0 0 10px 0 rgba(255, 227, 170, 0.3);
}

@media only screen and (max-width: 500px) {
  .movie-card__poster {
    width: 100vw;
    height: 500px;
  }
}

.movie-card__summary {
  position: relative;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  width: 100%;
  padding: 10px;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.movie-card__title {
  font-family: 'Coda', cursive;
  text-transform: uppercase;
  font-weight: 800;
  color: white;
  font-size: 1rem;
  padding: 10px;
  margin: 0;
}

.movie-card__year {
  text-shadow: 0 2px white;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: right;
  padding: 10px;
  margin: 0 20px 0 0;
}

.movie-card__link {
  font-size: 1rem;
  font-weight: normal;
  padding: 10px;
  margin: 0;
}

.movie-card__number {
  color: white;
  font-family: 'Coda', cursive;
  font-weight: bold;
  padding: 20px 24px;
  background: red;
  position: relative;
  left: 0;
  top: 43px;
  border-top-left-radius: 14px;
}

.movie-card__watched-checkbox {
  display: none;
}

.movie-card__watched-label {
  position: absolute;
  top: 10px;
  right: 13px;
  z-index: 1;
  cursor: pointer;
  display: inline-block;
  padding: 5px 10px;
  background-color: #333;
  color: white;
  border-radius: 5px;
}

.movie-card__watched-checkbox:checked+.movie-card__watched-label {
  background-color: #5cb85c;
}

.movie-card__watched-checkbox:checked~.movie-card__poster {
  filter: grayscale(100%);
}