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

:root {
  --forest-green: #0fa35a;
  --dark-bg: #071014;
  --darker-bg: #0b0b0b;
  --grey: #aaaaaa;
  --light-grey: #cccccc;
  --white: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #071014 0%, #0b0b0b 50%, #071014 100%);
  background-attachment: fixed;
  color: var(--white);
  min-height: 100vh;
  padding-bottom: 80px;
}

.header {
  background: rgba(7, 16, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 163, 90, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(15, 163, 90, 0.1);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--forest-green);
  text-decoration: none;
  text-shadow: 0 0 20px rgba(15, 163, 90, 0.5);
  white-space: nowrap;
}

.search-form {
  flex: 1;
  max-width: 500px;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(15, 163, 90, 0.3);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--forest-green);
  box-shadow: 0 0 20px rgba(15, 163, 90, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.search-btn {
  padding: 0.75rem 1.25rem;
  background: var(--forest-green);
  border: none;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #0d8a4d;
  box-shadow: 0 0 20px rgba(15, 163, 90, 0.5);
  transform: translateY(-2px);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  color: var(--grey);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--forest-green);
  background: rgba(15, 163, 90, 0.1);
}

.nav-link.active {
  color: var(--forest-green);
  background: rgba(15, 163, 90, 0.15);
  box-shadow: 0 0 20px rgba(15, 163, 90, 0.3);
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1200px) {
  .grid {
    display: flex;           /* use flex instead of grid */
    flex-direction: row;     /* horizontal layout */
    overflow-x: auto;        /* allow horizontal scroll */
    gap: 1rem;
    padding-bottom: 0.5rem;
  }

  .grid::-webkit-scrollbar {
    display: none;           /* hide scrollbar */
  }

  .card {
    flex: 0 0 auto;          /* prevent shrinking */
    width: 140px;            /* adjust width as needed */
  }
}

@media (max-width: 768px) {
  .grid {
    display: flex;           /* use flex instead of grid */
    flex-direction: row;     /* horizontal layout */
    overflow-x: auto;        /* allow horizontal scroll */
    gap: 1rem;
    padding-bottom: 0.5rem;
  }

  .grid::-webkit-scrollbar {
    display: none;           /* hide scrollbar */
  }

  .card {
    flex: 0 0 auto;          /* prevent shrinking */
    width: 140px;            /* adjust width as needed */
  }
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--white);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 10px 40px rgba(15, 163, 90, 0.4);
  border-color: var(--forest-green);
}

.card-poster {
  position: relative;
  width: 100%;
  padding-top: 150%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
}

.card-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-poster img {
  transform: scale(1.1);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 163, 90, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.no-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 163, 90, 0.1);
  color: var(--grey);
}

.card-info {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-overview {
  font-size: 0.85rem;
  color: var(--grey);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--forest-green);
  font-weight: 600;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 16, 20, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 163, 90, 0.2);
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(15, 163, 90, 0.1);
}

.footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.footer-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--grey);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.footer-link:hover {
  color: var(--forest-green);
  background: rgba(15, 163, 90, 0.1);
}

.footer-link.active {
  color: var(--forest-green);
  background: rgba(15, 163, 90, 0.15);
  box-shadow: 0 0 20px rgba(15, 163, 90, 0.5);
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .header-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .header-container {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .search-form {
    max-width: 100%;
  }

  .main-content {
    padding: 1rem;
  }
}