.header,
.footer {
  padding: 1rem 2rem;
  background-color: var(--surface-color);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, opacity 0.2s;
  opacity: 0.7;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  opacity: 1;
}

.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: start;
}

.movies-section {
  width: 100%;
}

.sidebar {
  background-color: var(--surface-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  width: 100%;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 1rem;
}

.filters-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer {
  margin-top: 2rem;
  text-align: center;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .movies-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
  }
}

@media (max-width: 480px) {
  .movies-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .movie-card {
    max-width: 260px;
    width: 100%;
  }
}