* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #08080A;
  color: #F5F5F7;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #08080A;
}
::-webkit-scrollbar-thumb {
  background: #2A2A33;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #E50914;
}

.glass {
  background: rgba(18, 18, 22, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-heavy {
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 0%, #FF1F2D 50%, #E50914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-subtle {
  background: linear-gradient(180deg, #FFFFFF 0%, #A1A1AA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(229, 9, 20, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 100% 100%, rgba(229, 9, 20, 0.08) 0%, transparent 50%),
              linear-gradient(180deg, #08080A 0%, #08080A 100%);
}

.hero-vignette {
  background: linear-gradient(180deg, 
    rgba(8, 8, 10, 0.3) 0%, 
    rgba(8, 8, 10, 0.5) 30%,
    rgba(8, 8, 10, 0.85) 70%, 
    rgba(8, 8, 10, 1) 100%);
}

.card-glow {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-glow:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 60px -10px rgba(229, 9, 20, 0.4), 0 0 0 1px rgba(229, 9, 20, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, #E50914 0%, #B8070F 100%);
  box-shadow: 0 4px 20px rgba(229, 9, 20, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(229, 9, 20, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.scroll-row {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-row::-webkit-scrollbar {
  display: none;
}
.scroll-row > * {
  scroll-snap-align: start;
}

.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.shimmer-bg {
  background: linear-gradient(90deg, #1A1A20 0%, #2A2A33 50%, #1A1A20 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.3); }
  50% { box-shadow: 0 0 40px rgba(229, 9, 20, 0.6); }
}
.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.marquee {
  display: flex;
  animation: marquee 60s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.poster-mask {
  mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
}

.backdrop-fade {
  background: linear-gradient(90deg, #08080A 0%, rgba(8,8,10,0.4) 50%, rgba(8,8,10,0.85) 100%),
              linear-gradient(180deg, transparent 0%, rgba(8,8,10,0.6) 70%, #08080A 100%);
}

.text-balance {
  text-wrap: balance;
}

.grid-pattern {
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.red-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle, rgba(229,9,20,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.match-badge {
  background: linear-gradient(135deg, rgba(0, 200, 100, 0.2), rgba(0, 150, 80, 0.1));
  border: 1px solid rgba(0, 200, 100, 0.3);
  color: #4ADE80;
}

.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #A1A1AA;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #F5F5F7;
}
.filter-pill.active {
  background: linear-gradient(135deg, #E50914 0%, #B8070F 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.35);
}

.filter-select {
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #F5F5F7;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: rgba(229, 9, 20, 0.5);
  background: rgba(255, 255, 255, 0.08);
}
.filter-select option {
  background: #121216;
  color: #F5F5F7;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #F5F5F7;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.auth-input:focus {
  outline: none;
  border-color: rgba(229, 9, 20, 0.5);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}
.auth-input::placeholder {
  color: rgba(161, 161, 170, 0.6);
}

.ai-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-card:hover {
  transform: translateY(-4px);
}

@media (max-width: 640px) {
  .hero-title { font-size: clamp(2.5rem, 12vw, 4rem) !important; }
}

.provider-group {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}
.provider-group::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(229, 9, 20, 0.18), transparent 42%);
}
.provider-group > * {
  position: relative;
  z-index: 1;
}
.provider-group-free {
  border-color: rgba(74, 222, 128, 0.25);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), rgba(255, 255, 255, 0.035));
}
.provider-group-paid {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.07), rgba(255, 255, 255, 0.035));
}
.provider-logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.provider-logo-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.6rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.provider-logo-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(245, 245, 247, 0.92);
}
.provider-logo-img,
.provider-logo-fallback {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
}
.provider-logo-img {
  object-fit: cover;
}
.provider-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(229, 9, 20, 0.2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.provider-logo-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.provider-logo-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(229, 9, 20, 0.45);
}
.provider-logo-card:focus-visible {
  outline: 2px solid #e50914;
  outline-offset: 3px;
}

/* Cast + Actor pages */
.cast-card { color: inherit; text-decoration: none; cursor: pointer; display: block; }
.cast-photo { min-height: 210px; }
.cast-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, rgba(229,9,20,.22), transparent 40%), linear-gradient(135deg, #151515, #050505);
  color: rgba(255,255,255,.82);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -.04em;
}
.cast-fallback.hidden { display: none; }
.cast-open-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.62);
  border: 1px solid rgba(255,255,255,.14);
  opacity: 0;
  transform: translateY(-4px);
  transition: all .2s ease;
}
.cast-card:hover .cast-open-badge { opacity: 1; transform: translateY(0); }
.actor-credit-card { color: inherit; text-decoration: none; }
.actor-credit-card:hover .actor-credit-title { color: var(--sf-red, #e50914); }

.cast-card:focus-visible { outline: 2px solid #e50914; outline-offset: 4px; border-radius: 0.9rem; }
.cast-card:hover .cast-photo { border-color: rgba(229,9,20,.55); }
