
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');        
        /* Add these styles to your existing style section */

        /* Season/Episode Selector Styles */

        /* Controlli centrali con effetto glass - senza tinte rosse */
.center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 60px;
    z-index: 50;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.center-controls.hidden {
    display: none;
}

/* Stile base per tutti i pulsanti - nessuna tinta rossa */
.center-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Effetto di luce interno per tutti i pulsanti */
.center-control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 50%;
    pointer-events: none;
}

.center-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.center-control-btn:active {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.08);
}

.center-control-btn i {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
}

/* Pulsante play centrale - stesso stile degli altri, solo più grande */
.center-control-btn.play-btn {
    width: 90px;
    height: 90px;
    /* Nessun background rosso */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
}

/* Nessun gradient rosso per il play button */
.center-control-btn.play-btn::before {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
}

.center-control-btn.play-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.center-control-btn.play-btn i {
    font-size: 2.5rem;
    margin-left: 4px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.center-control-btn.play-btn .fa-pause {
    margin-left: 0;
}

/* Pulsanti skip - stile identico agli altri */
.center-control-btn.skip-forward,
.center-control-btn.skip-backward {
    /* Stile identico al base */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.center-control-btn.skip-forward:hover,
.center-control-btn.skip-backward:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Animazioni per i pulsanti skip */
.center-control-btn.skip-forward i {
    margin-left: 3px;
}

.center-control-btn.skip-backward i {
    margin-right: 3px;
}

/* Effetto di ripple al click - per tutti i pulsanti */
.center-control-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.center-control-btn:active::after {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.1s ease;
}

/* Animazione di apparizione */
.center-controls {
    animation: glassFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes glassFadeIn {
    from {
        opacity: 0.01; /* <-- CORREZIONE: Forza il rendering del blur */
        transform: translate(-50%, -50%) scale(0.9);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0);
    }
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .center-controls {
        gap: 30px;
    }
    
    .center-control-btn {
        width: 60px;
        height: 60px;
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
    }
    
    .center-control-btn i {
        font-size: 1.5rem;
    }
    
    .center-control-btn.play-btn {
        width: 75px;
        height: 75px;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
    
    .center-control-btn.play-btn i {
        font-size: 2rem;
    }
}

/* Supporto per browser che non supportano backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .center-control-btn {
        background: rgba(42, 42, 42, 0.95);
    }
}

.progress-container {
    height: 6px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 0; /* Modificato da 10px a 0 */
}


.controls-container {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%; 
    max-width: 800px; 
    
    background: rgba(34, 31, 31, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Modificato: 
      - 0.75rem (12px) sopra (sopra la barra di progresso)
      - 1rem (16px) ai lati
      - 0.5rem (8px) sotto (sotto i pulsanti)
    */
    padding: 0.75rem 1rem 0.5rem; 
    
    transition: opacity 0.3s ease;
    opacity: 0;
    touch-action: manipulation;
    
    display: flex;
    flex-direction: column;
    gap: 0.5rem; 
}


.seek-tooltip {
    position: absolute;
    bottom: 1rem; /* 16px (sopra la barra di progresso di 6px) */
    left: 0; /* La posizione 'left' sarà gestita da JavaScript */
    transform: translateX(-50%); /* Centra il popup sulla posizione */
    
    /* Stile Liquid Glass */
    background: rgba(34, 31, 31, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 10;
    
    /* Nascosto di default */
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Non deve intercettare il mouse */
}

        html {
  scroll-behavior: smooth;
}



/* Nasconde la scrollbar su tutti i browser */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #141414;
    color: #fff;
}

h2[trending] {
  scroll-margin-bottom: 50px; /* Spazio sotto la navbar (96px = h-16) */
}

.subtitle-options,
.audio-options,
.quality-options {
  max-height: 250px; /* o quello che vuoi in base al layout */
  overflow-y: auto;
  padding-right: 6px; /* per non tagliare scrollbar su browser con overlay */
}

.season-episode-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.selection-container {
    background-color: #141414;
    border-radius: 8px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.selection-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.close-selector {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.seasons-grid, .episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.season-card, .episode-card {
    background: #222;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.season-card:hover, .episode-card:hover {
    transform: scale(1.03);
}

.season-poster, .episode-still {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.episode-still {
    aspect-ratio: 16/9;
}

.season-info, .episode-info {
    padding: 10px;
}

.season-info h3, .episode-info h3 {
    color: #fff;
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.season-info p, .episode-info p {
    color: #aaa;
    margin: 0;
    font-size: 0.8rem;
}

.episode-overview {
    color: #ddd;
    font-size: 0.8rem;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.back-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #fff;
}

.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #fff;
}

.error-state i {
    color: #E50914;
    font-size: 2rem;
    margin-bottom: 10px;
}

.error-state button {
    background: #E50914;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-top: 15px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .seasons-grid, .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .selection-container {
        padding: 15px;
    }
    
    .season-info h3, .episode-info h3 {
        font-size: 0.9rem;
    }
}
.video-container {
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.video-js {
    width: 100%;
    height: 100%;
}



@media (max-width: 768px) {

    
    .progress-container {
        height: 10px;
        margin-bottom: 15px;
    }
    
    button {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Larger touch targets for mobile */
    .progress-container {
        height: 12px;
        margin-bottom: 20px;
    }

    /* Prevent double-tap zoom */
    video {
        touch-action: pan-x pan-y;
    }
}

/* Video zoom states */
.video-zoom-1 {
    object-fit: contain;
    width: 100%;
    height: 100%;
}
.video-zoom-2 {
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.video-zoom-3 {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

.video-container:hover .controls-container {
    opacity: 1;
}



.progress-bar {
    height: 100%;
    background-color: #E50914;
    border-radius: 3px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Mostra la pallina quando i controlli sono visibili O in hover */
#controlsContainer.visible .progress-bar::after,
.progress-container:hover .progress-bar::after {
    opacity: 1;
}

.volume-slider {
    width: 0;
    transition: width 0.2s ease;
    overflow: hidden;
}

.volume-container:hover .volume-slider {
    width: 80px;
}

.settings-menu {
    position: absolute;
    bottom: 60px;
    right: 10px;
    
    /* Stile Liquid Glass */
    background: rgba(34, 31, 31, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    border-radius: 8px; /* Arrotondamento coerente */
    padding: 8px 0;
    min-width: 150px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    overflow: hidden; /* Necessario per il border-radius */
}

.settings-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.quality-option:hover, .speed-option:hover {
    background-color: rgba(255,255,255,0.1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

.error-message {
    background-color: rgba(0,0,0,0.7);
}

.skip-animation {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
}

.skip-forward {
    right: 0;
    background: linear-gradient(to left, rgba(229,9,20,0.7), transparent);
}

.skip-backward {
    left: 0;
    background: linear-gradient(to right, rgba(229,9,20,0.7), transparent);
}

@keyframes skipFade {
    0% { opacity: 0; transform: translateX(0); }
    20% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(20px); }
}

.skip-animation.forward {
    animation: skipFade 1s ease-out forwards;
}

.skip-animation.backward {
    animation: skipFade 1s ease-out forwards;
}

/* For fullscreen mode */


.logo{
    width: 50%;
    height: auto;
}



/* Larger controls for TV */
@media (min-width: 1024px) and (hover: none) and (pointer: coarse) {

    
    button {
        font-size: 1.2rem;
        padding: 15px;
    }
    
    .progress-container {
        height: 12px;
    }
    

}

/* --- STILE PULSANTE "X" PER "CONTINUA A GUARDARE" --- */

.remove-progress-btn {
  position: absolute;
  top: 0.5rem;   /* Tailwind: top-2 */
  right: 0.5rem;  /* Tailwind: right-2 */
  z-index: 20; /* Sopra tutto il resto della card */
  
  /* Stile Glass/Trasparente */
  background: rgba(34, 31, 31, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 28px;  /* Dimensione piccola */
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem; /* Icona 'X' piccola */
  cursor: pointer;
  
  opacity: 0; /* Nascosto di default */
  transform: scale(0.8);
  transition: all 0.2s ease;
}

/* Appare solo quando si passa sopra la card (su desktop) */
.movie-card:hover .remove-progress-btn {
  opacity: 1;
  transform: scale(1);
}

.remove-progress-btn:hover {
  background: #E50914; /* Colore rosso all'hover */
  border-color: #E50914;
}

/* Su mobile (dove non c'è hover), lo rendiamo sempre visibile */
@media (max-width: 768px) {
  .remove-progress-btn {
    opacity: 0.8; /* Leggermente trasparente per non essere invadente */
    transform: scale(1);
  }
}

/* Animazione di rimozione card */
.movie-card.removing {
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
}
        

.carousel-row {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  
  /* AGGIUNTA: Aggiungi padding laterale (Tailwind: px-4) 
    per dare spazio alla prima e all'ultima card.
  */
  padding-left: 1rem;
  padding-right: 1rem;
  
  /* AGGIUNTA: Impedisce al padding di essere "mangiato" 
    dallo scorrimento.
  */
  clip-path: inset(0 0 0 0);
}

/* Modifica la card per rimuovere il margine destro sull'ultima */
.carousel-row .movie-card,
.carousel-row .animate-pulse {
  flex: 0 0 auto;
  margin-right: 0.75rem;
  width: 40%;
}

.carousel-row .movie-card:last-child,
.carousel-row .animate-pulse:last-child {
  margin-right: 0;
}

@media (min-width: 640px) {
  /* Ripeti il padding per coerenza */
  .carousel-row {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .carousel-row .movie-card,
  .carousel-row .animate-pulse {
    width: 28%;
  }
}

@media (min-width: 1024px) {
  /* Ripeti il padding per coerenza */
  .carousel-row {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .carousel-row .movie-card,
  .carousel-row .animate-pulse {
    width: 18%;
  }
}


/* ASSEGNAZIONE GERARCHIA Z-INDEX 
  (Barra mobile: 50, Modali Info: 100, Player: 1000)
*/

/* La barra di navigazione mobile (#mobile-nav) 
  ha già 'z-50' (z-index: 50) da Tailwind. 
*/

/* Assicura che i modali info e stagioni stiano SOPRA 
  la barra di navigazione.
*/
.glass-modal,
.season-episode-selector {
  z-index: 100; /* Superiore a 50 */
}

/* Il #player-modal è stato impostato a z-[1000] 
  nell'HTML per avere la priorità massima.
*/

/* --- STILE FRECCE CAROSELLO --- */

.carousel-btn {
  position: absolute;
  
  /* Allinea i pulsanti verticalmente al centro delle immagini (h-64).
     8rem è la metà di h-64 (16rem). */
  top: 8rem;
  /* translateY(-50%) centra il pulsante su quell'asse */
  transform: translateY(-50%); 
  z-index: 10;
  
  /* Stile Glass scuro */
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  
  /* Dimensioni (Tailwind: w-11 h-11) */
  width: 44px;
  height: 44px;
  
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  
  /* Nascosti di default */
  opacity: 0;
  pointer-events: none; /* Non cliccabile se non visibile */
}

/* Mostra i pulsanti quando si passa sopra al *contenitore* (non solo sulla freccia) */
.carousel-container:hover .carousel-btn {
  opacity: 1;
  pointer-events: all; /* Rendi cliccabile */
}

.carousel-btn:hover {
  background: rgba(20, 20, 20, 1); /* Sfondo più solido all'hover */
  transform: translateY(-50%) scale(1.1); /* Leggero ingrandimento */
}

/* Posiziona i pulsanti 'prev' e 'next' */
.carousel-btn.prev { left: 0.5rem; }
.carousel-btn.next { right: 0.5rem; }

/* Nasconde le frecce su mobile (dove si usa lo swipe) */
@media (max-width: 768px) {
  .carousel-btn {
    display: none !important; /* Forza la scomparsa */
  }
}
/* --- BARRA DI NAVIGAZIONE MOBILE --- */

/* Applica lo sfondo "glass" alla barra */
#mobile-nav {
  background: rgba(34, 31, 31, 0.45);
  backdrop-filter: blur(16px) saturate(200%);
  -webkit-backdrop-filter: blur(16px) saturate(200%);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.36);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stile per i singoli link */
.mobile-nav-link {
  flex: 1; /* Occupa spazio uguale */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #A0A0A0; /* Grigio (non attivo) */
  font-size: 0.7rem;
  transition: all 0.2s ease;
}

.mobile-nav-link i {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

/* Colore per il link attivo (rosso primario) */
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: white;
  text-shadow: 0 0 8px rgba(229, 9, 20, 0.5);
}

/*
  FONDAMENTALE: Aggiungi padding-bottom al body 
  per evitare che la barra fissa copra l'ultimo carosello!
*/
@media (max-width: 768px) {
  body {
    /* h-16 della barra mobile + mb-12 dell'ultima sezione */
    padding-bottom: calc(4rem + 3rem); 
  }
}

/* --- OTTIMIZZAZIONE HERO MOBILE --- */
@media (max-width: 640px) {
  #hero-section {
    height: 90vh; /* Leggermente più bassa per far vedere che c'è contenuto sotto */
  }

  /* Riduci la dimensione del titolo */
  #hero-title {
    font-size: 2.25rem; /* 36px */
    line-height: 2.5rem; /* 40px */
    /* Aggiunge un'ombra per staccare il testo dallo sfondo */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  }

  /* Limita la descrizione a 3 righe */
  #hero-overview {
    font-size: 0.875rem; /* 14px */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    
    /* Codice per troncare il testo a 3 righe */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
  }
  
  /* Aumenta la dimensione dei pulsanti per il tocco */
  #play-button,
  #more-info-button {
    padding: 0.75rem 1.25rem; /* Più padding verticale */
    font-size: 1rem;
  }
}
/* Nuovo stile suggerito */
.hero-gradient {
    /* Parte da un nero più solido e sfuma più velocemente */
    background: linear-gradient(to right, 
                  rgba(20, 20, 20, 1) 0%, 
                  rgba(20, 20, 20, 0.9) 25%,
                  rgba(20, 20, 20, 0) 60%);
}
        
        .movie-card:hover .movie-poster {
            transform: scale(1.05);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }
        
        .movie-poster {
            transition: all 0.3s ease;
        }
        
        .loader {
            border-top-color: #E50914;
            animation: spinner 1.5s linear infinite;
        }
        
        @keyframes spinner {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .movie-modal {
            transition: opacity 0.3s ease;
            overflow-y: auto; /* Abilita scroll solo nel modale se necessario */

        }
        
        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: #141414;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #E50914;
            border-radius: 4px;
        }

        body.show-search-results #hero-section,
body.show-search-results main,
body.show-search-results footer {
  display: none;
}

body.show-search-results #search-results-section {
  display: block !important;
}

.show-search-results main,
.show-search-results footer {
    display: none;
}
#search-results-section {
  top: 100px; /* o quanto basta per scendere sotto la navbar */
}


.bg-secondary{

/* From https://css.glass */
background: rgba(255, 255, 255, 0.27);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(12.5px);
-webkit-backdrop-filter: blur(12.5px);
}

.bg-primary{

/* From https://css.glass */
background: rgba(255, 255, 255, 0.27);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(12.5px);
-webkit-backdrop-filter: blur(12.5px);
}

/* Aggiungi questo al tuo CSS */
@media (max-width: 768px) {
    .hero-gradient {
        background: linear-gradient(to right, 
            rgba(20, 20, 20, 0.95) 0%, 
            rgba(20, 20, 20, 0.7) 50%,
            rgba(20, 20, 20, 0.4) 100%);
    }
    
    .hero-fade {
        height: 150px;
        background: linear-gradient(to bottom, 
            transparent 0%, 
            rgba(20, 20, 20, 0.6) 30%,
            rgba(20, 20, 20, 0.9) 70%,
            rgba(20, 20, 20, 1) 100%);
    }
}

/* Stili per migliorare la leggibilità su mobile */
@media (max-width: 768px) {
    .mobile-contrast {
        background-color: rgba(0, 0, 0, 0.5) !important;
    }
    
    .mobile-text-contrast {
        color: #fff !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    #hero-section .relative.z-10 h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    #hero-section .relative.z-10 p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    #hero-rating {
        background-color: rgba(229, 9, 20, 0.9) !important;
        padding: 0.25rem 0.5rem;
    }


}

#mobile-search-box {
    display: none; /* Nascosto di default */
    padding: 10px;
    
    /* Stile Liquid Glass (lo stesso della navbar) */
    background: rgba(34, 31, 31, 0.45);
    backdrop-filter: blur(16px) saturate(200%);
    -webkit-backdrop-filter: blur(16px) saturate(200%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    position: absolute;
    width: 100%;
    top: 4rem; /* Allineato all'altezza della .glass-nav */
    left: 0;
    z-index: 40;
}
        
        #mobile-search-box.active {
            display: block; /* Mostrato quando attivo */
        }
        
        .search-input-container {
            position: relative;
        }
        
        #mobile-search-input {
            width: 100%;
            padding: 8px 40px 8px 15px;
            border-radius: 4px;
            border: none;
            background: #333;
            color: white;
        }
        
        #mobile-search-button {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #E50914;
        }
        /* Player Modal - Correzione per mobile */
        #player-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: black;
            z-index: 1000;
            overflow: hidden;
        }
        
        /* Contenitore header */
        #backButtonContainer {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 15px;
            background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
            z-index: 10;
            display: flex;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        /* Mostra header al passaggio del mouse o al tap */
        #videoContainer:hover #backButtonContainer,
        #videoContainer:focus-within #backButtonContainer {
            opacity: 1;
        }
        
        /* Stile freccia back */
        #close-player {
            color: white;
            background: rgba(34, 31, 31, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
        }
        
        /* Stile titolo */
        #player-title {
            color: white;
            font-size: 16px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 70%;
        }
/* FORZA la visibilità solo quando la classe 'visible' è presente */
#controlsContainer:not(.visible),
#backButtonContainer:not(.visible) {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

#controlsContainer.visible,
#backButtonContainer.visible {
    opacity: 1 !important;
    pointer-events: all !important;
}
