.moviespage-main-container {
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  background-position: center;
  padding-right: 40px;
  color: white;
  padding-left: 40px;
  background-image: url("../assets/bg-gradient.png");
  height: calc(100 * var(--vh, 1vh));
  animation: fadeInOut 1s ease-in-out;
}

.sidebar-container-movie {
  position: absolute;
  top: 80px;
  right: 0;
  left: 50;
  z-index: 2;
}

.movies-content-container {
  padding-top: 20px; /* in px: la griglia sotto e' alta 910 e il bilancio deve stare in 1080 (test-scheda 6e) */
  padding-bottom: 30px;
  display: flex;
  width: 100%;
}

.movies-channels-list {
  position: relative; /* nella catena degli offsetParent: portaInVista */
  width: 20%;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  height: 910px; /* come la griglia accanto */
  overflow-y: scroll;
  padding: 10px 15px;
}

.movie-channel-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  color: #e3e2ff;
  cursor: pointer;
  position: relative;
}

.movie-channel-category-name {
  flex: 1;
  text-align: left;
  font-size: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-channel-category-count {
  font-size: 24px;
  text-align: right;
  margin-left: 10px;
}

.movies-cards-list-container {
  width: 80%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-row-gap: 30px;
  grid-column-gap: 22px;
  position: relative;
  justify-content: center;
  /* Esattamente DUE righe: 40 + 400 + 30 + 400 + 40. Dal TV: con calc(81 * var(--vh, 1vh))
     in basso spuntava una striscia della riga successiva. Sul televisore
     la pagina e' 1920x1080 logici: 910 sotto l'intestazione ci sta. */
  height: 910px;
  overflow-y: auto;
  margin-left: 20px;
  /* Spazio interno >= anello (4px) + crescita della scala del fuoco (1.16
     su 250x400: 20px ai lati, 32px sopra e sotto): la griglia scorre e
     taglia cio' che esce dalla scatola della scheda. Dal TV: prima riga
     senza bordo sopra, primi senza il sinistro, ultimi senza il destro. */
  padding: 40px 30px;
  /* Il fuoco porta la scheda INTERA in vista, anello e scala compresi:
     scrollIntoView rispetta scroll-padding (Chrome 69+). Dal TV: in
     seconda riga il bordo inferiore era tagliato dal limite visibile. */
  scroll-padding-top: 40px;
  scroll-padding-bottom: 40px;

  box-sizing: border-box;
}

/* SPAZIO REALE DOPO L'ULTIMA RIGA, dentro il contenuto scorrevole. Dal
   TV: con scrollTop al massimo l'ultima riga finisce esattamente a
   scrollHeight, e l'anello della scheda a fuoco (meta' crescita della
   scala, 32px, piu' l'anello, 4px) sporge sotto di 36px: il padding
   inferiore del contenitore NON entra nello scrollHeight su Chromium 87
   (griglie e flex che scorrono). Un elemento di griglia a tutta
   larghezza, alto quanto serve, si'. Stessa forma in Film e Serie. */
.movies-cards-list-container::after {
  content: "";
  grid-column: 1 / -1;
  height: 40px;
}

.movies-channels-list::-webkit-scrollbar,
.movies-cards-list-container::-webkit-scrollbar {
  display: none;
}
.movies-channels-list,
.movies-cards-list-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.movies-card {
  width: 100%;
  height: 400px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  /* transition: transform 0.1s ease, box-shadow 0.1s ease; */
  z-index: 1;
  transform-origin: center center;
}

.movies-card img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 10px;
}

.movies-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
  height: 0%;
  pointer-events: none;
  /* transition: height 0.3s ease; */
}

.movie-card-bottom-content,
.movie-card-top-content {
  position: absolute;
  opacity: 0;
  transform: translateY(10px);
  /* transition: opacity 0.3s ease, transform 0.3s ease; */
  z-index: 2;
  pointer-events: none;
}

.movie-card-bottom-content {
  left: 0;
  bottom: 3%;
  width: 100%;
  padding: 0 10px;
}

.movie-card-top-content {
  top: 2%;
  right: 5%;
  display: flex;
  flex-direction: column;
}
.movie-card-top-content > * + * {
  margin-top: 10px; /* era gap: 10px (Chromium 84); qui webOS 5 */
}

.movie-card-rating {
  font-size: 20px;
  display: flex;
  width: 30px;
  height: 30px;
  justify-content: center;
  align-items: center;
  background-color: var(--gold);
  border-radius: 6px;
  color: white;
}

.movie-card-heart-icon {
  width: 28px;
  height: 28px;
}

