@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css?family=Inconsolata:700");

/* Lazy loading styles - only for data-src images */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[data-src].loaded,
img.lazy-loaded {
  opacity: 1;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 280ms ease-in fadeSlideOut;
}
::view-transition-new(root) {
  animation: 280ms ease-out fadeSlideIn;
}

@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo-container {
  view-transition-name: main-logo;
}
.search-container {
  view-transition-name: search-bar;
}

/* Global Red Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0f1112;
}

::-webkit-scrollbar-thumb {
  background: #e50914;
  border-radius: 10px;
  border: 2px solid #0f1112;
}

::-webkit-scrollbar-thumb:hover {
  background: #b20710;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #e50914 #0f1112;
}

body {
  margin: 0;
  font-family:
    "Poppins",
    system-ui,
    Segoe UI,
    Roboto,
    Arial;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.02) 0%,
      transparent 60%
    ),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10 10"><circle cx="5" cy="5" r="1" fill="%23212121" opacity="0.5" /></svg>')
      repeat,
    var(--bg, #0f1112);
  color: white;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 40px;
  background-color: #000;
  z-index: 1000;
  box-sizing: border-box;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 30px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 40px;
  width: 80%;
  display: flex;
  justify-content: space-between;
  margin-right: 60px;
}

.tabs {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-container:hover {
  transform: scale(1.05);
}

.logo-container.logo-login {
  display: inline-flex;
}

.logo_traflix {
  height: 60px;
  margin-top: -10px;
  margin-bottom: -10px;
  transition: all 0.3s ease;
  object-fit: contain;
}

.logo-container h1, .login-logo h1 {
  background: linear-gradient(to right, #e50914, #ff4d4d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  text-decoration: none;
  font-family: "Poppins", system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

.logo-container:hover h1 {
  transform: scale(1.02);
}

/* New Back Button Style for Navbar Right */
.nav-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: var(--text-white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  order: 10; /* Ensures it stays at the end */
}

.nav-back-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
  transform: translateX(3px);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.nav-back-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.nav-back-btn:hover svg {
  transform: translateX(2px);
}

.tabs {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Premium Home Button - Fixed color on all pages */
button#tabHome {
  padding: 10px 24px;
  border: 2px solid #e50914;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

button#tabHome::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

button#tabHome:hover::before {
  left: 100%;
}

button#tabHome:hover {
  background: linear-gradient(135deg, #ff1a25 0%, #cc0a12 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
}

/* Premium Browse Button */
button#tabBrowse {
  padding: 10px 24px;
  border: 2px solid rgba(229, 9, 20, 0.6);
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  background: rgba(229, 9, 20, 0.1);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

button#tabBrowse::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}


/* Distinct Login Button - Enhanced */
.login-btn {
  background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
  color: white;
  border: none;
  padding: 10px 28px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  background: linear-gradient(135deg, #ff3333 0%, #e50914 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.search-container {
  scale: 0.8;
  position: relative;
  width: 35px;
  height: 35px;

  .search {
    position: absolute;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    background: #e50914;
    border-radius: 50%;
    transition: all 1s;
    z-index: 4;
    box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.4);

    &:hover {
      cursor: pointer;
    }

    &::before {
      content: "";
      position: absolute;
      margin: auto;
      top: 15px;
      right: 0;
      bottom: 0;
      left: 20px;
      width: 12px;
      height: 2px;
      background: white;
      transform: rotate(45deg);
      transition: all 0.5s;
    }

    &::after {
      content: "";
      scale: 0.8;
      position: absolute;
      margin: auto;
      top: -5px;
      right: 0;
      bottom: 0;
      left: -5px;
      width: 25px;
      height: 25px;
      border-radius: 50%;
      border: 2px solid white;
      transition: all 0.5s;
    }
  }

  input {
    font-family: "Inconsolata", monospace;
    position: absolute;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    outline: none;
    border: none;
    background: crimson;
    color: white;
    text-shadow: 0 0 10px crimson;
    padding: 0 80px 0 20px;
    border-radius: 30px;
    box-shadow:
      0 0 25px 0 crimson,
      0 20px 25px 0 rgba(0, 0, 0, 0.2);
    transition: all 1s;
    opacity: 0;
    z-index: 5;
    font-weight: bolder;
    letter-spacing: 0.1em;

    &:hover {
      cursor: pointer;
    }

    &:focus {
      width: 150px;
      transform: translateX(-60px);
      opacity: 1;

      cursor: text;
    }

    &.expanded {
      width: 150px;
      transform: translateX(-60px);
      opacity: 1;
      cursor: text;
    }

    &.expanded ~ .search {
      transform: translateX(150px);
      background: #151515;
      z-index: 6;

      &::before {
        top: 0;
        left: 0;
        width: 25px;
      }

      &::after {
        top: 0;
        left: 0;
        width: 25px;
        scale: 1;
        height: 2px;
        border: none;
        background: white;
        border-radius: 0%;
        transform: rotate(-45deg);
      }
    }

    &:focus ~ .search {
      transform: translateX(150px);
      background: #151515;
      z-index: 6;

      &::before {
        top: 0;
        left: 0;
        width: 25px;
      }

      &::after {
        top: 0;
        left: 0;
        width: 25px;
        scale: 1;
        height: 2px;
        border: none;
        background: white;
        border-radius: 0%;
        transform: rotate(-45deg);
      }
    }

    &::placeholder {
      color: white;
      opacity: 0.5;
      font-weight: bolder;
    }
  }
}

.container {
  padding: 30px 40px;
  margin-top: 80px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.card {
  cursor: pointer;
  flex: 0 0 160px;
  transition: transform 0.2s;
  position: relative;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Card hover scaling is now handled by JavaScript */
.card img {
  width: 100%;
  border-radius: 6px;
}

.card p {
  margin: 6px 0 0;
  font-size: 14px;
  text-align: center;
}

.player {
  margin-top: 30px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player h2 {
  margin: 0;
  color: #e50914;
  font-size: 24px;
}

iframe {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  border: none;
  background: #000;
  margin: 0;
  padding: 0;
  display: block;
  outline: none;
  box-shadow: none;
}

.player-error {
  background: #333;
  color: #ff6b6b;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 2px solid #ff6b6b;
}

.player-error h3 {
  margin: 0 0 10px 0;
  color: #ff6b6b;
}

.player-error p {
  margin: 0;
  font-size: 14px;
}

.player-controls {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#nextEpisodeBtn {
  background: #e50914;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.save-progress-btn:hover {
  background: #b20710;
}

.save-progress-btn:active {
  transform: scale(0.95);
}

.series-controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.series-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 10px;
}

.play-first-btn,
.show-episodes-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 150px;
}

#continueBtn {
  background: #e50914;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 150px;
}

#continueBtn:hover {
  background: #b20710;
  transform: scale(1.05);
}

.watching-info {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.watching-info .watching {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watching-info .watching-label {
  font-size: 14px;
  font-weight: 400;
  color: white;
  line-height: 1.3;
}

.watching-info .watching-label strong {
  font-weight: 600;
}

.watching-info .progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.watching-info .progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  min-width: 120px;
}

.watching-info .progress-completed {
  display: block;
  height: 100%;
  background: #e50914;
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 4px;
}

.watching-info .summary {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.play-first-btn {
  background: #333;
  color: white;
}

.play-first-btn:hover {
  background: #555;
  transform: scale(1.05);
}

.show-episodes-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.show-episodes-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

#loadMoreBtn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: #e50914;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 16px;
}

#loadMoreBtn:hover {
  background-color: #b20710;
}

footer {
  text-align: center;
  padding: 20px;
  color: #e50914;
  font-size: 13px;
}

footer .version {
  color: #888;
}

.logo_traflix {
  width: 50px;
  position: relative;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  position: absolute;
  font-weight: 700;
  color: #111;
  font-size: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.episode-timeline-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scroll-btn {
  background: #333;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  min-width: 40px;
}

.scroll-btn:hover {
  background: #555;
}

.episode-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: #e50914 #1a1c1e;
  flex: 1;
  margin-top: 0;
  justify-content: flex-start;
}

.episode-timeline::-webkit-scrollbar {
  height: 8px;
}

.episode-timeline::-webkit-scrollbar-track {
  background: #1a1c1e;
  border-radius: 4px;
}

.episode-timeline::-webkit-scrollbar-thumb {
  background: #e50914;
  border-radius: 4px;
}

.episode-timeline::-webkit-scrollbar-thumb:hover {
  background: #b20710;
}

.episode-card {
  background: #222;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s;
  min-width: 200px;
  max-width: 200px;
  flex-shrink: 0;
  position: relative;
}

.episode-card:hover {
  background: #333;
  transform: scale(1.05);
}

.episode-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.episode-card .progress-container {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin: 0;
}

.episode-card .progress-bar {
  height: 100%;
  background: #e50914;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.episode-number {
  font-size: 14px;
  font-weight: bold;
  color: #e50914;
  margin-bottom: 5px;
}

.episode-info h4 {
  margin: 0 0 5px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-info p {
  margin: 0;
  font-size: 12px;
  color: #ccc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-overview {
  margin: 5px 0;
  font-size: 12px;
  color: #ccc;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.episode-date {
  margin: 5px 0;
  font-size: 11px;
  color: #999;
}

.watched-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e50914;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
}

