 @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
 * {
    box-sizing: border-box;
  }
  html {
    --light-mode-1:#FAFAFA;
    --light-mode-2:#F2F2F7;
    --light-mode-3:#EAEAEA;
    --light-mode-4:#D6D6D6;
    --light-mode-5:#BFBFBF;
    --dark-mode-1:#121212;
    --dark-mode-2:#888888;
    --dark-mode-3:#444444;
    --dark-mode-4:#B0B0B0;
    --dark-mode-5:#E0E0E0;
    --tmdb-darkblue: #0d253f;
    --tmdb-green:#90cea1;
    --tmdb-blue: #01b4e4;
    scroll-behavior: smooth;

}
  body {
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: "Open Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
    font-variation-settings:
    "wdth" 100;
    margin: 0;
    padding: 0;
    background-color: var(--light-mode-3);
    color: var(--dark-mode-1);
}
body.dark-mode {
    background-color: var(--dark-mode-1);
    color: var(--light-mode-5);
}
.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--light-mode-3);
    flex-wrap: wrap; 
}
/* Search */
header {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    margin-right: 10rem;
}
form {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}
.search {
    background-color: var(--light-mode-1);
    border: 2px solid var(--tmdb-darkblue);
    border-radius: 50px;
    font-size: 1rem;
    padding: .5rem 1rem;
    color: var(--tmdb-darkblue);
    width: 320px;
}
body.dark-mode .search {
  background-color: var(--tmdb-darkblue);
  border: 2px solid var(--tmdb-blue);
  color: var(--tmdb-blue);
}
.search::placeholder {
    color: var(--tmdb-darkblue);
}
body.dark-mode .search::placeholder {
  color: var(--tmdb-blue);
}
.search:focus {
    outline: none;
    background-color: var(--light-mode-1);
}
body.dark-mode .search:focus {
  background-color: var(--tmdb-darkblue);
}
/* Toggle Switch */
.theme-toggle {
    position: absolute;
    top: 20px;
    left: 100px;
}
.toggle-label {
    display: inline-block;
    width: 50px;
    height: 25px;
    background-color: var(--tmdb-darkblue);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.toggle-label .glider {
    width: 23px;
    height: 23px;
    background-color: var(--light-mode-1);
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: left 0.3s ease;
}
#themeSwitch {
    display: none; /* Hide the checkbox input */
}
#themeSwitch:checked + .toggle-label {
    background-color: var(--tmdb-blue);  
}
#themeSwitch:checked + .toggle-label .glider {
    left: 25px;
    background-color: var(--tmdb-darkblue);
}
/* LOGO */
.logo-container {
    position: absolute;
    top: 2px;
    left: 20px;
}
.logo-container img {
    width: 60px; 
    height: auto;
}
/*RESULTS*/
#results-count {
  text-align: center;
  font-size: 1.2rem;
  margin: 1rem 0;
  color: var(--tmdb-blue);
}
body.dark-mode #results-count {
 color: var(--tmdb-blue);
}
#results-count p {
  background-color: var(--light-mode-1);
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
body.dark-mode #results-count p {
  background-color: var(--tmdb-darkblue);
}
.total-count {
  color: var(--tmdb-darkblue); 
  font-weight: bold;
}
body.dark-mode .total-count {
  color: var(--light-mode-3);
}
.search-term {
  color: var(--tmdb-darkblue); 
  font-weight: bold;
}
body.dark-mode .search-term {
  color: var(--light-mode-3);
}
/* MAIN */
main {
    display: flex;
    flex-wrap: wrap;
    padding: 100px;
    padding: 2rem;
    margin: 0 auto; 
    justify-content: center;    
}
.movie {
    width: 300px;
    margin: 1rem;
    background-color: var(--light-mode-3);
    box-shadow: 0 4px 5px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    }
