.app-container {
  min-height: 100vh;
  position: relative;
}

.content-rows {
  margin-top: -50px;
  position: relative;
  z-index: 10;
  padding-bottom: 10px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background-color 0.3s ease;
}

.navbar.scrolled {
  background-color: var(--navbar-bg);
  backdrop-filter: blur(10px);
}

.navbar-left {
  flex: 1;
}

.navbar-brand {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

.navbar-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex: 2;
}

.navbar-links > * + * {
  margin-left: 20px;
}

.nav-link {
  color: var(--text-light);
  font-size: 0.9rem;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 4px;
  background-color: transparent;
  text-decoration: none;
  font-weight: 500;
}

.nav-link > * + * {
  margin-left: 5px;
}

.nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  color: #e5e5e5;
  transition: color 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
}

.nav-icon:hover {
  color: white;
  transform: scale(1.1);
}

.navbar-right {
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.navbar-right > * + * {
  margin-left: 20px;
}

/* Hero Section */
.hero {
  height: 80vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(20, 20, 20, 0.7) 0%, rgba(20, 20, 20, 0.2) 50%, rgba(20, 20, 20, 0.7) 100%),
    linear-gradient(to top, var(--bg-color) 0%, transparent 15%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;

}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-description {
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 30px;
  color: #e5e5e5;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-buttons {
  display: flex;
  gap: 15px;
}

.hero-buttons > * + * {
  margin-left: 15px;
}

.btn {
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, background-color 0.2s;
}

.btn > * + * {
  margin-left: 10px;
}

.btn:hover {
  transform: scale(1.05);
}

.btn-play {
  background-color: white;
  color: black;
}

.btn-play:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.btn-info {
  background-color: rgba(109, 109, 110, 0.7);
  color: white;
}

.btn-info:hover {
  background-color: rgba(109, 109, 110, 0.4);
}

/* Row Component */
.row {
  margin-left: 10px;
  margin-top: 10px;
}

.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-right: 40px;
}

.row-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e5e5e5;
  margin-bottom: 0;
}

.row-arrows {
  display: flex;
  gap: 10px;
}

.row-arrow {
  cursor: pointer;
  color: white;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.row-arrow:hover {
  opacity: 1;
  transform: scale(1.2);
}

.row-poster-container {
  position: relative;
  margin-right: 15px;
  cursor: pointer;
  transition: transform 450ms;
}

.row-poster-container:hover {
  transform: scale(1.08);
  z-index: 5;
}

.row-poster {
  object-fit: cover;
  width: 200px;
  height: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.row-poster.aspect-16-9 {
  width: 300px;
  height: 168px;
  /* 16:9 ratio */
}

span.video-item-content {
  background: linear-gradient(60deg, #f44336, #ff8c00) !important;
  bottom: 0;
  color: #ffffff;
  font-size: 14px;
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  width: auto;
  padding: 8px 10px;
  line-height: 18px;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  display: block;
  z-index: 2;
  opacity: 0;
  transition: all .5s ease-out;
}

.row-poster-container:hover span.video-item-content,
.grid-poster-container:hover span.video-item-content {
  opacity: 1;
}

.hover-icons {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 15px;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.hover-icons > * + * {
  margin-left: 15px;
}

.row-poster-container:hover .hover-icons,
.grid-poster-container:hover .hover-icons {
  opacity: 1;
}

.icon-btn-hover {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid white;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.icon-btn-hover:hover {
  transform: scale(1.1);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.language-tag {
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--primary-color);
  color: white;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: bold;
  border-bottom-right-radius: 6px;
  z-index: 100; /* Extremely high z-index */
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: 6px;
  z-index: 1;
}

.locked-icon-container {
  position: absolute;
  top: 1px;
  right: 10px;
  background-color: var(--primary-color);
  border-radius: 50%;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.row-posters {
  display: flex;
  overflow-y: hidden;
  overflow-x: scroll;
  padding: 10px 0;
  scroll-behavior: smooth;
}

.row-posters::-webkit-scrollbar {
  display: none;
}

.row-poster-container:hover .row-poster {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Video Player Overlay */
.video-player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 40px;
  background: none;
  color: white;
  font-size: 3rem;
  z-index: 1001;
  opacity: 0.7;
}

.close-btn:hover {
  opacity: 1;
}

.video-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Image Enhancements */
.row-poster,
.grid-poster,
.related-img,
.episode-img {
  transition: filter 0.3s ease, transform 0.3s ease !important;
  image-rendering: -webkit-optimize-contrast;
}

.row-poster-container:hover .row-poster,
.grid-poster-container:hover .grid-poster,
.related-card:hover .related-img,
.episode-card:hover .episode-img {
  filter: brightness(1.1) contrast(1.1);
}

/* --- Mobile Responsiveness and Bottom Navigation --- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .app-container {
    padding-bottom: 75px; /* Leave space for bottom navigation bar */
  }

  .navbar {
    padding: 12px 15px;
  }

  .navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .navbar-right {
    gap: 10px;
  }

  .navbar-right > * + * {
    margin-left: 0;
  }

  .nav-icon {
    padding: 5px;
  }

  /* Bottom Navigation Styling */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bottom-nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--card-border);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 5px 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    gap: 4px;
    flex: 1;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .mobile-nav-item > * + * {
    margin-top: 4px;
  }

  .mobile-nav-item.active {
    color: var(--primary-color);
  }

  .mobile-nav-item:hover {
    color: var(--text-color);
  }

  /* Hero adjustments for portrait screens */
  .hero {
    height: 52vh;
    padding: 0 15px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 18px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.95rem;
  }

  /* Row and Poster adjustments */
  .row {
    margin-left: 15px;
    margin-top: 15px;
  }

  .row-header {
    margin-bottom: 10px;
    padding-right: 15px;
  }

  .row-title {
    font-size: 1.15rem;
  }

  .row-arrows {
    display: none !important; /* Hide arrows on touch screens */
  }

  .row-poster {
    width: 120px;
    height: 180px;
  }

  .row-poster.aspect-16-9 {
    width: 180px;
    height: 101px; /* 16:9 ratio */
  }

  .grid-poster.aspect-16-9 {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  span.video-item-content {
    font-size: 10px;
    padding: 4px 6px;
    line-height: 14px;
  }

  /* Force overlay visibility on mobile devices */
  .grid-poster-container span.video-item-content,
  .row-poster-container span.video-item-content,
  .related-img-container span.video-item-content {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #ffffff !important;
  }

  .locked-icon-container {
    padding: 4px;
    right: 5px;
    top: 1px;
  }

  .language-tag {
    padding: 2px 5px;
    font-size: 0.6rem;
  }
}