@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #090d16;
  --bg2:         #0e1422;
  --bg3:         rgba(18, 26, 43, 0.75);
  --card:        rgba(18, 26, 43, 0.65);
  --card-hover:  rgba(26, 38, 64, 0.85);
  --border:      rgba(255, 255, 255, 0.08);
  --border-2:    rgba(255, 255, 255, 0.16);
  --accent:      #38bdf8; /* sky-400 */
  --accent-2:    #0ea5e9; /* sky-500 */
  --accent-glow: rgba(56, 189, 248, 0.18);
  --orange:      #f59e0b;
  --yellow:      #fbbf24;
  --text:        #f8fafc;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --dvd-color:   #38bdf8;
  --br-color:    #60a5fa;
  --4k-color:    #818cf8;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-lg:   0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(56, 189, 248, 0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 5%, rgba(56, 189, 248, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 60%, rgba(14, 165, 233, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Header ────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

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

.logo-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.logo-text-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.logo-slogan {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.logo-text span {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Search bar ─────────────────────────────────────────────── */
.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  transition: color .2s, transform .2s;
}

#search-input {
  width: 100%;
  background: rgba(14, 20, 34, 0.85);
  border: 1px solid var(--border-2);
  border-radius: 50px;
  padding: 12px 20px 12px 46px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all .25s ease;
}

#search-input::placeholder { color: var(--text-3); }

#search-input:focus {
  border-color: var(--accent);
  background: rgba(18, 26, 43, 0.95);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#search-input:focus + svg,
.search-wrap:focus-within svg {
  color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

/* ─── Barcode Scanner Button ─────────────────────────────────── */
.barcode-btn-isolated {
  background: rgba(14, 20, 34, 0.85);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.barcode-btn-isolated:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-glow);
  transform: scale(1.06);
}

@media (min-width: 769px) {
  .barcode-btn-isolated { display: none !important; }
}

