/* ============================================
   CINEFIA HERO — Theater Curtain Experience
   ============================================ */

.cinefia-hero {
  --hero-purple: #8b5cf6;
  --hero-purple-light: #a78bfa;
  --hero-purple-soft: #c4b5fd;
  --hero-pink: #ec4899;
  --hero-bg: #07070e;

  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--hero-bg);
  color: #fff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ========== BACKGROUND ATMOSPHERE ========== */

.cinefia-hero::before {
  content: '';
  position: absolute;
  inset: -60%;
  background:
    radial-gradient(circle at 20% 30%, rgba(139,92,246,0.22) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(236,72,153,0.14) 0%, transparent 50%),
    radial-gradient(circle at 55% 45%, rgba(99,102,241,0.08) 0%, transparent 65%);
  animation: heroBgDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.cinefia-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 15%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px   1px   at 25% 68%, rgba(255,255,255,0.14), transparent),
    radial-gradient(1.5px 1.5px at 52% 22%, rgba(255,255,255,0.16), transparent),
    radial-gradient(1px   1px   at 76% 52%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(255,255,255,0.14), transparent),
    radial-gradient(1px   1px   at 40% 85%, rgba(255,255,255,0.08), transparent),
    radial-gradient(1px   1px   at 6%  50%, rgba(255,255,255,0.12), transparent),
    radial-gradient(1.5px 1.5px at 63% 40%, rgba(255,255,255,0.16), transparent),
    radial-gradient(1px   1px   at 94% 78%, rgba(255,255,255,0.09), transparent),
    radial-gradient(1px   1px   at 33% 33%, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
  z-index: 0;
  animation: starsTwinkle 4s ease-in-out infinite alternate;
}

@keyframes heroBgDrift {
  0%   { transform: translate(0,0) rotate(0deg); }
  100% { transform: translate(3%,-3%) rotate(10deg); }
}
@keyframes starsTwinkle {
  0%   { opacity: 0.3; }
  100% { opacity: 1; }
}

/* ========== FLOATING CINEMA DECORATIONS ========== */

.cinefia-hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cinefia-hero-decor i {
  position: absolute;
  opacity: 0;
  animation: decorFloat 12s ease-in-out infinite, heroFadeUp 1s ease-out forwards;
}
.cinefia-hero-decor i:nth-child(1) { top:8%;  left:7%;  font-size:1.5rem; color:rgba(139,92,246,0.07);  animation-delay:0s,-0.1s; }
.cinefia-hero-decor i:nth-child(2) { top:15%; right:9%; font-size:1.2rem; color:rgba(236,72,153,0.05);  animation-delay:-3s,0.2s; }
.cinefia-hero-decor i:nth-child(3) { top:42%; left:5%;  font-size:1.8rem; color:rgba(139,92,246,0.06);  animation-delay:-6s,0.4s; }
.cinefia-hero-decor i:nth-child(4) { top:32%; right:6%; font-size:1.1rem; color:rgba(236,72,153,0.06);  animation-delay:-2s,0.3s; }
.cinefia-hero-decor i:nth-child(5) { top:55%; left:12%; font-size:0.9rem; color:rgba(251,191,36,0.06);  animation-delay:-8s,0.5s; }
.cinefia-hero-decor i:nth-child(6) { top:22%; right:18%;font-size:1.3rem; color:rgba(139,92,246,0.05);  animation-delay:-5s,0.15s; }

@keyframes decorFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-14px) rotate(6deg); }
}

/* ========== THEATER CURTAIN ========== */

.cinefia-curtain {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.cinefia-curtain-left,
.cinefia-curtain-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
}

