/* General Styles */
body {
  font-family: Arial, sans-serif;
  background-color: #121212;
  color: #f4f4f4;
  margin: 0;
  padding: 0;
}

/* Header with navigation options */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.nav-options {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.nav-btn.active {
  background: #00d4ff;
  color: #121212;
}

.nav-btn:hover {
  background: #00a6cc;
}

.search-icon {
  font-size: 18px;
  background: none;
  border: 1px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-icon:hover {
  background: #00a6cc;
}

/* Search Modal */
#search-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

#search-modal .modal-content {
  position: relative;
  background: #1e1e1e;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#search-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.search-btn {
  background: #00d4ff;
  color: #121212;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

.search-btn:hover {
  background: #00a6cc;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  justify-content: center;
}

.card h3 {
  font-size: 12px; /* Make the text smaller */
  color: #fff;
  line-height: 1.2;
  height: 2.4em; /* Enough space for two lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}


.card {
  background: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.thumbnail {
  position: relative;
}

.thumbnail img {
  width: 100%; /* Ensures the image fills the container width */
  height: 150px; /* Fixed height for uniformity */
  object-fit: cover; /* Ensures the image is cropped proportionally */
  border-radius: 5px; /* Optional: rounded corners for a cleaner look */
}

.thumbnail .time {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.page-link {
  background: #00d4ff;
  color: #121212;
  border: none;
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
}

.page-link:hover {
  background: #00a6cc;
}

.page-link:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Modal Styles */
.modal {
  display: none; /* Ensure the modal is hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  /* Remove 'display: flex;' from here */
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  width: 80%;
  max-width: 900px;
  background-color: #121212; /* Dark background */
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.close {
  position: absolute;
  top: 1px;
  right: 1px;
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

iframe {
  width: 100%;
  height: 460px;
  border: none;
}

/* Pagination Container */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

/* Page Buttons */
.page-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin: 0 5px; /* Space between page buttons */
}

.page-btn:hover {
  background: #00a6cc;
}

.page-btn.active {
  background: #00d4ff;
  color: #121212;
}

/* Navigation Buttons (Previous, Next) */
button {
  background: #00d4ff;
  color: #121212;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #00a6cc;
}

button:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header {
    flex-direction: column; /* Stack the header content */
    align-items: stretch;
  }

  .nav-options {
    justify-content: center; /* Center navigation buttons */
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
    gap: 5px; /* Reduce gap between buttons */
  }

  .nav-btn {
    padding: 6px 10px; /* Reduce padding for navigation buttons */
    font-size: 14px; /* Adjust font size */
  }

  .search-icon {
    width: 35px;
    height: 35px;
    font-size: 16px; /* Adjust icon size */
  }

  #search-input {
    padding: 8px; /* Reduce padding in search input */
    font-size: 14px; /* Adjust font size */
  }

  .search-btn {
    padding: 8px 15px; /* Reduce padding for search button */
    font-size: 14px; /* Adjust font size */
  }

  .search-container {
    flex-direction: column; /* Stack search input and button */
    gap: 5px; /* Reduce gap between elements */
  }

  .search-container #search-input,
  .search-container .search-btn {
    width: 100%; /* Full width for inputs and buttons */
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .modal-content {
    width: 95%;
  }

  iframe {
    height: 300px;
  }

  .page-link {
    padding: 8px 15px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .header {
    flex-direction: column; /* Stack the header content */
    align-items: center;
  }

  .nav-options {
    gap: 5px; /* Reduce gap further */
    flex-wrap: wrap; /* Ensure wrapping for very small screens */
  }

  .nav-btn {
    padding: 5px 8px; /* Further reduce padding for buttons */
    font-size: 12px; /* Smaller font for compact look */
  }

  .search-icon {
    width: 30px; /* Smaller search icon */
    height: 30px;
    font-size: 14px; /* Adjust icon font size */
  }

  #search-input {
    font-size: 12px; /* Smaller font for input */
    padding: 6px; /* Compact padding */
  }

  .search-btn {
    font-size: 12px; /* Smaller font for search button */
    padding: 6px 10px; /* Compact padding */
  }

  .search-container {
    flex-direction: column; /* Ensure stacked layout */
    gap: 5px;
  }

  .search-container #search-input,
  .search-container .search-btn {
    width: 100%; /* Full width for better usability */
  }
  
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .thumbnail .time {
    font-size: 10px;
    padding: 3px 5px;
  }

  .modal-content {
    padding: 15px;
  }

  .close {
    font-size: 24px;
  }

  iframe {
    height: 250px;
  }
}