/* ─── Filters ────────────────────────────────────────────────── */
.filters {
  max-width: 1400px;
  margin: 22px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label { font-size: .85rem; color: var(--text-3); margin-right: 4px; }

.filter-btn {
  background: rgba(18, 26, 43, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 18px;
  color: var(--text-2);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  border-color: var(--border-2);
  color: var(--text);
  background: rgba(26, 38, 64, 0.8);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.filter-select {
  background: rgba(18, 26, 43, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 32px 8px 16px;
  color: var(--text-2);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  appearance: none;
  -webkit-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='%2394a3b8' stroke-width='2' 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;
}

.filter-select:hover {
  border-color: var(--border-2);
  color: var(--text);
  background-color: rgba(26, 38, 64, 0.8);
}

.filter-select.active {
  background-color: rgba(2, 132, 199, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  font-weight: 600;
}

.filter-select option {
  background: #0f172a;
  color: #f1f5f9;
}

.card-casetype {
  font-size: min(0.82rem, 5.5cqi);
  color: var(--text-2);
}

.card-casetype strong {
  color: #38bdf8;
  font-weight: 600;
}

.slipcover-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--yellow);
  font-size: 0.9em;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1.1;
  cursor: default;
}

#sort-value-btn {
  background: rgba(18, 26, 43, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

#sort-value-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent);
  color: #fff;
}

.results-count {
  margin-left: auto;
  font-size: .85rem;
  color: var(--text-3);
  font-weight: 500;
}

.results-count strong { color: var(--accent); font-weight: 700; }

/* ─── Movie grid ─────────────────────────────────────────────── */
#movies-grid {
  max-width: 1400px;
  margin: 22px auto 0;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

/* ─── Movie card ─────────────────────────────────────────────── */
.movie-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.45);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
  position: relative;
}

.movie-card:hover {
  background: var(--card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.12);
  transform: translateY(-3px);
}

.card-body {
  flex: 1;
  min-width: 0;
  container-type: inline-size;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.card-title.cinema-clickable {
  cursor: pointer;
  transition: color 0.2s ease;
}

.card-title.cinema-clickable:hover {
  color: var(--accent);
}

.movie-original-title {
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  margin-top: -4px;
  margin-bottom: 6px;
  line-height: 1.2;
  word-break: break-word;
}

.card-director {
  font-size: min(0.82rem, 5.5cqi);
  color: var(--text-2);
}

.movie-director, .movie-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: min(0.82rem, 5.5cqi);
  color: var(--text-2);
  margin-top: 3px;
}

.casetype-clickable {
  color: #38bdf8;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.casetype-clickable:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.edition-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.edition-clickable:hover {
  filter: brightness(1.2);
  text-decoration: underline;
}

.director-link {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s ease;
}

.director-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.more-directors {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-2);
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.more-directors:hover {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.card-edition {
  font-size: min(0.85rem, 5.8cqi);
  color: #fb923c;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.25;
}

.card-upc {
  font-size: min(0.75rem, 5cqi);
  color: var(--text-3);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ─── Format badge ───────────────────────────────────────────── */
.format-badges {
  display: flex;
  gap: 6px;
  margin-top: 1px;
}

.format-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.badge-dvd    { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-bluray { background: rgba(96, 165, 250, 0.12); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge-4k     { background: rgba(129, 140, 248, 0.15); color: #a5b4fc; border: 1px solid rgba(129, 140, 248, 0.35); }
.badge-watched { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); display: inline-flex; align-items: center; gap: 4px; }

/* ─── Movie Covers ───────────────────────────────────────────── */
.movie-cover-container {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
  width: 100%;
}

.movie-cover-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.movie-cover {
  display: block;
  margin-top: 0 !important;
  max-width: 100%;
  max-height: 185px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-cover:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}

/* ─── BoxSet Inline Button ───────────────────────────────────── */
.boxset-btn-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
  width: 100%;
}

.boxset-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7dd3fc;
  font-size: min(0.75rem, 5cqi);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: fit-content;
  white-space: nowrap;
}

.boxset-inline-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.boxset-expanded {
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2) !important;
}

.boxset-child-card {
  position: relative;
  background: rgba(12, 17, 29, 0.75) !important;
  border: 1px dashed rgba(56, 189, 248, 0.35) !important;
  transform: scale(0.97);
  transform-origin: top center;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.boxset-child-card .card-title::before {
  content: "↳";
  color: var(--accent);
  margin-right: 8px;
  font-weight: bold;
}

@keyframes slideDown {
  from { opacity: 0; transform: scale(0.97) translateY(-15px); }
  to { opacity: 1; transform: scale(0.97) translateY(0); }
}

/* ─── TMDB User Score Ring ───────────────────────────────────── */
.user-score-ring {
  width: 38px;
  height: 38px;
  background-color: #081c22;
  border-radius: 50%;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), 0 0 10px rgba(33, 208, 122, 0.15);
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.user-score-ring:hover {
  transform: scale(1.15);
}

.user-score-ring.overlay-on-cover {
  position: absolute;
  bottom: -8px;
  left: 8px;
  z-index: 3;
}

.score-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  border-radius: 50%;
}

.score-ring-bg {
  fill: none;
  stroke-width: 3.2;
}

.score-ring-progress {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease;
}

.score-ring-text {
  position: absolute;
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.score-ring-text sup {
  font-size: 0.42rem;
  margin-left: 1px;
  margin-top: -3px;
}

/* ─── Loading / empty states ─────────────────────────────────── */
.state-msg {
  max-width: 1400px;
  margin: 60px auto;
  padding: 0 24px;
  text-align: center;
  color: var(--text-3);
  grid-column: 1 / -1;
}

.state-msg .icon { font-size: 3rem; margin-bottom: 16px; }
.state-msg p { font-size: 1.05rem; color: var(--text-2); font-weight: 500; }
.state-msg small { font-size: .85rem; color: var(--text-3); margin-top: 4px; display: block; }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}

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

/* ─── Load more ──────────────────────────────────────────────── */
#load-more-wrap {
  max-width: 1400px;
  margin: 0 auto 60px;
  padding: 0 24px;
  text-align: center;
  display: none;
}

#load-more-btn {
  background: rgba(18, 26, 43, 0.8);
  border: 1px solid var(--border-2);
  border-radius: 50px;
  padding: 14px 44px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#load-more-btn:hover {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
  transform: translateY(-2px);
}

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.82) !important;
}

.modal-content {
  background: #0e1422 !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
}

/* ─── Cinema Modal (Scheda Film Completa) ─────────────────────── */
.cinema-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cinemaFadeIn 0.25s ease-out;
}

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

.cinema-modal-card {
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(14, 165, 233, 0.15);
  display: flex;
  flex-direction: column;
  animation: cinemaZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cinema-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  line-height: 1;
}

.cinema-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
  transform: rotate(90deg) scale(1.05);
}

.cinema-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  background-size: cover;
  background-position: center 20%;
  filter: brightness(0.65) contrast(1.1);
  pointer-events: none;
  z-index: 1;
}