.cinefia-curtain-left {
  left: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(180,40,40,0.06) 0px, rgba(0,0,0,0.22) 3px,
      rgba(180,40,40,0.04) 7px, rgba(0,0,0,0.13) 13px,
      rgba(180,40,40,0.07) 19px,rgba(0,0,0,0.18) 26px,
      rgba(180,40,40,0.03) 34px),
    linear-gradient(90deg,
      rgba(0,0,0,0.38) 0%, rgba(0,0,0,0.1) 50%,
      rgba(200,80,80,0.06) 80%, rgba(0,0,0,0.18) 100%),
    linear-gradient(180deg,
      #2e0505 0%, #5a0e0e 10%, #7a1515 25%,
      #8d1b1b 40%, #961e1e 50%, #8d1b1b 60%,
      #7a1515 75%, #5a0e0e 90%, #2e0505 100%);
  box-shadow: inset -25px 0 45px rgba(0,0,0,0.55), 4px 0 18px rgba(139,92,246,0.12);
  animation: curtainOpenLeft 2s cubic-bezier(0.77,0,0.175,1) 0.6s both;
}

.cinefia-curtain-right {
  right: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0.18) 0px, rgba(180,40,40,0.03) 8px,
      rgba(0,0,0,0.13) 14px,rgba(180,40,40,0.07) 21px,
      rgba(0,0,0,0.22) 27px,rgba(180,40,40,0.04) 31px,
      rgba(0,0,0,0.06) 34px),
    linear-gradient(90deg,
      rgba(0,0,0,0.18) 0%, rgba(200,80,80,0.06) 20%,
      rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.38) 100%),
    linear-gradient(180deg,
      #2e0505 0%, #5a0e0e 10%, #7a1515 25%,
      #8d1b1b 40%, #961e1e 50%, #8d1b1b 60%,
      #7a1515 75%, #5a0e0e 90%, #2e0505 100%);
  box-shadow: inset 25px 0 45px rgba(0,0,0,0.55), -4px 0 18px rgba(139,92,246,0.12);
  animation: curtainOpenRight 2s cubic-bezier(0.77,0,0.175,1) 0.6s both;
}

.cinefia-curtain-valance {
  position: absolute;
  top: 0; left: -3%; right: -3%;
  height: 48px;
  z-index: 2;
  background: linear-gradient(180deg, #1a0303, #3a0606, #4a0808);
  box-shadow: 0 6px 24px rgba(0,0,0,0.7);
  animation: valanceFade 0.7s ease-in 2.1s both;
}
.cinefia-curtain-valance::after {
  content: '';
  position: absolute;
  bottom: 0; left: 3%; right: 3%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(197,160,40,0.2) 15%,
    rgba(218,185,64,0.4) 50%, rgba(197,160,40,0.2) 85%,
    transparent 100%);
}

@keyframes curtainOpenLeft  { from{transform:translateX(0)} to{transform:translateX(-100%)} }
@keyframes curtainOpenRight { from{transform:translateX(0)} to{transform:translateX(100%)} }
@keyframes valanceFade      { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(-100%)} }

/* ========== STAGE CONTENT ========== */

.cinefia-hero-content {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 8px 24px 0;
}

.cinefia-hero-content::before {
  content: '';
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(139,92,246,0.13) 0%, rgba(139,92,246,0.05) 40%, transparent 70%);
  animation: spotlightPulse 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes spotlightPulse {
  0%,100% { transform:translate(-50%,-50%) scale(1);   opacity:0.5; }
  50%     { transform:translate(-50%,-50%) scale(1.25); opacity:1; }
}

/* ---------- Logo ---------- */

.cinefia-hero-logo {
  font-size: clamp(3rem, 11vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1.1;
  position: relative;
  background: linear-gradient(110deg,
    #fff 0%, #fff 40%,
    var(--hero-purple-soft) 47%, var(--hero-purple-light) 50%,
    var(--hero-purple-soft) 53%, #fff 60%, #fff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroFadeUp 0.9s ease-out both, logoShimmer 5s ease-in-out 2.5s infinite;
}

.cinefia-hero-logo::after {
  content: '';
  display: block;
  width: 50%;
  height: 2px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--hero-purple), var(--hero-pink), transparent);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(139,92,246,0.5), 0 0 14px rgba(139,92,246,0.25), 0 0 28px rgba(139,92,246,0.1);
}

@keyframes logoShimmer {
  0%,16%   { background-position: 130% center; }
  84%,100% { background-position: -30% center; }
}

/* ---------- Tagline ---------- */

.cinefia-hero-tagline {
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  margin: 18px 0 0;
  animation: heroFadeUp 0.9s ease-out 0.3s both;
}

