/**
 * MatchLetter — Minimalist Cinematic Design System
 * Inspired by Pure Monochrome / Luxury Dark Aesthetics
 * Deep Obsidian, Crisp Subtle Borders, Clean Typography & Neutral Accents
 */

:root {
  --ml-bg: #07090e;
  --ml-sidebar-bg: #0b0e14;
  --ml-card-bg: #10141d;
  --ml-card-hover: #161b27;
  --ml-card-elevated: #1a2130;
  --ml-input-bg: #0b0e15;
  
  --ml-border: rgba(255, 255, 255, 0.08);
  --ml-border-subtle: rgba(255, 255, 255, 0.04);
  --ml-border-hover: rgba(255, 255, 255, 0.18);
  --ml-border-focus: rgba(255, 255, 255, 0.35);
  
  --ml-text: #f8fafc;
  --ml-text-muted: #94a3b8;
  --ml-text-dim: #64748b;
  
  --ml-accent: #ffffff;
  --ml-accent-hover: #e2e8f0;
  --ml-accent-soft: rgba(255, 255, 255, 0.08);
  --ml-accent-border: rgba(255, 255, 255, 0.18);
  
  --ml-gold: #f8fafc;
  --ml-danger: #ef4444;

  --ml-radius: 10px;
  --ml-radius-sm: 6px;
  --ml-radius-lg: 14px;
  --ml-radius-full: 9999px;
  
  --ml-sidebar-width: 250px;
  --ml-transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--ml-bg);
  color: var(--ml-text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--ml-sidebar-width);
  background-color: var(--ml-sidebar-bg);
  border-right: 1px solid var(--ml-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: var(--ml-text);
}

.brand-icon {
  width: 20px;
  height: 20px;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ml-text-muted);
  margin-left: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ml-text-dim);
  letter-spacing: 0.8px;
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--ml-radius-sm);
  color: var(--ml-text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--ml-transition);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--ml-text);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-item.active svg {
  color: #ffffff;
  opacity: 1;
}

.nav-item .badge-pill {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--ml-radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ml-text-muted);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--ml-border);
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--ml-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ml-border);
  cursor: pointer;
  transition: var(--ml-transition);
}

.user-mini-card:hover {
  background: var(--ml-card-hover);
  border-color: var(--ml-border-hover);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a2232;
  object-fit: cover;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ml-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta {
  font-size: 11px;
  color: var(--ml-text-dim);
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--ml-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: 58px;
  border-bottom: 1px solid var(--ml-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ml-text);
  cursor: pointer;
  padding: 4px;
}

.segmented-pill-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-full);
  padding: 3px;
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--ml-text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--ml-radius-full);
  cursor: pointer;
  transition: var(--ml-transition);
}

.pill-btn:hover {
  color: var(--ml-text);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--ml-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ml-transition);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  border: none;
}

.btn-primary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ml-text);
  border-color: var(--ml-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--ml-border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--ml-text-muted);
  border-color: var(--ml-border);
}

.btn-outline:hover {
  color: var(--ml-text);
  border-color: var(--ml-border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 5px;
}

/* Page Views */
.page-view {
  display: none;
  padding: 28px 32px 48px;
  animation: viewFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-view.active {
  display: block;
}

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

/* Minimal Hero Banner */
.minimal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  margin-bottom: 24px;
  gap: 20px;
}

.minimal-hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
  color: #fff;
}

.minimal-hero-sub {
  font-size: 13.5px;
  color: var(--ml-text-muted);
  max-width: 640px;
  line-height: 1.5;
}

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--ml-card-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--ml-transition);
}

.stat-card:hover {
  border-color: var(--ml-border-hover);
}

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ml-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-num {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #ffffff;
  line-height: 1.2;
}

.stat-label {
  font-size: 11.5px;
  color: var(--ml-text-dim);
  font-weight: 500;
}

/* Compare / Match Widget */
.compare-box {
  background: var(--ml-card-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 24px;
  margin-bottom: 28px;
}

.compare-inputs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.compare-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--ml-input-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-sm);
  transition: var(--ml-transition);
}

.compare-input-wrap:focus-within {
  border-color: var(--ml-border-focus);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.compare-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 12px 14px 12px 36px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.input-icon-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ml-text-dim);
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  pointer-events: none;
}

.input-icon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
}

.input-clear-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--ml-text-dim);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--ml-transition);
}

.input-clear-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.input-clear-btn.visible {
  display: inline-flex;
}

.row-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--ml-transition);
}

.row-remove-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.08);
}

/* Aux Actions (Add / Remove Friend buttons) */
.form-aux-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ml-border);
  color: var(--ml-text-muted);
  border-radius: var(--ml-radius-full);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--ml-transition);
  font-family: inherit;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ml-text);
  border-color: var(--ml-border-hover);
}