/* Auth Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background-color: #222;
  margin: 10% auto;
  padding: 25px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
}

.close {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  transition: all 0.2s;
}

.close:hover,
.close:focus {
  color: #e50914;
  text-decoration: none;
  transform: scale(1.1);
}

.modal input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #444;
  border-radius: 6px;
  box-sizing: border-box;
  background: #333;
  color: white;
  font-size: 16px;
}

.modal input:focus {
  outline: none;
  border-color: #e50914;
}

.modal button {
  width: 100%;
  padding: 12px;
  background-color: #e50914;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
  transition: all 0.2s;
}

.modal button:hover {
  background-color: #b20710;
  transform: translateY(-1px);
}

.modal button:active {
  transform: translateY(0);
}

.modal p {
  text-align: center;
  margin: 15px 0;
}

.modal a {
  color: #e50914;
  text-decoration: none;
  font-weight: 500;
}

.modal a:hover {
  text-decoration: underline;
}

/* Modal responsive per mobile */
@media (max-width: 768px) {
  .modal {
    padding: 15px;
    z-index: 1500;
  }

  .modal-content {
    width: 90%;
    max-width: 380px;
    margin: 20% auto;
    padding: 20px;
    border-radius: 10px;
  }

  .close {
    top: 12px;
    right: 15px;
    font-size: 36px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
  }

  .modal input {
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
  }

  .modal button {
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
  }

  .modal p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 10px;
  }

  .modal-content {
    width: 95%;
    margin: 15% auto;
    padding: 18px;
    border-radius: 8px;
  }

  .close {
    top: 10px;
    right: 12px;
    font-size: 32px;
  }

  .modal input {
    padding: 12px;
    min-height: 44px;
  }

  .modal button {
    padding: 12px;
    min-height: 44px;
    font-size: 15px;
  }
}

/* Proxy Selector */
.proxy-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#proxySelector {
  position: relative;
  background: rgba(229, 9, 20, 0.1);
  color: #fff;
  border: 2px solid rgba(229, 9, 20, 0.6);
  padding: 6px 32px 6px 12px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#proxySelector:hover {
  border-color: rgba(229, 9, 20, 0.8);
  background: rgba(229, 9, 20, 0.15);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#proxySelector:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(229, 9, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#proxySelector:focus {
  border-color: rgba(229, 9, 20, 0.9);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25), 0 4px 15px rgba(229, 9, 20, 0.3);
}

#proxySelector option {
  background-color: #1a1a1a;
  color: #fff;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

/* Login Container */
.login-container {
  flex-shrink: 0;
}

/* Premium User Profile Button */
.user-profile-btn {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(10px);
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

.user-profile-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

.dropdown-username {
  padding: 12px 16px;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  background-color: #222;
  border-bottom: 1px solid #333;
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: white;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  transition: background-color 0.2s;
  display: block;
}

.dropdown-item:hover {
  background-color: #333;
}

.dropdown-divider {
  height: 1px;
  background-color: #333;
  margin: 4px 0;
}

.logout-item {
  color: #e50914;
  font-weight: 500;
}

.admin-item {
  color: #e50914;
  font-weight: 600;
  border-left: 3px solid #e50914;
}

.admin-item:hover {
  background-color: #2a0507;
}

.admin-item.current-page {
  background-color: #e50914;
  color: white;
  pointer-events: none;
  opacity: 0.7;
}

/* System Kill Switch Controls */
.system-controls-section {
  background: #1f1f1f;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid #333;
}

.system-controls-section h2 {
  color: #e50914;
  margin: 0 0 25px 0;
  font-size: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-card {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  border-left: 4px solid #333;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.status-enabled {
  background: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  animation: pulse-enabled 2s infinite;
}

.status-dot.status-disabled {
  background: #f44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
  animation: pulse-disabled 2s infinite;
}

@keyframes pulse-enabled {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-disabled {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.status-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.status-details {
  font-size: 14px;
  color: #ccc;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.toggle-btn,
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.toggle-btn {
  background: #e50914;
}

.refresh-btn {
  background: #666;
}

.toggle-btn:hover {
  background: #b20710;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.refresh-btn:hover {
  background: #555;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 102, 102, 0.3);
}

.toggle-btn:disabled,
.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  font-size: 18px;
}

.status-history {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #333;
}

.status-history h3 {
  color: #e50914;
  margin: 0 0 15px 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .status-history {
    max-width: fit-content;
  }
}

.system-info {
  color: #fff;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.info-item {
  background: #1f1f1f;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #333;
}

.info-item strong {
  color: #e50914;
  display: block;
  margin-bottom: 5px;
}

@media (max-width: 480px) {
  .info-item {
    max-width: 100%;
  }
}

.system-status-message {
  padding: 15px 20px;
  border-radius: 6px;
  margin: 15px 0;
  text-align: center;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

.system-status-message.system-status-success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
}

.system-status-message.system-status-error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid #f44336;
  color: #f44336;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* System Blocked Overlay Enhancements */
.system-blocked-overlay {
  backdrop-filter: blur(5px);
  animation: fadeIn 0.5s ease;
}

.system-blocked-content {
  animation: scaleIn 0.3s ease;
  border: 3px solid #e50914 !important;
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Security indicators */
.security-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(229, 9, 20, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  display: none;
}

.security-indicator.active {
  display: block;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0.3;
  }
}

.logout-item:hover {
  background-color: rgba(229, 9, 20, 0.1);
}

.account-page h2,
.history-page h2 {
  color: #e50914;
  margin-bottom: 30px;
  font-size: 32px;
}

.account-section {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.account-section h3 {
  color: #fff;
  margin: 0 0 15px 0;
  font-size: 20px;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.info-label {
  color: #999;
  font-weight: 500;
}

.info-value {
  color: #fff;
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-btn {
  padding: 10px 20px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.account-btn:hover {
  background: #555;
}

.account-stats {
  display: flex;
  gap: 20px;
}

.stat-card {
  flex: 1;
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-number {
  font-size: 36px;
  color: #e50914;
  font-weight: bold;
  margin-bottom: 10px;
}

.stat-label {
  color: #999;
  font-size: 14px;
}

.account-page .back-btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.account-page .back-btn:hover {
  background: #555;
}

/* Account Page Mobile Responsive */
@media (max-width: 768px) {
  .account-page {
    padding: 15px;
    margin-top: 100px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .account-page h2 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .account-section {
    padding: 15px;
    margin-bottom: 15px;
  }

  .account-section h3 {
    font-size: 18px;
  }

  .info-row {
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
  }

  .info-label {
    font-size: 14px;
  }

  .info-value {
    font-size: 14px;
  }

  .account-stats {
    flex-direction: column;
    gap: 10px;
  }

  .stat-number {
    font-size: 28px;
  }

  .stat-label {
    font-size: 13px;
  }

  .account-page .back-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .account-page {
    padding: 10px;
    margin-top: 90px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .account-page h2 {
    font-size: 20px;
  }

  .account-section {
    padding: 12px;
  }

  .account-section h3 {
    font-size: 16px;
  }

  .stat-number {
    font-size: 24px;
  }

  .account-btn,
  .account-page .back-btn {
    font-size: 13px;
    padding: 10px;
  }
}

@media (max-width: 300px) {
  .account-actions {
    flex-direction: column;
    gap: 8px;
  }

  .account-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
}

/* History Page */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #222;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.history-item:hover {
  background: #333;
}

.history-item {
  position: relative;
}

.history-item img {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
}

img {
  z-index: 10;
  position: relative;
}

.progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0 0 4px 4px;
}

.progress-bar {
  height: 100%;
  background: #e50914;
  border-radius: 0 0 4px 4px;
  transition: width 0.3s ease;
}

.history-info {
  flex: 1;
}

.history-info h4 {
  margin: 0 0 5px 0;
  color: #fff;
  font-size: 18px;
}

.history-info p {
  margin: 3px 0;
  color: #999;
  font-size: 14px;
}

.history-type {
  color: #e50914 !important;
  font-weight: 500;
}

.remove-history-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s;
}

.remove-history-btn:hover {
  background: #e50914;
}

.clear-history-btn {
  width: 100%;
  padding: 12px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 20px;
}

.clear-history-btn:hover {
  background: #555;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 40px;
  font-size: 16px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #e50914;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

@view-transition {
  navigation: auto;
}

:root {
  --primary-color: #e50914;
  --primary-red: #e50914;
  --primary-red-dark: #b20710;
  --secondary-color: #1a1a1a;
  --text-white: #ffffff;
  --text-gray: #b3b3b3;
  --nav-height: 70px;
}

.logo-container {
  view-transition-name: main-logo;
}

.search-container {
  view-transition-name: search-bar;
}

.navbar {
  view-transition-name: main-nav;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.primary-btn {
  flex: 1;
  padding: 12px;
  background: #e50914;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s;
  max-width: 100px;
}

.primary-btn:hover {
  background: #b20710;
}

.secondary-btn {
  flex: 1;
  padding: 12px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  max-width: 100px;
}

.secondary-btn:hover {
  background: #555;
}

/* Messages */
.message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  display: none;
}

.message:not(:empty) {
  display: block;
}

.message.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid #4caf50;
}

.message.error {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid #f44336;
}

/* Password Requirements */
.password-requirements {
  background: #1a1a1a;
  padding: 15px;
  border-radius: 4px;
  margin: 15px 0;
}

.password-requirements p {
  margin: 0 0 10px 0;
  color: #999;
  font-size: 14px;
}

.password-requirements ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.password-requirements li {
  padding: 5px 0;
  color: #999;
  font-size: 14px;
  position: relative;
  padding-left: 25px;
}

.password-requirements li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: #666;
}

.password-requirements li.valid {
  color: #4caf50;
}

.password-requirements li.valid::before {
  content: "✓";
  color: #4caf50;
}

.password-requirements li.invalid {
  color: #f44336;
}

.password-requirements li.invalid::before {
  content: "✗";
  color: #f44336;
}

/* Profile Header */
.profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e50914;
}

.profile-summary {
  flex: 1;
}

.profile-summary h3 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 24px;
}

.profile-email {
  color: #999;
  font-size: 14px;
  margin: 0 0 10px 0;
}

.profile-bio {
  color: #ccc;
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* Account Buttons with Icons */
.account-btn span {
  margin-right: 8px;
}

/* Season Selector - Stile dropdown migliorato */

.season-selector {
  display: block;
  /* Visible by default */
}

#seasonBtn {
  background-color: #333;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s;
  position: relative;
  margin: 0;
}

#seasonBtn::after {
  content: "▼";
  margin-left: 10px;
  font-size: 12px;
  transition: transform 0.2s;
}

#seasonBtn.active::after {
  transform: rotate(180deg);
}

#seasonBtn:hover {
  background-color: #555;
}

.season-dropdown {
  position: relative;
  top: 100%;
  left: 0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 5px;
}

.season-dropdown::-webkit-scrollbar {
  width: 8px;
}

.season-dropdown::-webkit-scrollbar-track {
  background: #222;
}

.season-dropdown::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.season-dropdown::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.season-option {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: white;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  transition: background-color 0.2s;
  display: block;
}

.season-option:hover {
  background-color: #333;
}

.season-option:active {
  background-color: #e50914;
}

/* Content Details Screen */
.content-details {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-attachment: fixed;
}

.tv-details .details-overview {
  display: block;
}

.tv-details .details-content {
  flex-direction: row;
  align-items: flex-start;
}

.tv-details .details-poster {
  position: static;
  flex-shrink: 0;
}

.tv-details .details-info {
  flex: 1;
}

.tv-details .season-selector-section {
  order: 2;
}

.tv-details .details-actions {
  order: 1;
}

.tv-details #episodeTimelineContainer {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 20px;
}

.details-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 1;
}