.cinema-backdrop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  background: linear-gradient(to bottom, rgba(11, 15, 25, 0.2) 0%, rgba(11, 15, 25, 0.85) 60%, #0b0f19 100%),
              linear-gradient(to right, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.5) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.cinema-modal-body {
  position: relative;
  z-index: 5;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  gap: 32px;
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

.cinema-modal-body::-webkit-scrollbar {
  width: 6px;
}
.cinema-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
}

/* Colonna Sinistra (Poster & Dati Fisici) */
.cinema-side-col {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cinema-poster-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cinema-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cinema-meta-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
}

.cinema-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}
.cinema-meta-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cinema-meta-label {
  color: var(--text-3);
  font-weight: 500;
}
.cinema-meta-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* Colonna Destra (Scheda Cinematografica) */
.cinema-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cinema-header-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cinema-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.cinema-subtitle {
  font-size: 0.95rem;
  color: var(--text-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cinema-tagline {
  font-style: italic;
  font-size: 1.05rem;
  color: #7dd3fc;
  font-weight: 500;
  line-height: 1.4;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 4px 0;
}

.cinema-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cinema-genre-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.cinema-runtime-badge {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cinema-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cinema-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: 700;
}

.cinema-overview {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
}

/* Cast Grid */
.cinema-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.cinema-actor-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, border-color 0.2s;
}

.cinema-actor-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.cinema-actor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.cinema-actor-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cinema-actor-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cinema-actor-char {
  font-size: 0.7rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions Row (Trailer Button) */
.cinema-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.cinema-trailer-btn {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinema-trailer-btn:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.5);
}

/* Trailer Modal */
.trailer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 13000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.trailer-modal-card {
  width: 100%;
  max-width: 880px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.trailer-video-container {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
}

.trailer-video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.trailer-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.trailer-close-btn:hover {
  transform: scale(1.1);
  background: #ef4444;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cinema-modal-body {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }
  .cinema-side-col {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
  }
  .cinema-title {
    font-size: 1.5rem;
    text-align: center;
  }
  .cinema-subtitle, .cinema-tagline {
    text-align: center;
    justify-content: center;
  }
  .cinema-tagline {
    border-left: none;
    border-top: 2px solid var(--accent);
    padding: 6px 0 0 0;
  }
  .cinema-badges-row, .cinema-actions {
    justify-content: center;
  }
  .cinema-cast-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

@media (max-width: 640px) {
  header { padding: 14px 16px 12px; }
  .header-inner { gap: 12px; }
  .logo-image { width: 42px; height: 42px; }
  .logo-text-container { height: 42px; padding: 2px 0; }
  .logo-text { font-size: 1.2rem; }
  .logo-slogan { font-size: 0.62rem; }
  #movies-grid { padding: 0 16px 60px; grid-template-columns: 1fr; }
  .filters { padding: 0 16px; }
  
  .movie-card { text-align: center; }
  .card-title { font-size: 1.4rem !important; }
  .movie-original-title { font-size: 1.2rem !important; }
  .card-edition { font-size: 1.15rem !important; }
  .card-director, .card-label, .card-casetype { font-size: 1.1rem !important; justify-content: center !important; }
  .card-director div, .card-label div { align-items: center !important; }
  .card-upc { font-size: 0.95rem !important; white-space: normal !important; overflow: visible !important; }
  .format-badges { justify-content: center !important; }
  
  .movie-cover {
    max-height: 320px !important;
    margin-left: auto;
    margin-right: auto;
  }
  .boxset-btn-row {
    justify-content: center !important;
  }
  .movie-cover-container {
    justify-content: center !important;
  }
}

/* --- VISTA COMPATTA (LISTA) --- */
  #movies-grid.compact-view {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 60px;
    gap: 0;
  }
  #movies-grid.compact-view .movie-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 8px 12px;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    width: 100%;
    min-width: 0;
  }
  #movies-grid.compact-view .card-body {
    display: grid;
    grid-template-columns: 75px 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 2px 12px;
    align-items: center;
    width: 100%;
    padding: 0;
  }
  #movies-grid.compact-view .movie-cover-container {
    grid-column: 1;
    grid-row: 1 / 5;
    width: 65px;
    height: 90px;
    margin: 0;
    align-self: center;
  }
  #movies-grid.compact-view .movie-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    position: static;
    transform: none;
  }
  #movies-grid.compact-view .card-title {
    grid-column: 2;
    text-align: left !important;
    justify-content: flex-start !important;
    font-size: 1.15rem !important;
    white-space: normal;
    overflow: visible;
    margin-bottom: 0;
    min-width: 0;
    word-break: break-word;
  }
  
  #movies-grid.compact-view .movie-original-title {
    grid-column: 2;
    text-align: left !important;
    justify-content: flex-start !important;
    font-size: 0.95rem !important;
    white-space: normal;
    overflow: visible;
    margin-bottom: 0;
    min-width: 0;
    word-break: break-word;
  }

  #movies-grid.compact-view .card-edition {
    grid-column: 2;
    text-align: left !important;
    font-size: 1.05rem !important;
    color: var(--text-2);
    margin: 0;
    white-space: normal;
    overflow: visible;
    min-width: 0;
    word-break: break-word;
  }
  #movies-grid.compact-view .card-director,
  #movies-grid.compact-view .card-casetype {
    grid-column: 2;
    text-align: left !important;
    justify-content: flex-start !important;
    font-size: 1.0rem !important;
    color: var(--text-3);
    margin: 0;
    min-width: 0;
  }
  #movies-grid.compact-view .card-director div {
    justify-content: flex-start !important;
  }
  #movies-grid.compact-view .card-footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
    border: none;
    background: transparent;
    margin-top: 0;
    flex-shrink: 0;
  }
  #movies-grid.compact-view .format-badges {
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    justify-content: center !important;
  }
  #movies-grid.compact-view .format-badges span {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  /* Solo supporto qualità maggiore */
  #movies-grid.compact-view .format-badges:has(.badge-4k) .badge-bluray,
  #movies-grid.compact-view .format-badges:has(.badge-4k) .badge-dvd,
  #movies-grid.compact-view .format-badges:has(.badge-bluray) .badge-dvd {
    display: none !important;
  }
  /* Nascondi elementi superflui */
  #movies-grid.compact-view .card-upc,
  #movies-grid.compact-view .card-label,
  #movies-grid.compact-view .boxset-badge,
  #movies-grid.compact-view .boxset-btn-row,
  #movies-grid.compact-view .view-badge,
  #movies-grid.compact-view .review-badge,
  #movies-grid.compact-view .rating-fallback,
  #movies-grid.compact-view .card-casetype {
    display: none !important;
  }
  
  .compact-boxset-btn {
    display: none !important;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
  }
  .compact-boxset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
  }
  #movies-grid.compact-view .compact-boxset-btn {
    display: inline-flex !important;
  }