/* ---------- Description ---------- */

.cinefia-hero-desc {
  font-size: clamp(0.76rem, 1.8vw, 0.88rem);
  color: rgba(255,255,255,0.28);
  max-width: 380px;
  line-height: 1.6;
  margin: 10px 0 0;
  animation: heroFadeUp 0.9s ease-out 0.45s both;
}

/* ---------- CTA ---------- */

.cinefia-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  animation: heroFadeUp 0.9s ease-out 0.6s both;
}

.cinefia-hero-lang {
  animation: heroFadeUp 0.9s ease-out 0.75s both;
}

.cinefia-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  white-space: nowrap;
}

.cinefia-hero-btn--primary {
  background: linear-gradient(135deg, var(--hero-purple), #6d28d9);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,92,246,0.3), 0 0 40px rgba(139,92,246,0.08);
}
.cinefia-hero-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139,92,246,0.5), 0 0 50px rgba(139,92,246,0.12);
  background: linear-gradient(135deg, var(--hero-purple-light), var(--hero-purple));
}
.cinefia-hero-btn--primary:active { transform: translateY(0); }

.cinefia-hero-btn--secondary {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.1);
}
.cinefia-hero-btn--secondary:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
.cinefia-hero-btn--secondary:active { transform: translateY(0); }

/* ========== TRENDING — TWO ROWS ========== */

.cinefia-hero-trending {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 0 0 auto;
  margin-top: 20px;
  padding: 0;
  animation: heroFadeUp 0.9s ease-out 0.8s both;
}

.cinefia-hero-row {
  margin-bottom: 24px;
}
.cinefia-hero-row:last-child {
  margin-bottom: 0;
}

.cinefia-hero-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0 5% 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(139, 92, 246, 0.08);
}

.cinefia-hero-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.cinefia-hero-row-label i {
  font-size: 0.7rem;
  color: var(--hero-purple-light);
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.45));
}

.cinefia-hero-row-hint {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.28);
}

/* Marquee */

.cinefia-hero-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* iOS Safari: overflow:hidden + translate3d animasyonu → GPU compositor görselleri render etmiyor.
   Çözüm: overflow:hidden yerine clip-path:inset(0) ile kırpma + img'lere ayrı GPU katmanı */
@supports (-webkit-touch-callout: none) {
  .cinefia-hero-marquee {
    -webkit-mask-image: none;
    mask-image: none;
    overflow: visible;
    -webkit-clip-path: inset(0);
    clip-path: inset(0);
  }

  a.cinefia-hero-card img {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .cinefia-hero-trending {
    -webkit-animation: heroFadeUp 0.9s ease-out 0.8s both;
    animation: heroFadeUp 0.9s ease-out 0.8s both;
  }
  .cinefia-hero-actions {
    -webkit-animation: heroFadeUp 0.9s ease-out 0.6s both;
    animation: heroFadeUp 0.9s ease-out 0.6s both;
  }
}

.cinefia-hero-marquee-track {
  display: flex;
  gap: 12px;
  width: -webkit-max-content;
  width: max-content;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  /* Animasyon JS tarafından kartlar eklendikten sonra başlatılır (iOS Safari GPU katman fix) */
}

.cinefia-hero-marquee-track.marquee-active {
  -webkit-animation: heroMarquee var(--marquee-duration, 40s) linear infinite;
  animation: heroMarquee var(--marquee-duration, 40s) linear infinite;
}

.cinefia-hero-marquee:hover .cinefia-hero-marquee-track.marquee-active {
  -webkit-animation-play-state: paused;
  animation-play-state: paused;
}

.cinefia-hero-marquee--reverse .cinefia-hero-marquee-track.marquee-active {
  -webkit-animation-direction: reverse;
  animation-direction: reverse;
}

@-webkit-keyframes heroMarquee {
  from { -webkit-transform: translate3d(0, 0, 0); }
  to   { -webkit-transform: translate3d(-50%, 0, 0); }
}

@keyframes heroMarquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------- Poster cards (as links) ---------- */

a.cinefia-hero-card {
  flex-shrink: 0;
  width: 120px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition:
    transform 0.35s cubic-bezier(0.4,0,0.2,1),
    box-shadow 0.35s cubic-bezier(0.4,0,0.2,1);
}

a.cinefia-hero-card:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 12px 30px rgba(139,92,246,0.3), 0 0 16px rgba(139,92,246,0.1);
}