.movies-card-title {
  font-size: 32px;
  white-space: nowrap;
  padding: 0px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
}

.movies-card-description {
  font-size: 16px;
  padding: 0px 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: white;
}

.movies-card:hover,
.movies-card.focused {
  transform: scale(1.16);
  opacity: 1;
  background-color: black;
  /* box-shadow e non outline: sul Chromium 87 del televisore l'outline
     ignora border-radius e sporge agli angoli. L'anello sta FUORI perche'
     l'immagine copre tutta la scatola e uno inset sparirebbe sotto. */
  box-shadow: 0 0 0 4px var(--gold);
  z-index: 10;
  /* transition: all 0.1s ease-in-out; */
}

/* La scheda a fuoco sta SOPRA TUTTO, anche sopra la vicina su cui e'
   fermo il puntatore del Magic Remote (:hover, z-index 10, e piu' avanti
   nel DOM): dal TV la scheda scalata finiva sotto quella di destra. */
.movies-card.focused {
  z-index: 11;
}

.movies-card:hover::after,
.movies-card.focused::after {
  height: 60%;
}

.movies-card:hover .movie-card-bottom-content,
.movies-card.focused .movie-card-bottom-content,
.movies-card:hover .movie-card-top-content,
.movies-card.focused .movie-card-top-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.movie-card-top-content {
  opacity: 1;
}
.movie-card-top-content img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.movie-channel-category:hover {
  background-color: var(--gold);
  color: white;
}

.movie-channel-category-focused {
  background-color: var(--gold) !important;
  color: white !important;
}

.movie-channel-category-active {
  color: var(--gold);
}

.movies-card:nth-child(-n + 5):not(:nth-last-child(-n + 5)) {
  transform-origin: top center;
}

.movies-card:nth-last-child(-n + 5):not(:nth-child(-n + 5)) {
  transform-origin: bottom center;
}

.movies-card:nth-child(-n + 5):nth-last-child(-n + 5) {
  transform-origin: top center;
}

.movie-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 18px;
  color: #fff;
}

.movie-no-data {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(50 * var(--vh, 1vh));
  width: 100%;
  font-size: 40px;
  zoom: 1.6;
  color: var(--gold);
}

.movies-loading-spinner {
  font-size: 24px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 40px 0;
}

.movie-channels-no-data {
  font-size: 30px;
  color: var(--gold);
}

/* Lock icon styling (match Series page) */
.movie-category-lock-icon {
  position: absolute;
  color: #ff6b6b;
  transform: translate(-50%, -50%);
  text-align: center;
  top: 50%;
  left: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  width: 100%;
  font-size: 24px;
  padding: 20px;
  z-index: 10;
}

.cards-loading-spinner {
  font-size: 24px;
  display: flex;
  width: 100%;
  /* align-items: center; */
  justify-content: center;
  color: white;
  text-align: center;
  padding: 40px 0;
}

.movie-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.movie-progress-fill {
  height: 100%;
  background: red; /* visible red */
  width: 0;
  transition: width 0.3s ease;
}

.movie-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.movie-progress-overlay {
  position: absolute;
  bottom: 7px;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.25); /* track */
  overflow: hidden;
  /* border-radius: 0 0 8px 8px; */
  z-index: 3;
}

.movie-progress-overlay .movie-progress-fill {
  height: 100%;
  background: red;
  width: 0;
  transition: width 0.3s ease;
}

.movie-card-dropdown {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 10px 0;
  min-width: 250px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.dropdown-option {
  padding: 12px 20px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.dropdown-option.focused {
  background-color: var(--gold);
  color: white;
}

.dropdown-option:hover {
  background-color: #333;
}
.movie-card-blur {
  filter: blur(10px);
  pointer-events: none;
}

.movie-card-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 2;
  font-size: 14px;
  text-align: center;
}

.movie-card-lock-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.movie-card-image-wrapper,
.movie-card-bottom-content {
  transition: filter 0.3s ease;
}

.movie-card-lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #ff4444;
  font-size: 16px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blur effects for locked adult categories */
.movie-category-blurred {
  /* filter: blur(20px); */
  opacity: 0.7;
}

/* Blur effects for locked adult movie cards */
.movie-card-blurred {
  opacity: 0.8;
}

.blurred-image {
  filter: blur(15px);
}

.blurred-text {
  filter: blur(15px);
  opacity: 0.6;
}

/* Ensure lock icon stays clear */
.movie-category-lock-icon,
.movie-card-lock-icon {
  filter: none !important;
  opacity: 1 !important;
}
