*, html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /* background-color: #f8f9fa; */
  /* color: #212529; */
}

.container {
  max-width: 960px;
  margin: 3vh auto;
  /* padding: 1em; */


}

.search-container {
    position: relative;


}

  .search-bar {

    position: sticky;
    top: 0px;
    z-index: 1000;

    display: flex;
    /* flex-wrap: wrap; */
    gap: .5em;
    margin-bottom: 2em;
    align-items: center;
    justify-content: center;

    box-shadow: 0px 2px 0px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 10px 10px;

    input[type="text"] {
      flex: 1;
      /* min-width: 250px; */
      padding: 0.75em 1em;
      font-size: 1em;
      border: 1px solid #ccc;
      border-radius: 10px;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      transition: all 0.2s;

      &:focus {
        border-color: #0077ff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.2);
      }


    }
  }

        .clear-btn {
    background-color: #e74c3c;
}

.clear-btn:hover {
    background-color: #c0392b;
}

h1 {
  font-size: 2em;
  text-align: center;
  /* margin-bottom: .5em; */
}

button {
  padding: 0.75em 1.5em;
  font-size: 1em;
  background-color: #0077ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;

  &:hover {
    background-color: #005fcc;
    transform: translateY(-1px);
  }

  &:active {
    transform: scale(0.98);
  }
}

.movie-results {
  /* display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); */
  display: block;
  gap: 1.5em;
  padding: 2em;
}

.movie-card {
  /* background-color: #fff; */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  text-align: center;

  cursor: pointer;

  .movie-info {
        padding: .5em;
  }

  &:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }

  img {
    width: 100%;
    height: 240px;
    object-fit: cover;
  }

  h3 {
    margin: 0.5em 0 0.2em;
    font-size: 1.1em;
  }

  p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 1em;
  }
}

.movie-details {
  background-color: #fff;
  padding: 2em;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);

  img {
    float: left;
    max-width: 200px;
    margin-right: 20px;
    border-radius: 8px;

    margin-bottom: 2vh;
  }



  .movie-info {
    overflow: hidden;
    /* margin-top: 2vh; */


    h2 {
      margin-top: 0;
    }

    p, ul {
      margin: 0.5em 0;
    }

    a {
      color: #0077ff;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }
  }

}


.back-button {
  background-color: #e2e6ea;
  color: #333;
  /* margin-bottom: 20px; */

  &:hover {
    background-color: #d6d8db;
  }
}


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;


}

.iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.35%; 
}

iframe, video {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

.close-button {
  position: fixed;
  top: 10px;
  right: 16px;
  font-size: 28px;
  /* color: white; */
  cursor: pointer;
  z-index: 1001;

  &:hover {
    color: #ccc;
  }
}

.buttons {
    margin-top: 2vh;

    i {

        font-size: 3vh;
    }
}

@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

@media (max-width: 768px) {

    .back-button {
        margin-bottom: 2vh;
    }

  .movie-results {
    /* grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); */
    /* grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); */
    /* padding: 0; */
    padding: 0 1em;
  }

  .movie-card {

    h3 {
      font-size: 1em;
    }
  }

  .movie-details {
    padding: 1em;
    display: grid;
  }

  .buttons {
    position: relative;
    bottom: 0;

    i {
        font-size: 4vh;
    }
    /* display: flex;
    justify-content: space-around;
    right: 0;
    left: 0;
    padding: 2vh 0vh 5vh; */
  }


}

@media screen and (prefers-color-scheme: light) {
    
    body {
        background-color: rgb(247, 247, 247);
        color: #000000;
    }

    .container {

        .search-bar {
            padding: 1em;
            background-color: rgb(247, 247, 247);
        }
    }

    .buttons {
        background-color: rgb(247, 247, 247);
    }

    .movie-card, .movie-details {
        background-color: #ffffff;
        color: #000000;

        
        a {
            color: #0077ff;
        }
    }


}


@media screen and (prefers-color-scheme: dark) {
    
    body {
        background-color: black;
        color: #ffffff;
    }

    .container {

        .search-bar {
            padding: 1em;
            background-color: black;
        }
    }

    .buttons {
        background-color: black;
    }

    .movie-card, .movie-details {
        background-color: #2c2c2c;
        color: #f8f9fa;

        
    
        a {
            color: #0077ff;
        }
    }


}




