:root {
  --primary: #0a0a0a;
  --secondary: #1a1a1a;
  --accent: #e50914;
  --text: #ffffff;
  --font-size: 1.1rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--primary);
  color: var(--text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--font-size);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--text);
  padding: 0.5rem 1rem;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  right: 50%;
  height: 2px;
  background-color: var(--accent);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

nav a:hover {
  color: var(--accent);
}

nav a:hover::after,
nav a.active::after {
  left: 0;
  right: 0;
  opacity: 1;
}

nav a.active {
  color: var(--accent);
}

.search-container {
  display: flex;
  justify-content: center;
  margin: 1rem auto;
  max-width: 600px;
  gap: 0.5rem;
  padding: 0 1rem;
}

#searchInput {
  flex: 1;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 25px 0 0 25px;
  background: var(--secondary);
  color: var(--text);
}

.search-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0 25px 25px 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: #ff0a16;
}

.grid-wrapper {
  overflow-x: auto;
  padding: 0 1rem 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 1.5rem;
  min-width: 1000px;
}

.card {
  background-color: var(--secondary);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  aspect-ratio: 2/3;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
}

.pagination-btn {
  background-color: var(--secondary);
  color: var(--text);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  display: none;
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.page-number {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--secondary);
  transition: all 0.3s ease;
}

.page-number.active,
.page-number:hover {
  background-color: var(--accent);
}

.modal {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  background-color: rgba(0,0,0,0.9);
  z-index: 1000;
}

.modal-content.large {
  position: relative;
  margin: 0 auto;
  padding: 20px;
  width: 90%;
  max-width: 1200px;
  background: var(--primary);
  border-radius: 8px;
  max-height: calc(90vh - 60px);
  overflow-y: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
}

.details-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  min-height: 70vh;
}

.video-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#detailsContent {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.details-poster {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
}

.details-info h2 {
  color: var(--text) !important;
  font-size: 2rem;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  word-break: break-word;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.details-info p {
  margin: 0.8rem 0;
  line-height: 1.5;
}

.server-list {
  margin: 0;
}

.servers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.server-btn {
  background: var(--secondary);
  color: var(--text);
  border: none;
  padding: 0.8rem 1.5rem;
  margin: 0.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.server-btn.active,
.server-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
}

#videoFrame {
  width: 100%;
  height: 75vh;
  min-height: 500px;
  border: none;
  border-radius: 8px;
}

.close {
  position: absolute;
  right: 20px;
  top: 10px;
  color: white;
  font-size: 35px;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .grid {
    min-width: 800px;
  }
}

@media (max-width: 992px) {
  .grid {
    min-width: 600px;
  }
  
  .details-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .grid {
    min-width: 400px;
  }
  
  #videoFrame {
    min-height: 300px;
  }
  
  .modal-content.large {
    padding: 10px;
  }
}

.site-footer {
  background-color: var(--primary);
  color: var(--text);
  padding: 2rem 1rem;
  margin-top: auto;
  border-top: 1px solid var(--secondary);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section p {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.8;
  text-align: justify;
  text-justify: inter-word;
}

.footer-section a {
  color: var(--text);
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-section {
    margin-bottom: 1.5rem;
  }
}
