/* Reset & Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0d0d0d;
  color: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
.top-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #111;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  height: 40px;
}

.search-container {
  flex: 1;
  text-align: right;
}

.search-container input {
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  width: 220px;
  background-color: #222;
  color: white;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 20px;
}

.movie {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.2s;
}

.movie img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

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

.movie .overlay {
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  width: 100%;
  padding: 8px;
  text-align: center;
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
}

.modal-content {
  background-color: #1a1a1a;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #333;
  width: 90%;
  max-width: 500px;
  border-radius: 10px;
  color: #fff;
  position: relative;
}

.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 28px;
  cursor: pointer;
}

#watchNow {
  background-color: #e50914;
  color: white;
  padding: 10px 20px;
  margin-top: 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
}

#watchNow:hover {
  background-color: #f40612;
}

/* Player Container */
#playerContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #000;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

#playerContainer iframe {
  flex: 1;
}

#playerContainer button {
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 1000;
  background: #e50914;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

#playerContainer button:hover {
  background-color: #f40612;
}

/* Loading & Error */
.loading, .error {
  text-align: center;
  padding: 20px;
  font-size: 18px;
}
