/* Global Styles */
:root {
  --bg-color: #f9f9f9;
  --text-color: #222;
  --card-bg: #ffffff;
  --accent-color: #0077b6;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

/* Header */
header {
  background: var(--accent-color);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
}

#theme-toggle {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: white;
  color: var(--accent-color);
  font-weight: bold;
}

/* Search Section */
.search-section {
  display: flex;
  justify-content: center;
  padding: 20px;
  gap: 10px;
}

.search-section input {
  padding: 10px;
  width: 300px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: var(--card-bg);
  color: var(--text-color);
}

.search-section button {
  padding: 10px 15px;
  border: none;
  background: var(--accent-color);
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

/* Section Headings */
h2 {
  margin: 20px;
  text-align: left;
  color: var(--text-color);
}

/* Movies Container */
.movies-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
}

.movie-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  text-align: center;
  color: var(--text-color);
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card img {
  width: 100%;
  height: 270px;
  object-fit: cover;
}

.movie-card h3 {
  padding: 10px;
  font-size: 16px;
}

/* Favorite Button */
.favorite-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform 0.2s ease;
  color: var(--text-color);
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.favorite-btn.active {
  color: red;
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  max-width: 600px;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
}

#close-modal {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 20px;
  cursor: pointer;
}

/* Loading Spinner */
.loading {
  text-align: center;
  font-size: 18px;
  margin: 20px;
  color: var(--text-color);
}

.hidden {
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
