:root{
  --primary-color: #026A90;
  --secondary-color: lightgray;


}

*{
  box-sizing: border-box;
}

body {
  background-color: var(--secondary-color);
  margin: 0;
  font-family: sans-serif;
} 

header {
  padding: 1rem;
  background-color: var(--primary-color);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

button {
  font-family: inherit;
}

.header-buttons {
  display: flex;
  gap: 0.5rem;
}

.header-buttons button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.header-buttons button:hover {
  transform: translateY(-1px);
  background-color: #f0f0f0;
}

.header-buttons button:active {
  transform: scale(0.97);
}

#form {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search {
  width: 100%;
  max-width: 400px;
  background-color: transparent;
  border: 2px solid var(--secondary-color);
  border-radius: 50px;
  font-size: 1rem;
  padding: 1rem;
  color: white;
}

.search::placeholder {
  color: white;
}

.search:focus {
  outline: none;
}

main {
  display: block;
}

#main, #favorites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  padding: 1rem 2rem;
  margin: 0;
  align-items: start;
}


.movie {
  /* width: 300px; */
  background-color: var(--primary-color);
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.2);
  position:relative;
  overflow: hidden;
  border-radius: 3px;
}

.movie img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  display: block;
}

.movie-info {
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 0.5rem 1rem 1rem; 
  letter-spacing: 1px;
}

.movie-info span {
  background-color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-weight: bold;
}

.movie-info span.green {
  color: lightgreen;
}

.movie-info span.orange {
  color: orange;
}

.movie-info span.red {
  color: red;
}

.overview {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 2rem;
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  max-height: 100%;
  transform: translateY(101%);
  transition: transform 0.3s ease;
}

.movie:hover .overview {
  transform: translateY(0);
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 50%;
}

section {
  width: 100%;
}

.section-title {
  color: var(--primary-color);
  text-align: center;
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  color: red;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  border-radius: 50%;
}


.empty-favorites {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 2rem;
  color: var(--primary-color);
  background: white;
  border-radius: 10px;
  margin: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  grid-column: 1 / -1;   /* span full width of grid */
  justify-self: center;  /* center horizontally */
}

.empty-favorites p {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.empty-favorites span {
  font-size: 1rem;
  color: #555;
}


.active-favorites {
  background: rgba(2, 106, 144, 0.05);
  border-radius: 10px;
  transition: 0.3s ease;
}


body.dark {
  --primary-color: #121212;
  --secondary-color: #1e1e1e;
}

body.dark .movie-info span {
  background-color: #333;
  color: white;
}

body.dark .search {
  border-color: #555;
}

#theme-toggle {
  font-weight: 700;
  background-color: #222;
  color: white;
}

body.dark #theme-toggle {
  background-color: white;
  color: #121212;
}

body.dark .section-title {
  color: white;
}

body.dark .overview {
  background-color: #2a2a2a;
  color: white;
}

@media (max-width: 768px) {
  #main, #favorites {
    justify-content: center;
    margin: 0;
    gap: 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
  }

  .header-buttons {
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  #main, #favorites {
    padding: 2rem 4rem;
  }
}