.details-backdrop::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.9) 100%
  );
  z-index: 2;
}

.details-content {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 40px;
  max-width: 1200px;
  width: 100%;
  align-items: flex-start;
}

.details-poster {
  flex-shrink: 0;
}

.details-poster img {
  width: 300px;
  height: 450px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.details-info {
  flex: 1;
  color: white;
}

.details-info h1 {
  font-size: 48px;
  margin: 0 0 20px 0;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.details-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 500;
}

.details-meta .year,
.details-meta .runtime {
  color: #e50914;
}

.details-overview {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 600px;
}

.details-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.details-actions .primary-btn,
.details-actions .secondary-btn {
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.details-actions .primary-btn {
  background: #e50914;
  color: white;
  border: none;
}

.details-actions .primary-btn:hover {
  background: #b20710;
  transform: scale(1.05);
}

.details-actions .secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.details-actions .secondary-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* Responsive Design for Content Details */
@media (max-width: 1024px) {
  .details-content {
    gap: 30px;
  }

  .details-info h1 {
    font-size: 36px;
  }

  .details-meta {
    font-size: 16px;
  }

  .details-overview {
    font-size: 16px;
  }

  .details-actions .primary-btn,
  .details-actions .secondary-btn {
    padding: 14px 28px;
    font-size: 16px;
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .content-details {
    padding: 15px;
  }

  .details-content {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
  }

  .details-poster img {
    width: 200px;
    height: 300px;
  }

  .details-info h1 {
    font-size: 28px;
  }

  .details-meta {
    justify-content: center;
    font-size: 14px;
  }

  .details-overview {
    font-size: 14px;
    max-width: 100%;
  }

  .details-actions {
    justify-content: center;
  }

  .details-actions .primary-btn,
  .details-actions .secondary-btn {
    min-width: 160px;
    padding: 12px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .details-info h1 {
    font-size: 24px;
  }

  .details-poster img {
    width: 150px;
    height: 225px;
  }

  .details-actions {
    flex-direction: column;
    align-items: center;
  }

  .details-actions .primary-btn,
  .details-actions .secondary-btn {
    width: 100%;
    max-width: 280px;
  }
}

/* Season Selector in Details Screen */

.season-selector-section h3 {
  color: white;
  margin: 0 0 20px 0;
  font-size: 24px;
  text-align: center;
}

#episodesContainer {
  margin-top: 20px;
}

/* Continue Watching Cards */
.continue-watching-card {
  margin-bottom: 80px;
  display: inline-block;
  margin-right: 20px;
  position: relative;
  cursor: pointer;
  transition: margin-bottom 0.5s ease;
}

/* When tooltip is visible, increase margin for cards below */
.continue-watching-card:has(.hover-tooltip[style*="display: block"]) {
  margin-bottom: 200px;
}

.continue-watching-card .card-image-container {
  position: relative;
  display: inline-block;
  z-index: 5;
}

.continue-watching-card .card-image-container img {
  display: block;
  width: 100%;
  height: auto;
  z-index: 5;
}

.continue-watching-card .progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
}

.continue-watching-card .progress-bar {
  height: 100%;
  background: #e50914;
  transition: width 0.3s ease;
}

.continue-watching-card:first-child {
  margin-left: 0;
}

.continue-watching-card:last-child {
  margin-right: 0;
}

/* Hover Tooltip */
.hover-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  z-index: 2000;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  margin-top: 8px;
}

.tooltip-title {
  color: white;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.tooltip-content .episode-info strong,
.tooltip-content .movie-info {
  color: #e50914;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
}

.episode-name {
  color: white;
  font-size: 12px;
  margin-bottom: 8px;
  font-style: italic;
}

.progress-details {
  margin-top: 6px;
}

.progress-bar-small {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: #e50914;
  transition: width 0.3s ease;
}

.tooltip-content small {
  color: #ccc;
  font-size: 11px;
}

.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.remove-btn:hover {
  background: rgba(255, 0, 0, 1);
}

.continue-watching-row::-webkit-scrollbar {
  height: 8px;
}

.continue-watching-row::-webkit-scrollbar-track {
  background: #333;
  border-radius: 4px;
}

.continue-watching-row::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.continue-watching-row::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.continue-watching-card {
  flex: 0 0 160px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  min-width: 160px;
  max-width: 160px;
}

.continue-watching-card:hover {
  transform: scale(1.05);
}

.continue-watching-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  max-width: 100%;
}

.continue-watching-card .progress-container {
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0 0 6px 6px;
  z-index: 10;
}

.continue-watching-card .progress-bar {
  height: 100%;
  background: #e50914;
  border-radius: 0 0 6px 6px;
  transition: width 0.3s ease;
}

.continue-watching-card p {
  margin: 6px 0 0;
  font-size: 14px;
  text-align: center;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-watching-card small {
  display: block;
  text-align: center;
  color: #999;
  font-size: 12px;
  margin-top: 2px;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover Tooltip for Continue Watching Cards */
.hover-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  z-index: 2000;
  min-width: 200px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.hover-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.continue-watching-card {
  position: relative;
}

/* Hover states are now handled by JavaScript with the 'visible' class */

.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e50914;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.remove-btn:hover {
  background: #b20710;
  transform: scale(1.1);
}

.remove-btn::after {
  content: "Elimina dalla cronologia";
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2001;
  border: 1px solid #e50914;
}

.remove-btn:hover::after {
  opacity: 1;
  visibility: visible;
  top: -40px;
}

.remove-btn::before {
  content: "";
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1002;
}

.remove-btn:hover::before {
  opacity: 1;
  visibility: visible;
  top: -50px;
}

.tooltip-content {
  padding-top: 8px;
}

.tooltip-content .episode-info,
.tooltip-content .movie-info {
  color: white;
  font-size: 12px;
  line-height: 1.4;
}

.tooltip-content strong {
  color: #e50914;
}

/* Chat AI Styles */
#chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.4);
  font-size: 24px;
  z-index: 10001;
  transition: all 0.3s ease;
}

#chat-button:hover {
  transform: scale(1.1);
  background: #b20710;
}

#chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 500px;
  background: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  z-index: 10001;
  overflow: hidden;
  border: 2px solid #e50914;
}

#chat-window.active {
  display: flex;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #141414;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #333;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #e50914;
  border-radius: 3px;
}

.message {
  margin-bottom: 12px;
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  justify-content: flex-end;
  text-align: right;
}

.message.bot {
  justify-content: flex-start;
  text-align: left;
}

.message-content {
  width: fit-content;
  min-width: fit-content;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 14px;
  display: inline-block;
  box-sizing: border-box;
}

.message.bot .message-content {
  background: #333;
  color: white;
  border: 1px solid rgba(229, 9, 20, 0.3);
}

.message.user .message-content {
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
}

.typing {
  padding: 10px 14px;
  font-style: italic;
  color: #999;
  font-size: 14px;
}

