/* ========== Global Reset ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #131720;
  font-family: 'Ubuntu', system-ui, sans-serif;
  color: #fff;
  line-height: 1.6;
}

/* ========== Typography ========== */
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: inherit;
}

/* ========== Header Navigation ========== */
.topnav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #131720;
  padding: 16px 20px;
}

.logo {
  font-size: 1.3rem;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
}

/* ========== Search Form ========== */
.search-container {
  display: flex;
  align-items: center;
  background-color: #151f30;
  border-radius: 12px;
  height: 44px;
  width: 100%;
  padding: 0 12px;
  max-width: 100%;
}

.search-container input {
  all: unset;
  color: #fff;
  font-size: 15px;
  width: 100%;
}

.search-container button {
  all: unset;
  font-size: 18px;
  cursor: pointer;
  padding-left: 10px;
  color: #fff;
}

/* ========== Movie Section ========== */
.movie-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
  max-width: 100%;
}

/* ========== Movie Card ========== */
.card {
  background-color: #1a1f2e;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.card:hover {
  background-color: #232a3d;
  transform: translateY(-5px);
  cursor: pointer;
}

.thumbnail {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.card-content h3 {
  margin-top: 0;
}

/* ========== Skeleton Card ========== */
.card.skeleton {
  background-color: #1a1f2e;
  animation: pulse 1.5s infinite ease-in-out;
  cursor: default;
  pointer-events: none;
}

.card.skeleton div:first-child {
  height: 240px;
  background-color: #2a2f40;
}

.card.skeleton h3 {
  height: 1em;
  background-color: #33394f;
  width: 80%;
  border-radius: 4px;
}

@keyframes pulse {
  0% {
    background-color: #1c1f2a;
  }
  50% {
    background-color: #2c3145;
  }
  100% {
    background-color: #1c1f2a;
  }
}

/* ========== Rating Badge ========== */
.rating {
  font-size: 0.85rem;
  background-color: #00adb5;
  color: #000;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: bold;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 30px 0;
  padding: 0 16px;
  flex-wrap: wrap;
}

.pagination button {
  background: linear-gradient(to right, #1c2230, #2a3346);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-size: 0.95rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
  background: #324155;
  transform: scale(1.05);
}

.pagination button:disabled {
  background: #333;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========== Loading/Error/Empty State ========== */
.status-message {
  text-align: center;
  font-size: 1rem;
  padding: 20px;
  color: #aaa;
}

.status-message.error {
  color: #f44336;
}

.status-message.empty {
  color: #ffc107;
}

/* ========== Responsive Layout ========== */
@media (max-width: 480px) {
  .pagination {
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;
  }

  .pagination button {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }
}

@media (min-width: 600px) {
  .topnav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .search-container {
    max-width: 300px;
  }
}

@media (min-width: 768px) {
  .card {
    flex: 0 0 45%;
  }
}

@media (min-width: 1024px) {
  .movie-section {
    max-width: 1200px;
    margin: 0 auto;
  }

  .card {
    flex: 0 0 22%;
  }
}

/* ========== Utility Classes ========== */
.hidden {
  display: none !important;
}