/* ─── Dashboard Statistiche da Collezionista ─────────────────── */
.stats-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12500;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: statsFadeIn 0.25s ease-out;
}

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

.stats-modal-card {
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 60px rgba(56, 189, 248, 0.1);
  display: flex;
  flex-direction: column;
  animation: statsZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes statsZoomIn {
  from { transform: scale(0.95) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.stats-modal-header {
  padding: 20px 28px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}

.stats-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-modal-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
}

.stats-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}

.stats-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
}

.stats-close-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  transform: rotate(90deg) scale(1.05);
}

.stats-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  min-width: 0;
}

.stats-modal-body::-webkit-scrollbar {
  width: 6px;
}
.stats-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
}

/* KPI Hero Grid */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stats-kpi-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stats-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.3);
}

.stats-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, #38bdf8);
}

.stats-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-kpi-icon {
  font-size: 1.3rem;
}

.stats-kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stats-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
}

/* Rows 2 Columns */
.stats-row-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  min-width: 0;
}

.stats-panel {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(10px);
  min-width: 0;
}

.stats-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
  min-width: 0;
}

.stats-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-panel-extra {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 500;
}

/* Formats Progress Bars */
.stats-format-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.stats-format-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stats-format-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.stats-format-name {
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-format-nums {
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
}
.stats-format-nums strong {
  color: #fff;
}

.stats-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.stats-progress-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-4k {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}
.bar-bluray {
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.bar-dvd {
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

/* Decades Histogram */
.stats-decades-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 170px;
  padding: 10px 0 8px 0;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.5) transparent;
}
.stats-decades-chart::-webkit-scrollbar {
  height: 6px;
}
.stats-decades-chart::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.5);
  border-radius: 10px;
}

.stats-decade-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.stats-decade-bar-wrap {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.stats-decade-bar {
  width: 80%;
  max-width: 32px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
  position: relative;
}

.stats-decade-bar:hover {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.stats-decade-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.stats-decade-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
}

/* Top Directors & Labels List */
.stats-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.stats-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  transition: all 0.2s;
  min-width: 0;
}

.stats-rank-item.clickable {
  cursor: pointer;
}