.chat-input-area {
  padding: 16px;
  background: #1a1a1a;
  border-top: 1px solid #333;
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #333;
  border-radius: 20px;
  outline: none;
  background: #141414;
  color: white;
  font-size: 14px;
  font-family: inherit;
}

#chat-input:focus {
  border-color: #e50914;
}

#chat-input::placeholder {
  color: #999;
}

#send-btn {
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.2s;
}

#send-btn:hover {
  background: #b20710;
  transform: scale(1.05);
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #chat-button {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 20px;
    right: 20px;
  }

  #chat-window {
    width: calc(100% - 40%);
    height: 400px;
    right: 20px;
    bottom: 80px;
  }

  .chat-header h3 {
    font-size: 16px;
  }

  .message-content {
    font-size: 13px;
    padding: 8px 12px;
  }

  #chat-messages {
    padding: 12px;
  }

  .message {
    margin-bottom: 10px;
  }

  .chat-input-area {
    padding: 12px !important;
    gap: 8px !important;
  }

  #chat-input {
    padding: 8px 12px !important;
    font-size: 13px !important;
    min-height: 36px !important;
  }

  #send-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 480px) {
  .chat-input-area {
    padding: 8px !important;
    gap: 6px !important;
  }

  #chat-input {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    border-radius: 16px !important;
  }

  #send-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    border-radius: 16px !important;
  }
}

.progress-details {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-small {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #e50914;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tooltip-content small {
  color: #ccc;
  font-size: 11px;
  white-space: nowrap;
}

/* Dynamic Tooltip */
.dynamic-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  z-index: 9999;
  pointer-events: none;
  min-width: 200px;
  max-width: 250px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
  font-size: 12px;
  line-height: 1.4;
}

.dynamic-tooltip .tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
}

.dynamic-tooltip .tooltip-title {
  color: white;
  font-weight: bold;
  font-size: 14px;
  flex: 1;
}

.dynamic-tooltip .tooltip-buttons {
  display: flex;
  gap: 8px;
}

.dynamic-tooltip .tooltip-play-btn {
  background: white;
  color: black;
  border: 2px solid white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-right: 8px;
}

.dynamic-tooltip .tooltip-play-btn:hover {
  background: black;
  color: white;
  transform: scale(1.1);
}

.dynamic-tooltip .tooltip-remove-btn {
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dynamic-tooltip .tooltip-remove-btn:hover {
  background: rgba(255, 0, 0, 1);
  transform: scale(1.1);
}

.dynamic-tooltip .episode-info strong {
  color: white;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
}

.dynamic-tooltip .movie-info {
  color: #e50914;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
}

.dynamic-tooltip .episode-name {
  color: white;
  font-size: 12px;
  margin-bottom: 8px;
  font-style: italic;
}

.dynamic-tooltip .progress-details {
  margin-top: 6px;
}

.dynamic-tooltip .progress-bar-small {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.dynamic-tooltip .progress-fill {
  height: 100%;
  background: #e50914;
  transition: width 0.3s ease;
}

.dynamic-tooltip small {
  color: #ccc;
  font-size: 11px;
}

/* Popover Tooltip Styles */
.popover-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  z-index: 9999;
  pointer-events: auto;
  min-width: 200px;
  max-width: 250px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
  font-size: 12px;
  line-height: 1.4;
}

.popover-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px;
  border-color: transparent;
}

.popover-below .popover-arrow {
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: rgba(0, 0, 0, 0.95);
  border-top: none;
}

.popover-above .popover-arrow {
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(0, 0, 0, 0.95);
  border-bottom: none;
}

.popover-content {
  color: white;
}

/* Upcoming tooltip redesign */
.upcoming-tooltip {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px 10px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.upcoming-tooltip__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
  color: #fff;
}

.upcoming-tooltip__line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  gap: 4px;
}

.upcoming-tooltip__label {
  color: #cfcfcf;
  font-weight: 600;
}

.upcoming-tooltip__label-group {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.upcoming-tooltip__sep {
  margin: 0 6px;
  color: #f2c94c;
  font-weight: 700;
}

.upcoming-tooltip__date {
  color: #f2c94c;
  font-weight: 700;
  margin-left: 0;
}

.upcoming-tooltip__date-prefix {
  color: #cfcfcf;
  font-weight: 600;
  margin-right: 4px;
}

.upcoming-tooltip__label-season {
  color: #4CAF50;
  font-weight: 700;
  margin-right: 4px;
}

.upcoming-tooltip__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.upcoming-tooltip__provider {
  background: #1b1b1b;
  color: #fff;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #303030;
}

.upcoming-tooltip__season,
.upcoming-tooltip__type {
  background: transparent;
  color: #cfcfcf;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #2a2a2a;
}

.upcoming-tooltip__genre {
  background: transparent;
  color: #cfcfcf;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #2a2a2a;
}

* {
  cursor: none !important;
  /* nasconde cursore standard */
}

.box.arrow {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  background: url("https://i.ibb.co/sd9S9Nc1/navigation.png") no-repeat center
    center;
  background-size: contain;
  z-index: 99999999999;
  transition: transform 0.05s ease-out;
}

a,
button,
input,
textarea {
  cursor: none !important;
}

input[type="range"] {
  cursor: none !important;
}

.top10-container {
  position: relative;
  z-index: 1;
}

.top10-container img {
  margin-left: 60px;
}

.top10-number {
  position: absolute;
  left: -40px;
  bottom: 65px;
  scale: 2.3;
  width: 60px;
  height: 90px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}

.svg-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.svg-icon-rank-10 {
  left: -15px !important;
}

.top10-number-rank-1 {
  margin-left: 30px;
}

.top10-number-rank-10 {
  left: -10px;
}

.card-image-container {
  position: relative;
  z-index: 2;
}

.card-image-container img {
  position: relative;
  z-index: 2;
}

/* ===================================
   TRAFLIX - MOBILE RESPONSIVE IMPROVEMENTS
   =================================== */

/* ========================================
   1. HEADER & NAVBAR MOBILE
   ======================================== */

@media (max-width: 1024px) {
  header {
    padding: 15px 20px;
  }

  .navbar {
    gap: 30px;
  }

  .logo-container h1 {
    font-size: 24px;
  }

  .logo_traflix {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 15px;
  }

  /* Navbar a 2 righe */
  .navbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }

  /* Prima riga: Logo */
  .logo-container {
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
  }

  .logo-container h1 {
    font-size: 24px;
  }

  .logo_traflix {
    width: 30px;
    height: 30px;
  }

  /* Ricerca: absolute positioning accanto al logo */
  .header-right .search-container {
    position: absolute;
    top: 10px;
    left: 75%;
    transform: translateX(-50%);
    z-index: 200;
  }

  /* Sposta il search a sinistra quando viene ingrandito su mobile */
  .header-right .search-container input:focus,
  .header-right .search-container input.expanded {
    transform: translateX(-100px) !important;
  }

  .header-right .search-container input:focus ~ .search,
  .header-right .search-container input.expanded ~ .search {
    transform: translateX(50px) !important;
  }

  /* Header-right: seconda riga senza search */
  .header-right {
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: space-around;
    flex-wrap: nowrap;
    font-size: clamp(12px, 2.5vw, 14px);
    padding: 4px 0;
    font-weight: 600;
    margin-right: 0;
  }

  /* Spazio per il logo senza che search copra */
  .logo-container {
    padding-right: 80px; /* Spazio per la ricerca assoluta */
  }

  /* Search container nella prima riga - ridimensionamento base */
  .search-container {
    scale: 0.7;
  }

  /* Proxy container e selector - font piccolo */
  .proxy-container select,
  #proxySelector {
    font-size: 10px !important;
    padding: 5px 28px 5px 10px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    line-height: normal !important;
    border-radius: 6px !important;
  }

  .user-profile {
    font-size: 15px;
    position: relative;
    z-index: 100;
  }

  .user-profile-btn,
  button.user-profile-btn {
    font-size: 15px !important;
    padding: 5px 8px !important;
    position: relative;
    z-index: 100;
    min-height: auto !important;
    line-height: normal !important;
    font-weight: 600;
  }

  #username {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
  }

  /* Login container */
  .login-container {
    position: relative;
    z-index: 100;
    padding: 4px 0;
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  header {
    padding: 8px 10px;
  }

  .logo-container h1 {
    font-size: 24px;
    position: absolute;
    margin-top: 20px;
    margin-left: 30px;
  }

  .logo_traflix {
    width: 28px;
    height: 28px;
    position: absolute;
    margin-top: 8px;
  }

  .header-right button#tabHome,
  button#tabHome.active,
  button#tabHome {
    padding: 5px 8px !important;
    font-size: 15px !important;
    min-height: auto !important;
    line-height: normal !important;
    font-weight: 600;
    scale: 0.8;
  }

  .search-container {
    scale: 0.5;
    margin-top: -8px;
  }

  .search-container input:focus,
  .search-container input.expanded {
    width: 100px;
    transform: translateX(-40px);
  }

  .proxy-container select {
    font-size: 10px;
    padding: 4px 24px 4px 8px;
    border-radius: 6px;
  }

  /* User menu mobile */
  .user-profile-btn {
    font-size: 15px !important;
    padding: 5px 8px !important;
    font-weight: 600;
  }

  .user-dropdown {
    right: 0;
    left: auto;
    min-width: 180px;
  }

  .dropdown-item {
    font-size: 13px;
    padding: 10px 12px;
  }


  /* Login button - more breathing room on mobile */
  .header-right .login-btn,
  .header-right #loginBtn,
  .login-container .login-btn,
  .login-container #loginBtn,
  button.login-btn,
  button#loginBtn,
  button#tabBrowse {
    font-size: 15px !important;
    padding: 5px 8px !important;
    min-height: auto !important;
    line-height: normal !important;
    font-weight: 600;
    scale: 0.8;
  }
  .header-right {
    margin-top: 10px;
  }




  #username {
    max-width: 60px;
  }
}