body.dark-mode .movie {
  background-color: var(--tmdb-darkblue);
}
.movie img {
    width: 100%;  
}
.movie-info {
    color: var(--tmdb-darkblue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem 1rem 2rem;
    letter-spacing: 0.5px;
}
body.dark-mode .movie-info {
  color: var(--tmdb-blue);
}
.movie-info h3 {
    margin-top: 0;
    font-family: "Ubuntu", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 1.4rem;
}
.movie-info span {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: bold;
    font-size: 1.4rem;
}
.movie-info span.green {
    color: var(--tmdb-green)
} 
.movie-info span.orange {
    color: var(--tmdb-blue)
}
.movie-info span.red {
    color: red;
}
.overview {
    background-color: var(--light-mode-3);
    color: var(--tmdb-darkblue);
    padding: 2rem;
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    max-height: 100%;
    transform: translateY(101%);
    transition: transform 0.3s ease-in;
}
body.dark-mode .overview {
   background-color: var(--tmdb-darkblue);
   color: var(--tmdb-blue);
}
.movie:hover .overview{
    transform:translateY(0);
}
/* SPINNER */
.img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3; /* keeps height consistent for posters */
  background-color: var(--light-mode-3); 
  display: flex;
  align-items: center;
  justify-content: center;
}
body.dark-mode .img-wrapper {
    background-color: var(--tmdb-darkblue);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--tmdb-darkblue);
  border-top-color: var(--tmdb-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
body.dark-mode .spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--tmdb-blue);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.img-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-family: "Ubuntu", sans-serif;
  font-weight: 700;
  font-style: normal;
}
.page-btn {
  border: 1px solid var(--tmdb-blue);
  background-color: var(--light-mode-1);
  color: var(--tmdb-blue);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s ease;
}
body.dark-mode .page-btn {
  background-color: var(--tmdb-darkblue);
  border: 1px solid var(--tmdb-blue);
}
.page-btn:hover:not(:disabled) {
  background-color: var(--light-mode-3);  
}
.page-btn.current {
  background-color: var(--tmdb-darkblue);
  color: var(--tmdb-blue);
  font-weight: bold;
  cursor: default;
}
body.dark-mode .page-btn.current{
  background-color: var(--tmdb-blue);
  color: var(--tmdb-darkblue);
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--light-mode-3);
}
.dots {
  font-size: 16px;
  color: var(--tmdb-blue);
  padding: 0 6px;
}
/* ABOUT */
.about-container {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  text-align: center; 
}
.about-content {
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--tmdb-blue);
  font-size: 1.4rem;
}
.about-logo,
.about-text {
  flex: 1 1 45%; /* take roughly 50% width with some flexibility */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  min-width: 200px; 
  min-height: 150px; 
}
.about-logo img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: contain;
  display: block; 
}
/* FOOTER */
.footer {
    /* position: fixed; */
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.footer-content p {
    margin: 5px 0;
    font-size: 1rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}
.footer-content a {
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-content a:hover {
    text-decoration: underline;
}
/* Icon Styles */
.heart-icon i {
    transition: color 0.3s ease;
}
.copyright-icon i {
    transition: color 0.3s ease;
}
.year {
    color: var(--tmdb-blue);
}
/* Light Mode */
body.light-mode .footer {
    background-color: var(--light-mode-3);
    color: var(--tmdb-darkblue);
}
body.light-mode .footer-content a {
    color: var(--tmdb-blue);
}
body.light-mode .heart-icon i {
    color: var(--tmdb-blue);
}
/* Dark Mode */
body.dark-mode .top-bar {
    background-color: var(--dark-mode-1);
}
body.dark-mode .footer {
    background-color: var(--dark-mode-1);
    color: var(--tmdb-blue);
}
body.dark-mode .footer-content a {
    color: var(--light-mode-5);
}
body.dark-mode .heart-icon i {
    color: var(--light-mode-5);
}
body.dark-mode .year {
    color: var(--light-mode-5);
}
/* COOKIE */
.cookie-popup {
    font-size: 0.8rem;
    position: fixed;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    background-color: var(--tmdb-darkblue);
    color: var(--tmdb-blue);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    display: none;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    z-index: 1000;
  }
  .cookie-popup.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
  }
  
  .cookie-popup p {
    margin-bottom: 20px;
  }
  .cookie-popup button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  .accept-button {
    background-color: #45a049;
    color: var(--tmdb-darkblue);
  }
  .accept-button:hover {
    background-color: var(--tmdb-green); 
}
  .decline-button {
    background-color: red;
    color: var(--tmdb-darkblue);
  }
  .decline-button:hover {
    background-color: #e53935;     
}
  /* Cookie Dark Mode */
body.dark-mode .cookie-popup {
    background-color: var(--tmdb-blue);
    color: var(--tmdb-darkblue)
}
body.dark-mode .accept-button {
    background-color: #45a049;
    color: var(--tmdb-darkblue);
}
body.dark-mode .accept-button:hover {
    background-color: var(--tmdb-green);
}
body.dark-mode .decline-button {
    background-color: red;
    color: var(--tmdb-darkblue);
}
body.dark-mode .decline-button:hover {
    background-color:  #e53935;
    color: #eee;
}
 /* REPSONSIVE */

@media (max-width: 768px) {
    .logo {
        width: 50px; 
    }
    header {
    margin-right: 6rem;
    }
     .about-content {
    flex-direction: column;
  }
  .about-logo,
  .about-text {
    flex: 1 1 100%;
    padding: 10px 0;
  }
  .about-container {
    padding: 0 15px;
  }
}
@media (max-width: 480px) {
    .logo-container {
        left: 8px;
}
    .logo {
        width: 40px; 
    }
    .theme-toggle {
        left: 72px;
    }
     header {
    margin-right: 0;
    }
     .search {
        width: 50%; 
        margin-right: 0.5rem;    
    }
     form {
        justify-content: flex-end; 
    }
    .cookie-popup {
        width: 80%;
      }
}