.stats-rank-item.clickable:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(4px);
}

.stats-rank-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stats-rank-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stats-rank-item:nth-child(1) .stats-rank-badge { background: #eab308; color: #000; }
.stats-rank-item:nth-child(2) .stats-rank-badge { background: #94a3b8; color: #000; }
.stats-rank-item:nth-child(3) .stats-rank-badge { background: #b45309; color: #fff; }

.stats-rank-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-rank-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Top Valuable Titles Grid */
.stats-valuable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.stats-valuable-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  min-width: 0;
}

.stats-valuable-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.7);
}

.stats-valuable-thumb {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.stats-valuable-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stats-valuable-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-valuable-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-valuable-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: #4ade80;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Ratings Tier Grid */
.stats-rating-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.stats-rating-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-rating-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.stats-rating-label {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
}

/* Responsive Rules for Stats Dashboard */
@media (max-width: 960px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-row-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .stats-modal-body {
    padding: 16px;
    gap: 16px;
  }
  .stats-modal-header {
    padding: 16px;
  }
  .stats-modal-title {
    font-size: 1.25rem;
  }
  .stats-kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats-kpi-value {
    font-size: 1.6rem;
  }
  .stats-rating-tiers {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-valuable-grid {
    grid-template-columns: 1fr;
  }
  .stats-panel {
    padding: 16px;
  }
  .stats-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .stats-decades-chart {
    gap: 4px;
    padding-bottom: 0;
  }
  .stats-decade-col {
    min-width: 0;
  }
  .stats-decade-label {
    font-size: 0.65rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-top: 4px;
  }
  .stats-decade-count {
    font-size: 0.65rem;
  }
}

/* ─── Mobile Drawer & Responsive Overrides ───────────────────── */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
  
  #mobile-menu-backdrop {
      display: none !important;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 10500;
    }
    #mobile-menu-backdrop.open {
      display: block !important;
    }

  .filters {
      position: fixed;
      bottom: 0;
      top: auto;
      left: 0;
      right: auto;
      width: 100%;
      max-width: 100vw;
      height: auto;
      max-height: 85vh;
      background: rgba(15, 23, 42, 0.98);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 24px 24px 0 0;
      margin: 0;
      padding: 24px 16px 40px 16px;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      z-index: 11000;
      transform: translate(0, 100%);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      overflow-x: hidden;
      overflow-y: auto;
      box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
      white-space: normal;
      gap: 8px;
    }

    .filters::-webkit-scrollbar {
      width: 6px;
    }
    .filters::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 10px;
    }

    .filters.open {
      transform: translate(0, 0) !important;
    }

  .mobile-drawer-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
  }

  .mobile-drawer-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text);
  }

  .mobile-drawer-close {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
  }

  .filter-btn { border-radius: 12px; margin: 0; justify-content: flex-start; flex-direction: row; font-weight: 500; font-size: 1rem; padding: 14px 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); gap: 12px; width: 100%; min-width: 0; color: var(--text-2); } .filter-btn:hover, .filter-btn.active { background: rgba(255, 255, 255, 0.08); color: var(--accent); border-color: var(--accent); transform: none; } .filter-btn svg { width: 20px; height: 20px; stroke-width: 1.8; flex-shrink: 0; } .filter-actions-right { flex-direction: column; margin: 16px 0 0 0 !important; padding-left: 0; padding-top: 16px; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); gap: 8px !important; width: 100%; } .filter-actions-right .filter-btn { margin: 0; width: 100%; }

  .results-count {
    display: none !important;
  }
}

.movie-cover-wrap.has-side-badge {
  padding-right: 22px;
}

.movie-cover-wrap.has-side-badge .movie-cover {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.case-type-badge {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  height: 100%;
  width: 22px;
  background: linear-gradient(180deg, #60a5fa, #0284c7);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: -2px 0 8px rgba(0,0,0,0.35);
  cursor: pointer;
  z-index: 5;
  transition: filter 0.2s;
}

#movies-grid.compact-view .case-type-badge {
  width: 14px;
  font-size: 0.7rem;
  padding: 6px 0;
}

#movies-grid.compact-view .movie-cover-wrap.has-side-badge {
  padding-right: 14px;
}

.case-type-badge:hover {
  filter: brightness(1.2);
}

/* Nasconde voci in modo permanente nella visualizzazione compatta */
#movies-grid.compact-view .card-label,
#movies-grid.compact-view .card-market-value,
#movies-grid.compact-view .card-id {
  display: none !important;
}