/* ========================================
   2. CONTAINER & LAYOUT PRINCIPALE
   ======================================== */

@media (max-width: 768px) {
  .container {
    margin-top: 100px;
    padding: 10px;
  }

  body {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .container {
    margin-top: 90px;
    padding: 5px;
  }
}

/* ========================================
   3. CARDS & GRID
   ======================================== */

@media (max-width: 1024px) {
  .row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
  }

  .card {
    width: 100%;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .card img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
  }
}

@media (max-width: 768px) {
  .row {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .row {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
}

/* ========================================
   4. PLAYER & VIDEO
   ======================================== */

@media (max-width: 768px) {
  .player {
    margin: 10px 0;
    border-radius: 4px;
  }

  .player iframe,
  .player video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
    max-height: 300px;
  }

  /* Series controls */
  .series-controls {
    padding: 10px;
    flex-direction: column;
    gap: 10px;
  }

  .series-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .series-actions button {
    width: auto;
    font-size: 14px;
    padding: 10px 15px;
  }

  .season-selector button {
    font-size: 14px;
    padding: 8px 12px;
  }

  .episode-timeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .player iframe,
  .player video {
    max-height: 220px;
  }

  .series-actions button {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ========================================
   5. FOOTER
   ======================================== */

@media (max-width: 768px) {
  footer {
    padding: 20px 15px;
    font-size: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 15px 10px;
    font-size: 11px;
  }
}

/* ========================================
   6. ACCOUNT PAGE
   ======================================== */

@media (max-width: 768px) {
  .account-container {
    padding: 15px;
    margin-top: 100px;
  }

  .account-header h1 {
    font-size: 24px;
  }

  .account-form input,
  .account-form textarea,
  .account-form select {
    font-size: 14px;
    padding: 10px;
  }

  .account-form button {
    font-size: 14px;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .account-container {
    padding: 10px;
    margin-top: 90px;
  }

  .account-header h1 {
    font-size: 20px;
  }

  .account-form input,
  .account-form textarea {
    font-size: 13px;
    padding: 8px;
  }
}

/* ========================================
   7. LIST PAGE (La Mia Lista)
   ======================================== */

@media (max-width: 768px) {
  .list-container {
    padding: 15px;
    margin-top: 100px;
  }

  .list-header h1 {
    font-size: 24px;
  }

  .list-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .list-container {
    padding: 10px;
    margin-top: 90px;
  }

  .list-header h1 {
    font-size: 20px;
  }

  .list-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
}

/* ========================================
   8. HISTORY PAGE
   ======================================== */

@media (max-width: 768px) {
  .history-container {
    padding: 15px;
    margin-top: 100px;
  }

  .history-header h1 {
    font-size: 24px;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
  }

  .history-poster {
    width: 80px;
    height: 120px;
  }

  .history-info h3 {
    font-size: 16px;
  }

  .history-info p {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .history-container {
    padding: 10px;
    margin-top: 90px;
  }

  .history-header h1 {
    font-size: 20px;
  }

  .history-poster {
    width: 60px;
    height: 90px;
  }

  .history-info h3 {
    font-size: 14px;
  }
}

/* ========================================
   9. ADMIN PANEL
   ======================================== */

@media (max-width: 768px) {
  .admin-container {
    padding: 15px;
    margin-top: 100px;
  }

  .admin-header h1 {
    font-size: 24px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-stat-card {
    padding: 15px;
  }

  .admin-stat-card h3 {
    font-size: 16px;
  }

  .admin-stat-card .stat-value {
    font-size: 28px;
  }

  .admin-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table table {
    min-width: 600px;
  }

  .admin-table th,
  .admin-table td {
    font-size: 12px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .admin-container {
    padding: 10px;
    margin-top: 90px;
  }

  .admin-header h1 {
    font-size: 20px;
  }

  .admin-stat-card {
    padding: 12px;
  }

  .admin-stat-card .stat-value {
    font-size: 24px;
  }
}

/* Admin Panel - Mobile Table Card Layout */
@media (max-width: 768px) {
  .admin-table {
    display: block;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    background: #1f1f1f;
    border-radius: 6px;
    margin-bottom: 6px;
    padding: 8px;
    border: 1px solid #333;
  }

  .admin-table tr:hover {
    background: #252525;
  }

  .admin-table td {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid #333;
    text-align: right;
    white-space: normal;
    overflow: visible;
  }

  .admin-table td:last-child {
    border-bottom: none;
    padding-top: 8px;
    justify-content: flex-start;
    gap: 5px;
  }

  .admin-table td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #e50914;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 8px;
  }

  .admin-table td[data-label="Azioni"] {
    flex-wrap: wrap;
  }

  .admin-table button {
    padding: 6px 10px;
    font-size: 11px;
    margin: 2px;
  }

  .admin-table code {
    font-size: 10px;
    padding: 2px 5px;
  }

  .admin-table .badge-verified,
  .admin-table .badge-unverified {
    font-size: 11px;
  }
}

/* ========================================
   10. SEARCH PAGE
   ======================================== */

@media (max-width: 768px) {
  .search-page-container {
    padding: 15px;
    margin-top: 100px;
  }

  .search-input-large {
    font-size: 16px;
    padding: 12px 15px;
  }

  .search-results {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .search-page-container {
    padding: 10px;
    margin-top: 90px;
  }

  .search-input-large {
    font-size: 14px;
    padding: 10px 12px;
  }

  .search-results {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
}

/* ========================================
   11. INFO PAGE
   ======================================== */

@media (max-width: 768px) {
  .info-container {
    padding: 15px;
    margin-top: 100px;
  }

  .info-hero {
    height: 300px;
  }

  .info-content {
    flex-direction: column;
    padding: 15px;
  }

  .info-poster {
    width: 150px;
    height: auto;
    margin: 0 auto 20px;
  }

  .info-details h1 {
    font-size: 24px;
  }

  .info-details .overview {
    font-size: 14px;
  }

  .info-actions {
    flex-direction: column;
    gap: 10px;
  }

  .info-actions button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  /* Serie TV - Episodi e Stagioni */
  .series-episodes-container {
    width: 100% !important;
    margin: 20px 0 !important;
    padding: 0 !important;
  }

  .series-selector {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0;
  }

  .season-selector {
    margin-bottom: 15px;
    position: relative;
    z-index: 100;
  }

  .season-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    background: #333;
    color: white;
    border: 2px solid #555;
    border-radius: 8px;
  }

  .season-dropdown {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #222;
    border: 2px solid #555;
    border-radius: 8px;
    margin-top: 5px;
  }

  .season-option {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #444;
  }

  .season-option:last-child {
    border-bottom: none;
  }

  /* Episode timeline - griglia su mobile */
  .episode-timeline-scroll-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .episode-timeline {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 12px !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    padding: 10px 0 !important;
    margin: 0 !important;
  }

  /* Nascondi le frecce di scroll su mobile */
  .slide-left,
  .slide-right {
    display: none !important;
  }

  /* Episode card ottimizzata per mobile */
  .episode-card {
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .episode-card img {
    height: 100px;
  }

  .episode-info h4 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .episode-overview {
    font-size: 11px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: 50px;
  }

  .episode-date {
    font-size: 10px;
    bottom: 5px;
    left: 10px;
  }

  /* Serie actions buttons */
  .series-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
  }

  .series-actions button {
    width: auto;
    max-width: 100%;
    padding: 12px 16px;
    font-size: 14px;
  }

  .play-series-btn,
  .episodes-btn {
    width: auto;
  }

  /* Progress section mobile */
  .progress-section {
    padding: 12px;
    margin-bottom: 20px;
  }

  .progress-info {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .info-hero {
    height: 200px;
  }

  .info-details h1 {
    font-size: 20px;
  }

  .info-details .overview {
    font-size: 13px;
  }

  /* Episode timeline ancora più compatto */
  .episode-timeline {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .episode-card img {
    height: 80px;
  }

  .history-page .episode-info {
    padding: 8px;
  }

  .history-page .episode-info h4 {
    font-size: 12px;
  }

  .episode-overview {
    font-size: 10px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 35px;
  }

  .season-btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .series-actions button {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ========================================
   12. MODALS & DIALOGS
   ======================================== */

@media (max-width: 768px) {
  .modal {
    padding: 15px;
  }

  .modal-content {
    width: 95%;
    max-width: none;
    padding: 20px;
    margin: 20px auto;
  }

  .modal-header h2 {
    font-size: 20px;
  }

  .modal-body {
    font-size: 14px;
  }

  .modal-footer button {
    font-size: 14px;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 15px;
    border-radius: 8px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-body {
    font-size: 13px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer button {
    width: 100%;
  }
}

/* ========================================
   13. TOUCH IMPROVEMENTS
   ======================================== */

/* ========================================
   14. SCROLLBAR MOBILE
   ======================================== */

@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-thumb {
    background: #e50914;
    border-radius: 3px;
  }

  ::-webkit-scrollbar-track {
    background: #141414;
  }
}

/* ========================================
   15. HAMBURGER MENU (Opzionale)
   ======================================== */

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    order: 3;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: 0.3s;
  }

  .header-right.mobile-hidden {
    display: none;
  }

  .mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.98);
    padding: 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .mobile-menu.open {
    transform: translateY(0);
  }

  .mobile-menu-item {
    display: block;
    padding: 15px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #333;
    font-size: 16px;
  }

  .mobile-menu-item:hover {
    background: rgba(229, 9, 20, 0.1);
  }
}

/* ========================================
   16. LANDSCAPE MOBILE OPTIMIZATION
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {
  header {
    padding: 8px 15px;
  }

  .container {
    margin-top: 70px;
  }

  .player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
  }

  .player.fullscreen iframe,
  .player.fullscreen video {
    max-height: 100vh;
  }
}

/* ========================================
   17. LOADING & SKELETON MOBILE
   ======================================== */

@media (max-width: 768px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
  }

  .skeleton-card {
    height: 180px;
  }
}

/* ========================================
   18. ACCESSIBILITY IMPROVEMENTS
   ======================================== */

@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  button:focus-visible,
  a:focus-visible,
  input:focus-visible {
    outline: 2px solid #e50914;
    outline-offset: 2px;
  }
}

/* ========================================
   19. PERFORMANCE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
  }

  .backdrop-blur {
    backdrop-filter: none;
    background: rgba(0, 0, 0, 0.9);
  }
}

/* ========================================
   20. NOTCH/SAFE AREA (iPhone X+)
   ======================================== */

@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    header {
      padding-left: max(15px, env(safe-area-inset-left));
      padding-right: max(15px, env(safe-area-inset-right));
      padding-top: max(10px, env(safe-area-inset-top));
    }

    .container {
      padding-left: max(10px, env(safe-area-inset-left));
      padding-right: max(10px, env(safe-area-inset-right));
      padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    footer {
      padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    #chat-button {
      bottom: max(20px, env(safe-area-inset-bottom));
      right: max(20px, env(safe-area-inset-right));
    }
  }
}

/* ========================================
   21. NETLIFY IDENTITY WIDGET FIX
   ======================================== */

/* Fix z-index del modal Netlify Identity - deve stare sotto l'header */
.netlify-identity-widget,
[data-netlify-identity-menu],
.netlify-identity-modal,
iframe[title*="netlify"],
iframe[title*="identity"] {
  z-index: 999 !important;
}

/* Header deve stare sopra il modal */
header {
  z-index: 1001 !important;
  position: fixed;
}

/* Tutti i container del widget Netlify */
div[class*="netlify"],
div[data-netlify-identity],
[data-netlify-identity-menu] {
  z-index: 999 !important;
}

/* Modal Netlify più piccolo e centrato su mobile */
@media (max-width: 768px) {
  /* Container del widget Netlify - TUTTI i selettori possibili */
  .netlify-identity-widget,
  div[class*="netlify-identity"],
  [data-netlify-identity-menu] {
    transform: scale(0.9) !important;
    transform-origin: center center !important;
  }

  /* Modal del login - TUTTI i selettori possibili */
  [role="dialog"].netlify-identity-modal,
  .netlify-identity-modal,
  div[class*="modal"][class*="netlify"],
  iframe[title*="netlify"],
  iframe[title*="identity"] {
    width: 90% !important;
    max-width: 420px !important;
    height: auto !important;
    max-height: 80vh !important;
    min-height: 320px !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    border-radius: 12px !important;
    overflow-y: auto !important;
    position: fixed !important;
  }

  /* Header del modal Netlify */
  .netlify-identity-modal .netlify-identity-header,
  div[class*="netlify"] header,
  div[class*="modal"] header {
    padding: 15px !important;
    font-size: 18px !important;
  }

  /* Bottone chiudi (X) più grande e visibile - TUTTI i selettori */
  .netlify-identity-modal .netlify-identity-btn-close,
  .netlify-identity-modal button[aria-label="Close"],
  .netlify-identity-modal button[aria-label="close"],
  div[class*="netlify"] button[aria-label*="lose"],
  div[class*="modal"] button[class*="close"],
  button.close,
  button[title*="Close"],
  button[title*="close"] {
    width: 44px !important;
    height: 44px !important;
    font-size: 32px !important;
    line-height: 44px !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50% !important;
    color: white !important;
    opacity: 1 !important;
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
  }

  /* Hover sul pulsante X */
  .netlify-identity-modal button[aria-label="Close"]:hover,
  button.close:hover {
    background: rgba(229, 9, 20, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
  }

  /* Body del modal */
  .netlify-identity-modal .netlify-identity-body,
  div[class*="netlify"] form,
  div[class*="modal"] form {
    padding: 20px 15px !important;
  }

  /* Form fields più grandi per touch - TUTTI i selettori */
  .netlify-identity-modal input[type="text"],
  .netlify-identity-modal input[type="email"],
  .netlify-identity-modal input[type="password"],
  div[class*="netlify"] input[type="text"],
  div[class*="netlify"] input[type="email"],
  div[class*="netlify"] input[type="password"],
  form input[type="text"],
  form input[type="email"],
  form input[type="password"] {
    font-size: 16px !important;
    padding: 14px 12px !important;
    height: auto !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
  }

  /* Pulsanti più grandi - TUTTI i selettori */
  .netlify-identity-modal button[type="submit"],
  .netlify-identity-modal .btnPrimary,
  .netlify-identity-modal button.btn,
  div[class*="netlify"] button[type="submit"],
  div[class*="netlify"] .btnPrimary,
  form button[type="submit"],
  form button.btn {
    font-size: 16px !important;
    padding: 14px 20px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
  }

  /* Footer del modal */
  .netlify-identity-modal .netlify-identity-footer,
  div[class*="netlify"] footer {
    padding: 15px !important;
    font-size: 14px !important;
  }

  /* Link nel modal */
  .netlify-identity-modal a,
  div[class*="netlify"] a {
    font-size: 14px !important;
    padding: 8px !important;
    min-height: 32px !important;
    display: inline-block !important;
  }
}

@media (max-width: 480px) {
  /* Modal ancora più compatto su smartphone */
  .netlify-identity-widget,
  div[class*="netlify-identity"] {
    transform: scale(0.88) !important;
  }

  .netlify-identity-modal,
  div[class*="modal"][class*="netlify"] {
    width: 95% !important;
    max-width: 380px !important;
    max-height: 80vh !important;
    min-height: 300px !important;
    border-radius: 10px !important;
    padding: 10px !important;
  }

  .netlify-identity-modal .netlify-identity-header {
    padding: 12px 10px !important;
    font-size: 16px !important;
  }

  .netlify-identity-modal .netlify-identity-body {
    padding: 15px 10px !important;
  }

  /* Input e pulsanti ancora più compatti */
  .netlify-identity-modal input,
  div[class*="netlify"] input {
    padding: 12px 10px !important;
    min-height: 44px !important;
    font-size: 16px !important;
  }

  .netlify-identity-modal button[type="submit"],
  div[class*="netlify"] button[type="submit"] {
    padding: 12px 16px !important;
    min-height: 44px !important;
  }

  /* X button su smartphone */
  button[aria-label="Close"],
  button.close {
    width: 40px !important;
    height: 40px !important;
    font-size: 28px !important;
    top: 5px !important;
    right: 5px !important;
  }
}

/* Overlay/backdrop più scuro - TUTTI i selettori */
[data-netlify-identity-menu] ~ div,
.netlify-identity-backdrop,
div[class*="backdrop"],
div[class*="overlay"] {
  background: rgba(0, 0, 0, 0.85) !important;
  z-index: 998 !important;
}

/* ========================================
   18. SEARCH RESULTS GRID MOBILE
   ======================================== */

/* Stili base per griglia risultati ricerca */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 20px;
  padding: 20px 0;
}

.home-section-card {
  cursor: pointer;
  transition: transform 0.2s;
}

.home-section-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}

/* Mobile: tablet e smartphone grandi */
@media (max-width: 1024px) {
  .search-results-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 15px !important;
  }

  .home-section-card {
    min-width: 140px;
  }
}

/* Mobile: smartphone */
@media (max-width: 768px) {
  .search-results-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    padding: 15px 0 !important;
  }

  .home-section-card {
    min-width: 100px;
  }

  .home-section-card img {
    border-radius: 4px;
  }
}

/* Mobile: smartphone piccoli */
@media (max-width: 480px) {
  .search-results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px 0 !important;
  }

  .home-section-card {
    min-width: 140px;
  }
}

/* Admin System Controls */
.system-controls-section {
    margin: 30px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    margin: 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.status-card {
    background: #1f1f1f;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.status-card:hover {
    transform: translateY(-2px);
    border-color: #e50914;
    box-shadow: 0 8px 15px rgba(229, 9, 20, 0.1);
}

.status-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #e50914;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-enabled {
    background-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-disabled {
    background-color: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.status-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.toggle-btn {
    flex: 1;
    background: #e50914;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #b20710;
    transform: scale(1.02);
}

.toggle-btn.secondary {
    background: #333;
}

.toggle-btn.secondary:hover {
    background: #444;
}

.refresh-btn {
    background: #333;
    border: 1px solid #444;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #444;
    border-color: #e50914;
}

.refresh-btn.mini {
    padding: 8px 15px;
    font-size: 13px;
    background: rgba(229,9,20,0.1);
    border-color: rgba(229,9,20,0.3);
}

.refresh-btn.mini:hover {
    background: #e50914;
}

.status-history {
    margin-top: 40px;
}

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

.history-header h3 {
    margin: 0;
    font-size: 18px;
}

.last-check-badge {
    font-size: 12px;
    color: #999;
    background: #2a2a2a;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #333;
}

.system-info {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #222;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.info-item {
    background: #222;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.info-item strong {
    color: #e50914;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SPRINT 1 - DESIGN SYSTEM + HOME HERO
   ======================================== */

:root {
  --color-bg: #0f1112;
  --color-surface: #1b1d20;
  --color-surface-elev: #24262b;
  --color-text: #f4f4f5;
  --color-text-soft: #bbbcc0;
  --color-accent: #e50914;
  --color-accent-strong: #b20710;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 18px 38px rgba(0, 0, 0, 0.5);
  --motion-fast: 160ms;
  --motion-base: 220ms;
}

header {
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.97), rgba(8, 8, 8, 0.84)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow-soft);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-base) ease;
  -webkit-tap-highlight-color: transparent;
}

.card:hover {
  box-shadow: var(--shadow-strong);
}

.card--default {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card--continue {
  border: none;
}

.continue-watching-card.card--continue {
  border: none !important;
  box-shadow: none !important;
}

.card--top10 {
  border: none;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  border-radius: 0;
}

.card--top10:hover {
  box-shadow: none;
}

.card--ai-pick {
  border: 1px solid rgba(57, 220, 164, 0.45);
}

.cinematic-hero {
  position: relative;
  min-height: 250px;
  margin: 6px 0 20px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-strong);
}

.cinematic-hero.is-hidden {
  display: none;
}

.cinematic-hero__content {
  max-width: 520px;
  padding: 24px 22px;
}

.cinematic-hero__eyebrow {
  color: #ffbac0;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.cinematic-hero__title {
  margin: 0 0 10px;
  font-size: clamp(22px, 3.1vw, 32px);
  line-height: 1.1;
}

.cinematic-hero__meta {
  margin: 0 0 12px;
  color: var(--color-text-soft);
  font-size: 14px;
}

.cinematic-hero__overview {
  margin: 0 0 18px;
  color: var(--color-text);
  line-height: 1.45;
  font-size: 14px;
  max-height: 5.8em;
  overflow: hidden;
}

.cinematic-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-loading {
  max-width: 520px;
  padding: 24px 22px;
}

.hero-loading-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d6d6d8;
  font-size: 13px;
  margin-bottom: 12px;
}

.hero-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e50914;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.55);
  animation: heroDotPulse 1s ease-in-out infinite;
}

