/* ============================================================
   GLOBAL.CSS — MovieGPT Premium Design Tokens & Base Styles
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #060608;
  --bg2: #0b0b0f;
  --bg3: #12121a;
  --bg4: #191924;
  --pink: #ff4765;
  --purple: #bf5eff;
  --text: #f8fafc;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --border: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.02);
  --glass-glow: rgba(255, 71, 101, 0.05);
  --grad: linear-gradient(135deg, var(--pink), var(--purple));
  --grad-hover: linear-gradient(135deg, #ff6b82, #ca7aff);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(191, 94, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 71, 101, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

main {
  flex: 1;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg2);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg2);
  transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

/* ── Notification Bar (Django Messages) ── */
/* Removed old notif-bar styling */

/* ── Utility Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 2rem;
  background: var(--grad);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 71, 101, 0.25);
  transition: var(--transition);
  user-select: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 71, 101, 0.45);
  background: var(--grad-hover);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.btn-outline:active {
  transform: translateY(0);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 400px;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); margin-bottom: -100px; }
}
.toast.closing {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.toast-message {
  font-size: 0.85rem;
  color: var(--muted-light);
  line-height: 1.4;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.toast-close:hover {
  color: var(--text);
  transform: rotate(90deg);
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--pink);
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}
@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast.success .toast-icon { color: #10b981; }
.toast.success .toast-progress { background: #10b981; }
.toast.success .toast-title { color: #6ee7b7; }

.toast.error .toast-icon, .toast.danger .toast-icon { color: var(--pink); }
.toast.error .toast-progress, .toast.danger .toast-progress { background: var(--pink); }
.toast.error .toast-title, .toast.danger .toast-title { color: #fca5a5; }

.toast.warning .toast-icon { color: #f59e0b; }
.toast.warning .toast-progress { background: #f59e0b; }
.toast.warning .toast-title { color: #fcd34d; }

.toast.info .toast-icon { color: #38bdf8; }
.toast.info .toast-progress { background: #38bdf8; }
.toast.info .toast-title { color: #7dd3fc; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton shimmer ── */
@keyframes shimmer {
  to { background-position: -200% 0; }
}
.skel-base {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ── Movie Card (shared) ── */
.movie-card {
  flex-shrink: 0;
  width: 170px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  color: var(--text);
  position: relative;
  transition: var(--transition);
}
.movie-card:hover {
  transform: translateY(-8px);
}

.card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg3);
  display: block;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.movie-card:hover .card-poster {
  box-shadow: 0 16px 36px rgba(191, 94, 255, 0.15);
  border-color: rgba(191, 94, 255, 0.25);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
  letter-spacing: -0.2px;
}
.movie-card:hover .card-title {
  color: var(--pink);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.82rem;
}

/* ── Horizontal Scrollable Row (Carousel) ── */
.carousel-wrap {
  position: relative;
  width: 100%;
}
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
}
.carousel-wrap:hover .scroll-btn {
  opacity: 1;
}
.scroll-btn:hover {
  background: rgba(191, 94, 255, 0.8);
  border-color: rgba(191, 94, 255, 1);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.scroll-btn.left {
  left: -22px;
}
.scroll-btn.right {
  right: -22px;
}
.scroll-btn svg {
  width: 20px;
  height: 20px;
}

.movie-row {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 0 1.2rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
}
.movie-row::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ── Section Helpers ── */
.section {
  padding: 3rem 2.5rem;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-title svg {
  color: var(--pink);
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}
.section-title .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
  flex-shrink: 0;
}
.section-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.section-label::before {
  content: '';
  display: block;
  width: 4px;
  height: 14px;
  background: var(--grad);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.see-all {
  font-size: 0.88rem;
  color: var(--pink);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.85;
}
.see-all:hover {
  opacity: 1;
  transform: translateX(3px);
}

/* ── Gradient Text ── */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glass panel helper ── */
.glass-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
}

/* ── Fade-up animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Global Trailer Modal ── */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(6, 6, 8, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.trailer-modal.open,
.trailer-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: all !important;
}
.trailer-box {
  width: 100%;
  max-width: 900px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(30px); }
  to { opacity: 1; transform: none; }
}
.trailer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  background: rgba(18, 18, 26, 0.95);
  border-bottom: 1px solid var(--border);
}
.trailer-head-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}
.trailer-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.trailer-close:hover {
  background: rgba(255, 71, 101, 0.15);
  border-color: var(--pink);
  color: var(--pink);
  transform: rotate(90deg);
}
#modalPlayerWrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: black;
}

/* ── Inline Trailer Section (yt-lite) ── */
.videos-section { margin-top: 2.5rem; }
.yt-lite { position: relative; max-width: 820px; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--border, rgba(255,255,255,0.1)); cursor: pointer; }
.yt-thumb { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: opacity 0.25s; }
.yt-lite:hover .yt-thumb { opacity: 0.6; }
.yt-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; transition: transform 0.2s; }
.yt-lite:hover .yt-play-btn { transform: translate(-50%,-50%) scale(1.1); }
.yt-play-btn svg { width: 72px; height: 72px; filter: drop-shadow(0 4px 20px rgba(0,0,0,0.7)); }
.yt-hint { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); font-family: 'Space Mono', monospace; font-size: 0.65rem; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.75); background: rgba(0,0,0,0.55); padding: 0.3rem 0.9rem; border-radius: 50px; pointer-events: none; white-space: nowrap; }
.yt-iframe-wrap { display: none; position: relative; width: 100%; padding-bottom: 56.25%; }
.yt-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.yt-lite.playing .yt-thumb, .yt-lite.playing .yt-play-btn, .yt-lite.playing .yt-hint { display: none; }
.yt-lite.playing { cursor: default; }
.yt-lite.playing .yt-iframe-wrap { display: block; }
.yt-open { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.8rem; font-family: 'Space Mono', monospace; font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted, #888); text-decoration: none; transition: color 0.2s; }
.yt-open:hover { color: var(--pink, #ff4765); }
.no-trailer { width: 100%; max-width: 820px; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--muted, #888); flex-direction: column; gap: 0.6rem; border-radius: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border, rgba(255,255,255,0.1)); }

/* ── Global Mobile Responsive Adjustments ── */
@media (max-width: 768px) {
  .section {
    padding: 2rem 1.25rem;
  }
  .movie-card, .skeleton {
    width: 130px;
  }
  .movie-row {
    gap: 0.75rem;
    padding-bottom: 1rem;
  }
  h1, .hero-title {
    font-size: clamp(2rem, 6vw, 2.8rem) !important;
  }
  .section-title {
    font-size: 1.1rem;
  }
}

/* ── Global AdSense & Ad Container Dark Theme Overrides ── */
ins.adsbygoogle,
iframe[id^="aswift_"],
iframe[id^="google_ads_frame"],
.google-auto-placed,
.adsbygoogle-noablate {
  background-color: transparent !important;
  color-scheme: dark !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

/* Force ad wrappers to match dark glassmorphism */
div[id^="google_ads_iframe"],
.adsbygoogle-inserted {
  background: rgba(18, 18, 26, 0.4) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(10px) !important;
}