.btn-subtle.remove-btn {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

.btn-subtle.remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Modern Cinematic Loading Bars & Progress Card */
.ml-crawl-progress-card {
  margin-top: 22px;
  padding: 22px;
  background: rgba(14, 18, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--ml-radius);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 220, 100, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: ml-fade-slide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* Glowing top ambient light border */
.ml-crawl-progress-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00dc64, #00b4d8, #7928ca, transparent);
  background-size: 200% 100%;
  animation: ml-gradient-flow 3.5s ease infinite;
}

.ml-crawl-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.ml-crawl-status-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

/* Pulsing radar dot indicator */
.ml-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00dc64;
  box-shadow: 0 0 10px #00dc64;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.ml-pulse-indicator::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid #00dc64;
  animation: ml-radar-ring 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes ml-radar-ring {
  0% { transform: scale(0.6); opacity: 0.95; }
  100% { transform: scale(2.4); opacity: 0; }
}

.ml-crawl-status-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ml-meta-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--ml-radius-full);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Main Cinematic Progress Bar Track */
.ml-progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--ml-radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Main Progress Bar Fill with multi-color animated flow & glowing sweep */
.ml-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00dc64 0%, #00d2b4 30%, #00b4d8 65%, #7928ca 100%);
  background-size: 250% 100%;
  border-radius: var(--ml-radius-full);
  position: relative;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: ml-gradient-flow 4s ease infinite;
  box-shadow: 0 0 14px rgba(0, 220, 100, 0.5);
}

.ml-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  animation: ml-shimmer-sweep 1.9s infinite ease-in-out;
}

@keyframes ml-gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ml-shimmer-sweep {
  0% { transform: translateX(0); }
  100% { transform: translateX(250%); }
}

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

/* Granular User Pills Grid */
.ml-user-progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.ml-user-progress-pill {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--ml-radius-sm);
  padding: 12px 14px;
  transition: var(--ml-transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ml-user-progress-pill.is-active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}

.ml-user-progress-pill.is-done {
  border-color: rgba(0, 220, 100, 0.35);
  background: rgba(0, 220, 100, 0.04);
}

.ml-user-pill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ml-user-pill-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-user-pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ml-user-pill-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--ml-radius-full);
  white-space: nowrap;
}

.ml-status-queued {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ml-text-dim);
}

.ml-status-crawling {
  background: rgba(0, 180, 216, 0.15);
  color: #00b4d8;
  border: 1px solid rgba(0, 180, 216, 0.3);
  animation: ml-pulse-glow 1.5s infinite ease-in-out;
}

.ml-status-done {
  background: rgba(0, 220, 100, 0.15);
  color: #00dc64;
  border: 1px solid rgba(0, 220, 100, 0.3);
}

@keyframes ml-pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.ml-user-pill-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ml-text-dim);
}

/* Individual Mini Progress Bar for each user */
.ml-user-mini-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--ml-radius-full);
  overflow: hidden;
  position: relative;
  margin-top: 3px;
}

.ml-user-mini-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00dc64, #00b4d8);
  border-radius: var(--ml-radius-full);
  transition: width 0.22s ease;
}

/* Multi-user Avatar Stack in Results */
.ml-avatar-stack {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.ml-avatar-stack img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #10141d;
  margin-left: -8px;
  object-fit: cover;
  background: #1a2130;
}

.ml-avatar-stack img:first-child {
  margin-left: 0;
}

.ml-users-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ml-user-taste-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: var(--ml-radius-full);
  font-size: 11.5px;
  color: var(--ml-text-muted);
}

.ml-user-taste-chip strong {
  color: #ffffff;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .ml-progress-bar-fill,
  .ml-pulse-indicator::after,
  .ml-crawl-progress-card::before,
  .ml-progress-bar-fill::after,
  .ml-status-crawling {
    animation: none !important;
  }
}

/* Interactive Watch Together Tool */
.watch-together-panel {
  background: var(--ml-card-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 24px;
  margin-bottom: 28px;
}

.filter-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-full);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ml-text-muted);
  cursor: pointer;
  transition: var(--ml-transition);
}

.filter-chip:hover {
  color: var(--ml-text);
  border-color: var(--ml-border-hover);
}

.filter-chip.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

.roulette-box {
  border: 1px dashed var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  margin-top: 18px;
}

