/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #0d0d1a;
  color: #eee;
  min-height: 100vh;
}

/* HEADER */
header {
  background: #12122a;
  border-bottom: 2px solid #e50914;
  padding: 16px 24px;
}

header h1 {
  font-size: 26px;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

header h1 span {
  color: #e50914;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#searchInput {
  padding: 9px 14px;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1e1e38;
  color: #fff;
  width: 280px;
  outline: none;
}

#searchInput:focus {
  border-color: #e50914;
}

#searchInput::placeholder {
  color: #888;
}

button {
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  background: #e50914;
  color: white;
  border: none;
  border-radius: 4px;
}

button:hover {
  background: #c40812;
}

select {
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1e1e38;
  color: #eee;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: #e50914;
}

/* MAIN GRID */
main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  padding: 28px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* MOVIE CARD */
.movie-card {
  background: #1a1a2e;
  border: 1px solid #2a2a44;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.movie-card:hover {
  border-color: #e50914;
}

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

.card-info {
  padding: 10px;
}

.card-info h3 {
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info p {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  text-transform: capitalize;
}

.card-info button {
  width: 100%;
  padding: 7px;
  font-size: 12px;
  background: #e50914;
  border-radius: 4px;
}

.card-info button.added {
  background: #1a6e35;
  border: 1px solid #28a745;
}

/* EMPTY MSG */
#emptyMsg {
  text-align: center;
  padding: 60px;
  color: #666;
  font-size: 16px;
}

/* OVERLAY PANELS */
#watchlistPanel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#watchlistBox {
  background: #12122a;
  border: 1px solid #2a2a44;
  border-radius: 10px;
  padding: 24px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

#watchlistBox h2 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 16px;
}

#closeWatchlist {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #2a2a44;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 4px;
}

#closeWatchlist:hover {
  background: #e50914;
}

/* WATCHLIST ITEMS */
.watchlist-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #2a2a44;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #1a1a2e;
}

.watchlist-item:hover {
  border-color: #e50914;
}

.watchlist-item img {
  width: 44px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.watchlist-item-info {
  flex: 1;
}

.watchlist-item-info h4 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 2px;
}

.watchlist-item-info p {
  font-size: 12px;
  color: #888;
}

.remove-btn {
  background: #6e1a1a;
  border: 1px solid #e50914;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
}

.remove-btn:hover {
  background: #e50914;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #555;
  border-top: 1px solid #1e1e38;
  margin-top: 24px;
}

footer a {
  color: #e50914;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* UTILITY */
.hidden {
  display: none !important;
}