.hero-loading-line {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #2e2e31 20%, #3d3d42 40%, #2e2e31 60%);
  background-size: 220% 100%;
  animation: heroShimmer 1.2s linear infinite;
  margin-bottom: 8px;
}

.hero-loading-line--title {
  width: min(390px, 90%);
  height: 24px;
}

.hero-loading-line--meta {
  width: min(250px, 65%);
}

.hero-loading-line--overview {
  width: min(460px, 96%);
}

.hero-loading-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.hero-loading-btn {
  width: 120px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e2e31 20%, #3d3d42 40%, #2e2e31 60%);
  background-size: 220% 100%;
  animation: heroShimmer 1.2s linear infinite;
}

.hero-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--motion-fast) ease, background var(--motion-base) ease;
}

.hero-btn:hover {
  transform: translateY(-1px);
}

.hero-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.hero-btn--primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
}

.hero-btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-btn--ghost {
  background: rgba(8, 8, 8, 0.48);
  border-color: rgba(255, 255, 255, 0.26);
}

/* Pulsanti navigazione Hero (simili a slide-left/slide-right in info.html) */
.hero-nav-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to right, rgba(20, 20, 20, 0.8), transparent);
  border: none;
  cursor: pointer;
  z-index: 10;
  opacity: 0.6;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hero-nav-btn::before {
  content: "<<";
  font-weight: bold;
}