a.cinefia-hero-card img {
  width: 100%;
  height: auto;
  min-height: 150px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #12121e;
}

.cinefia-hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
a.cinefia-hero-card:hover .cinefia-hero-card-overlay { opacity: 1; }

.cinefia-hero-card-title {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.cinefia-hero-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.cinefia-hero-card-meta i {
  color: #fbbf24;
  font-size: 0.5rem;
}

/* ========== ANIMATIONS ========== */

@-webkit-keyframes heroFadeUp {
  from { opacity: 0; -webkit-transform: translateY(30px); transform: translateY(30px); }
  to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  /* İçerik viewport’tan kısaysa altta mor boşluk kalmasın — marquee kaydırmayı etkilemez */
  .cinefia-hero {
    min-height: auto;
    justify-content: flex-start;
    padding-bottom: 0;
    padding-top: clamp(32px, 7vw, 44px);
  }
  .cinefia-hero-content { padding: 4px 20px 0; }
  .cinefia-hero-trending { margin-top: 14px; }
  .cinefia-hero-tagline { margin-top: 14px; }
  .cinefia-hero-desc { margin-top: 8px; }
  .cinefia-hero-actions { margin-top: 18px; }
  .cinefia-hero-btn { padding: 9px 18px; font-size: 0.82rem; }
  a.cinefia-hero-card { width: 100px; }
  .cinefia-hero-content::before { width: 280px; height: 280px; }
  .cinefia-hero-decor i:nth-child(3) { left: 3%; }
  .cinefia-hero-decor i:nth-child(4) { right: 4%; }
  .cinefia-hero-row { margin-bottom: 18px; }
}

@media (max-width: 480px) {
  .cinefia-hero-content { padding: 2px 16px 0; }
  .cinefia-hero-trending { margin-top: 12px; }
  .cinefia-hero-actions { gap: 10px; margin-top: 16px; }
  .cinefia-hero-btn { padding: 8px 14px; font-size: 0.8rem; }
  a.cinefia-hero-card { width: 85px; }
  .cinefia-hero-content::before { width: 220px; height: 220px; }
  .cinefia-hero-decor i { font-size: 1rem !important; }
  .cinefia-hero-row { margin-bottom: 16px; }
  .cinefia-hero-row-head { padding: 0 4% 6px; }
  .cinefia-hero-row-label { font-size: 0.65rem; letter-spacing: 0.1em; }
  .cinefia-hero-row-hint { font-size: 0.55rem; }
  .cinefia-hero-marquee-track { gap: 8px; }
  .cinefia-hero-tagline { margin-top: 10px; }
  .cinefia-hero-desc { margin-top: 5px; }
}

@media (max-width: 360px) {
  .cinefia-hero-actions { gap: 8px; }
  .cinefia-hero-btn { padding: 8px 12px; font-size: 0.76rem; }
  a.cinefia-hero-card { width: 75px; }
  .cinefia-hero-row { margin-bottom: 14px; }
}

/* Hero ile sonraki blok arası — fazla boşluk bırakma */
.after-hero-gap {
  margin-top: 12px;
}
@media (max-width: 768px) {
  .after-hero-gap { margin-top: 6px; }
}

/* ========== REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce) {
  .cinefia-hero::before, .cinefia-hero::after,
  .cinefia-hero-content::before,
  .cinefia-hero-marquee-track,
  .cinefia-curtain-left, .cinefia-curtain-right,
  .cinefia-curtain-valance,
  .cinefia-hero-decor i { -webkit-animation: none; animation: none; }
  .cinefia-curtain { display: none; }
  .cinefia-hero-logo, .cinefia-hero-tagline,
  .cinefia-hero-desc, .cinefia-hero-actions,
  .cinefia-hero-trending { animation: none; opacity: 1; }
  .cinefia-hero-logo { -webkit-text-fill-color: white; background: none; }
  .cinefia-hero-decor i { opacity: 0.06; }
}