/* Movie Poster Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.movie-card {
  background: var(--ml-card-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-sm);
  overflow: hidden;
  transition: var(--ml-transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-3px);
  border-color: var(--ml-border-hover);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.poster-box {
  width: 100%;
  aspect-ratio: 2 / 3;
  position: relative;
  background: #0d1017;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.3s ease;
  display: block;
}

.poster-img.poster-pending {
  opacity: 0.65;
  filter: brightness(0.9);
}

.movie-card:hover .poster-img {
  transform: scale(1.03);
}

.rating-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.rating-badge.match-pct {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.source-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 9.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ml-text-muted);
}

.movie-card-info {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.movie-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  color: #fff;
}

.movie-sub {
  font-size: 11px;
  color: var(--ml-text-dim);
  display: flex;
  justify-content: space-between;
}

.movie-reason-tag {
  font-size: 10.5px;
  color: var(--ml-text-muted);
  line-height: 1.3;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--ml-border-subtle);
}

/* Importer Card */
.importer-card {
  background: var(--ml-card-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 28px;
}

.drop-zone {
  border: 1.5px dashed var(--ml-border);
  border-radius: var(--ml-radius);
  padding: 44px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: var(--ml-transition);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.drop-icon {
  width: 40px;
  height: 40px;
  color: #ffffff;
  margin-bottom: 12px;
  opacity: 0.8;
}

/* Form Controls */
.form-control {
  width: 100%;
  background: var(--ml-input-bg);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-sm);
  padding: 9px 12px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: var(--ml-transition);
}

.form-control:focus {
  border-color: var(--ml-border-focus);
}

/* Responsive */
@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .compare-inputs-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .page-view {
    padding: 20px 16px 40px;
  }
  .minimal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Auth Modal Backdrop & Dialog System */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.auth-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card {
  width: 100%;
  max-width: 400px;
  background: #10141d;
  border: 1px solid var(--ml-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--ml-radius-lg, 14px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 26px 24px;
  transform: scale(0.95) translateY(10px) translateZ(0);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  position: relative;
  contain: layout;
  color: var(--ml-text, #f8fafc);
}

.auth-modal-backdrop.active .auth-modal-card {
  transform: scale(1) translateY(0) translateZ(0);
}

.modal-drag-handle {
  display: none;
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-modal-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.auth-modal-subtitle {
  font-size: 0.85rem;
  color: var(--ml-text-muted, #94a3b8);
  margin: 4px 0 0;
}

.auth-modal-close {
  background: none;
  border: none;
  color: var(--ml-text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--ml-radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}

.auth-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.auth-tabs {
  display: flex;
  background: #07090e;
  border: 1px solid var(--ml-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--ml-radius, 10px);
  padding: 3px;
  margin-bottom: 20px;
  gap: 3px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--ml-text-muted, #94a3b8);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.auth-tab-btn.active {
  background: #1a2130;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ml-text-muted, #94a3b8);
  margin-bottom: 6px;
}

.auth-text-input {
  width: 100%;
  height: 46px;
  background: #0b0e15;
  border: 1px solid var(--ml-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--ml-radius-sm, 6px);
  padding: 0 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  contain: layout paint;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-text-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.auth-text-input::placeholder {
  color: var(--ml-text-dim, #64748b);
}

.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: -4px;
  margin-bottom: 16px;
  user-select: none;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--ml-text-muted, #94a3b8);
}

.auth-checkbox-label:hover {
  color: #ffffff;
}

.auth-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auth-checkbox-custom {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1px solid var(--ml-border, rgba(255, 255, 255, 0.18));
  background: #0b0e15;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #040609;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.auth-checkbox-custom svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-checkbox:checked + .auth-checkbox-custom {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b0e14;
}

.auth-checkbox:checked + .auth-checkbox-custom svg {
  opacity: 1;
  transform: scale(1);
}

.auth-checkbox:focus-visible + .auth-checkbox-custom {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.auth-checkbox-text {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
}

.auth-password-wrapper {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.auth-password-wrapper .auth-text-input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  outline: none;
  box-shadow: none !important;
  color: var(--ml-text-muted, #94a3b8);
  cursor: pointer;
  border-radius: var(--ml-radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.auth-password-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06) !important;
}

.auth-password-toggle:focus-visible {
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: block;
}

.turnstile-box {
  margin: 14px 0 18px;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-feedback-msg {
  font-size: 0.82rem;
  min-height: 20px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: var(--ml-radius-sm, 6px);
  display: none;
  line-height: 1.4;
}

.auth-feedback-msg.error {
  display: block;
  color: #ff6b6b;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.auth-feedback-msg.success {
  display: block;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.auth-submit-btn {
  width: 100%;
  height: 48px;
  background: #ffffff;
  color: #0b0e14;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--ml-radius-sm, 6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.auth-submit-btn:hover {
  background: #e2e8f0;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-footer-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ml-text-muted, #94a3b8);
}

.auth-switch-link {
  background: none;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .auth-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .auth-modal-card {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding: 16px 20px max(24px, env(safe-area-inset-bottom, 24px));
    transform: translateY(100%);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.65);
  }

  .auth-modal-backdrop.active .auth-modal-card {
    transform: translateY(0);
  }

  .modal-drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 14px;
  }
}