.hero-nav-btn--next::before {
  content: ">>";
}

.hero-nav-btn:hover {
  opacity: 1;
  background: linear-gradient(to right, rgba(229, 9, 20, 0.5), rgba(229, 9, 20, 0.2), transparent);
}

.hero-nav-btn--prev {
  left: 0;
  background: linear-gradient(to right, rgba(20, 20, 20, 0.8), transparent);
}

.hero-nav-btn--next {
  right: 0;
  background: linear-gradient(to left, rgba(20, 20, 20, 0.8), transparent);
}

.hero-nav-btn--next:hover {
  background: linear-gradient(to left, rgba(229, 9, 20, 0.5), rgba(229, 9, 20, 0.2), transparent);
}

@keyframes heroShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes heroDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

.app-state {
  margin: 16px auto 28px;
  width: min(760px, 100%);
  padding: 26px 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  text-align: center;
}

.app-state-title {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
}

.app-state-detail {
  margin: 8px 0 0;
  color: var(--color-text-soft);
  font-size: 14px;
}

.app-state--error {
  border-color: rgba(244, 67, 54, 0.55);
}

.app-state--loading {
  border-color: rgba(229, 9, 20, 0.45);
}

.app-state--empty {
  border-color: rgba(255, 255, 255, 0.18);
}

@media (max-width: 768px) {
  .cinematic-hero {
    min-height: 220px;
    margin-top: 0;
    border-radius: var(--radius-md);
  }

  .cinematic-hero__content {
    padding: 18px 16px;
  }

  .cinematic-hero__actions {
    gap: 8px;
  }

  .hero-btn {
    width: auto;
    min-width: 100px;
    padding: 8px 16px;
    font-size: 13px;
  }

  .cinematic-hero__overview {
    display: none;
  }
}

/* Hero Trailer Center */
.hero-trailer-center {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.hero-trailer-center.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero-trailer-center__content {
  position: relative;
  width: min(900px, 90vw);
  max-width: 900px;
  background: #141414;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.hero-trailer-center.is-active .hero-trailer-center__content {
  transform: scale(1);
}

.hero-trailer-center__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-trailer-center__close:hover {
  background: rgba(229, 9, 20, 0.95);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-trailer-center__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.hero-trailer-center__player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .hero-trailer-center__content {
    width: 100%;
    margin: 20px;
  }

  .hero-trailer-center__close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}

/* Hero Progress Bar */
.hero-buttons-wrapper {
  display: inline-flex;
  flex-direction: column;
  width: auto;
}

.hero-buttons-row {
  display: flex;
  gap: 10px;
}

.hero-progress-bar-compact {
  margin-top: 16px;
  width: 100%;
}

.hero-progress-bar__track {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.hero-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ========================================
   SEARCH FILTERS — Premium Redesign
   ======================================== */

.search-filters-panel {
  display: none;
  margin: 12px 0 20px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: filterPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes filterPanelIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------- Header ------- */
.search-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.search-filters-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text, #f4f4f5);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.search-filters-title svg {
  color: var(--color-accent, #e50914);
  flex-shrink: 0;
}

/* ------- Grid ------- */
.search-filters-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

/* ------- Filter Item ------- */
.search-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 200px;
}

.search-filter-item > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-soft, #bbbcc0);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-filter-item > span svg {
  opacity: 0.65;
  flex-shrink: 0;
}

.search-filter-item select,
.search-filter-item input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.65);
  color: #fff;
  padding: 0 32px 0 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color var(--motion-fast, 160ms) ease,
    box-shadow var(--motion-fast, 160ms) ease,
    background var(--motion-fast, 160ms) ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.search-filter-item select:hover,
.search-filter-item input:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(18, 18, 18, 0.8);
}

.search-filter-item select:focus-visible,
.search-filter-item input:focus-visible {
  outline: none;
  border-color: rgba(229, 9, 20, 0.65);
  box-shadow:
    0 0 0 3px rgba(229, 9, 20, 0.15),
    0 2px 8px rgba(229, 9, 20, 0.08);
}

/* ------- Footer ------- */
.search-filters-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

/* ------- Chips ------- */
.search-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(229, 9, 20, 0.3);
  background: rgba(229, 9, 20, 0.08);
  color: #f1f1f1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: chipIn 0.24s ease both;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.search-filter-chip.is-muted {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.search-filter-count {
  color: #cfd1d4;
  font-size: 13px;
  margin-left: 4px;
  font-weight: 500;
}

/* ------- Reset Button ------- */
.search-filters-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #a0a2a6;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  flex: 0 0 auto;
  transition:
    color var(--motion-fast, 160ms) ease,
    background var(--motion-fast, 160ms) ease,
    border-color var(--motion-fast, 160ms) ease;
}

.search-filters-reset svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.search-filters-reset:hover {
  background: rgba(229, 9, 20, 0.1);
  border-color: rgba(229, 9, 20, 0.35);
  color: #fff;
}

.search-filters-reset:hover svg {
  transform: rotate(-45deg);
}

/* ------- Responsive ------- */
@media (max-width: 1100px) {
  .search-filter-item {
    min-width: 130px;
    max-width: 180px;
  }
}

@media (max-width: 680px) {
  .search-filters-panel {
    padding: 14px 14px 12px;
    border-radius: 14px;
  }

  .search-filters-grid {
    gap: 10px;
  }

  .search-filter-item {
    min-width: 0;
    max-width: none;
    flex: 1 1 calc(50% - 10px);
  }

  .search-filters-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
}
/* Material Design 3 Button System - Vanilla CSS adaptation */

:root {
  --md-sys-color-primary: #e50914; /* Traflix Red */
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-secondary-container: rgba(255, 255, 255, 0.1);
  --md-sys-color-on-secondary-container: #ffffff;
  --md-sys-color-outline: rgba(255, 255, 255, 0.2);
  --md-sys-color-error: #d32f2f;
  --md-sys-color-on-error: #ffffff;
}

.md3-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 64px;
  border: none;
  outline: none;
  vertical-align: middle;
  background: transparent;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1px;
  border-radius: 12px; /* Less rounded corners, larger 'bordo esterno' */
  height: 48px; /* Bigger buttons */
  padding: 0 24px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  gap: 12px;
  white-space: nowrap;
}

.md3-btn:disabled {
  pointer-events: none;
  opacity: 0.38;
}

/* State layers */
.md3-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: currentColor;
  opacity: 0;
  transition: opacity 0.2s linear;
  pointer-events: none;
}

.md3-btn:hover::before {
  opacity: 0.08;
}

.md3-btn:focus-visible::before {
  opacity: 0.12;
}

.md3-btn:active {
  transform: scale(0.97);
}

.md3-btn:active::before {
  opacity: 0.12;
}

/* VARIANTS */

/* 1. Filled */
.md3-btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.md3-btn-filled:hover {
  box-shadow: 0 2px 5px rgba(229, 9, 20, 0.4);
}

/* 2. Elevated */
.md3-btn-elevated {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-primary);
  box-shadow: 0 1px 3px 1px rgba(0,0,0,0.3), 0 1px 2px 0 rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.md3-btn-elevated:hover {
  box-shadow: 0 2px 6px 2px rgba(0,0,0,0.4), 0 1px 2px 0 rgba(0,0,0,0.3);
}

/* 3. Tonal - Distinct Violet hue for 'Mostra Episodi' and 'Add to list' */
.md3-btn-tonal {
  background-color: rgba(126, 87, 194, 0.3); /* Violet tint */
  color: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(126, 87, 194, 0.5); /* Violet border */
}
.md3-btn-tonal:hover {
  background-color: rgba(126, 87, 194, 0.5);
  border: 1px solid rgba(126, 87, 194, 0.8);
  box-shadow: 0 4px 15px rgba(126, 87, 194, 0.2);
}

/* 4. Outlined - Default system style */
.md3-btn-outlined {
  border: 1px solid var(--md-sys-color-outline);
  color: #ffffff;
  background-color: transparent;
  padding: 0 23px;
}
.md3-btn-outlined:hover {
  background-color: var(--md-sys-color-secondary-container);
}



/* 5. Text - Subtle Amber for 'Indietro' to distinguish from movie titles */
.md3-btn-text {
  color: #ffb300; /* Amber warning-like color */
  padding: 0 16px;
  background-color: transparent;
}
.md3-btn-text:hover {
  color: #ffca28; /* Brighter amber */
  background-color: rgba(255, 179, 0, 0.1); /* Subtle glowing background */
}

/* 6. Destructive */
.md3-btn-destructive {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

/* SIZES */

.md3-btn-sm {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
}

.md3-btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

.md3-btn-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}

.md3-btn-icon-lg {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 12px; /* Increased border radius for square buttons */
}

.md3-btn-square {
  border-radius: 12px;
}

/* Custom ripple element */
.md3-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: radial-gradient(closest-side, currentColor max(calc(100% - 70px), 65%), transparent 100%);
  opacity: 0.12;
  pointer-events: none;
  animation: md3-ripple-anim 450ms cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes md3-ripple-anim {
  0% {
    transform: scale(0);
    opacity: 0.2;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ===================================================
   BROWSE PAGE — Full catalog browsing with filters
   =================================================== */

/* --- Browse Page Background — uses default site bg (no override) --- */

/* --- Browse Header --- */
.browse-header {
  margin-top: 80px;
  padding: 32px 40px 24px;
  text-align: left;
  position: relative;
}

.browse-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40px;
  width: calc(100% - 80px);
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.3), transparent);
}

.browse-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40px;
  width: calc(100% - 80px);
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.3), transparent);
}

.browse-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8c8c8c;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.browse-back-link:hover {
  color: #e50914;
}

.browse-page-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}

.browse-page-subtitle {
  font-size: 15px;
  color: #8c8c8c;
  margin: 0;
  font-weight: 400;
}

/* --- Browse Filters Panel --- */
.browse-filters-panel {
  margin: 24px 40px 0;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.browse-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.browse-filters-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.browse-filters-title svg {
  color: #e50914;
}

.browse-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px 20px;
}

.browse-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.browse-filter-item > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8c8c8c;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.browse-filter-item > span svg {
  color: #e50914;
  opacity: 0.8;
}

.browse-filter-item select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(34, 34, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.browse-filter-item select:hover {
  border-color: rgba(229, 9, 20, 0.3);
}

.browse-filter-item select:focus {
  outline: none;
  border-color: #e50914;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

.browse-filter-item select option {
  background: #1a1a1a;
  color: #fff;
  padding: 8px;
}

.browse-filters-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
  gap: 12px;
}

.browse-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.browse-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 20px;
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 500;
}

.browse-filter-chip.is-muted {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #666;
}

.browse-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  color: #8c8c8c;
  font-size: 11px;
  font-weight: 500;
}

.browse-filters-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #8c8c8c;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.browse-filters-reset:hover {
  border-color: #e50914;
  color: #e50914;
  background: rgba(229, 9, 20, 0.06);
}

.browse-filters-reset svg {
  transition: transform 0.3s ease;
}

.browse-filters-reset:hover svg {
  transform: rotate(-90deg);
}

/* --- Browse Results Grid --- */
.browse-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 20px;
  padding: 24px 40px;
}

/* --- Browse Cards --- */
.browse-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1a;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.browse-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(229, 9, 20, 0.2);
}

.browse-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}

.browse-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.browse-card:hover .browse-card-img {
  transform: scale(1.05);
}

.browse-card-no-poster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  color: #555;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  padding: 12px;
}

.browse-card-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.browse-card-availability-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: rgba(34, 197, 94, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.browse-card-info {
  padding: 10px 12px 14px;
}

.browse-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.browse-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.browse-card-vote {
  color: #ffd700;
  font-weight: 600;
}

.browse-card-year {
  color: #666;
}

/* --- Browse Loading --- */
.browse-loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: #8c8c8c;
  font-size: 13px;
}

.browse-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(229, 9, 20, 0.15);
  border-top-color: #e50914;
  border-radius: 50%;
  animation: browseSpin 0.8s linear infinite;
}

@keyframes browseSpin {
  to { transform: rotate(360deg); }
}

.browse-scroll-trigger {
  height: 1px;
  width: 100%;
}

.browse-load-more-container {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.browse-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(229, 9, 20, 0.1);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 8px;
  color: #e50914;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.browse-load-more-btn:hover {
  background: rgba(229, 9, 20, 0.2);
  border-color: #e50914;
}

.browse-load-more-btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.browse-results-count {
  text-align: center;
  padding: 16px 0 32px;
  color: #666;
  font-size: 12px;
}

/* --- Browse Empty State --- */
.browse-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.browse-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.browse-empty-state h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}

.browse-empty-state p {
  color: #8c8c8c;
  font-size: 14px;
  margin: 0;
}

/* --- "Sfoglia tutti" Button --- */
.home-section-title-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 16px;
  width: 100%;
  gap: 8px;
}

@media (max-width: 480px) {
  .home-section-title-row {
    flex-direction: column;
  }
}

.home-section-title-row .home-section-title {
  margin: 0;
  flex-shrink: 0;
}

.browse-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(229, 9, 20, 0.08);
  border: 1.5px solid rgba(229, 9, 20, 0.4);
  border-radius: 50px;
  color: #e50914;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.browse-all-btn:hover {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.35);
  transform: translateY(-1px);
}

.browse-all-btn svg {
  transition: transform 0.2s ease;
}

.browse-all-btn:hover svg {
  transform: translateX(2px);
}

/* --- Browse Page Responsive --- */
@media (max-width: 768px) {
  .browse-header {
    padding: 24px 20px 20px;
    margin-top: 70px;
    text-align: left;
  }

  .browse-header::after {
    left: 20px;
    width: calc(100% - 40px);
  }

  .browse-filters-panel {
    margin: 16px 16px 0;
  }

  .browse-filters-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 16px;
  }

  .browse-results {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
  }

  .browse-card-info {
    padding: 8px 8px 10px;
  }

  .browse-card-title {
    font-size: 12px;
  }

  .browse-card-meta {
    font-size: 10px;
  }

  .browse-filters-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .browse-filters-grid {
    grid-template-columns: 1fr;
  }

  .browse-results {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .browse-page-title {
    font-size: 24px;
  }

  .browse-page-subtitle {
    font-size: 13px;
  }
}
