/* ── CSS Variables ── */
    :root {
      --color-primary: #0D0D0D;
      --color-secondary: #1F1F1F;
      --color-accent: #E50914;
      --color-text: #FFFFFF;
      --font-main: 'Noto Naskh Arabic', serif;
    }

    /* ── Global base ── */
    * { font-family: var(--font-main); }
    body { background-color: var(--color-primary); color: var(--color-text); direction: rtl; line-height: 1.8; }
    @media (max-width: 767px) { body { padding-bottom: 4.5rem; } }

    /* -- font settings -- */
    h1,h2,h3,h4,h5,h6{font-family: 'AMBILE Shadow'}
    .font-ambile-shadow {font-family: 'AMBILE Shadow' !important;}
    .font-ambile {font-family: 'MB Lateefi Sans'}

    /* ── Utility ── */
    .accent { color: var(--color-accent); }
    .accent-bg { background-color: var(--color-accent); }
    .secondary-bg { background-color: var(--color-secondary); }

    /* ── Nav underline pseudo-element ── */
    .nav-link { position: relative; transition: color 0.2s; }
    .nav-link::after { content: ''; position: absolute; bottom: -4px; right: 0; width: 0; height: 2px; background-color: var(--color-accent); transition: width 0.3s ease; }
    .nav-link:hover::after { width: 100%; }
    .nav-link:hover { color: var(--color-accent); }

    /* ── Section title accent bar pseudo-element ── */
    .section-title::before { content: ''; display: inline-block; width: 5px; height: 1.2em; background-color: var(--color-accent); margin-left: 12px; vertical-align: middle; border-radius: 2px; }

    /* ── Hero slider ── */
    .hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
    .hero-slide.active { opacity: 1; pointer-events: auto; }
    .hero-dot { width: 8px; height: 8px; border-radius: 9999px; background: rgba(255,255,255,0.4); transition: all 0.35s; cursor: pointer; }
    .hero-dot.active { width: 28px; background: white; }
    .hero-arrow { width: 44px; height: 44px; border-radius: 50%; background: rgba(13,13,13,0.6); border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: white; transition: all 0.2s; backdrop-filter: blur(4px); }
    .hero-arrow:hover { background: #E50914; border-color: #E50914; }
    .hero-backdrop { min-height: 520px; position: relative; overflow: hidden; }

    /* ── Movie / Series card animations ── */
    .mc { transition: transform 0.32s cubic-bezier(.22,.68,0,1.2), box-shadow 0.32s ease; }
    .mc:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 0 0 2.5px #E50914, 0 28px 56px rgba(229,9,20,0.28); }
    .mc-poster { transition: transform 0.55s ease; }
    .mc:hover .mc-poster { transform: scale(1.07); }
    .mc-actions { opacity: 0; transform: translateY(10px); transition: opacity 0.28s ease, transform 0.28s ease; }
    .mc:hover .mc-actions { opacity: 1; transform: translateY(0); }
    .mc-title { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;}
    .mc-btn-save.saved { background: rgba(229,9,20,0.25) !important; border-color: #E50914 !important; color: #fca5a5 !important; }

    /* ── Top-rated row hover animation ── */
    .card-hover { transition: transform 0.3s ease, box-shadow 0.3s ease; }
    .card-hover:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(229,9,20,0.2); }

    /* ── Actor card animations ── */
    .ac { transition: transform 0.32s cubic-bezier(.22,.68,0,1.2); }
    .ac:hover { transform: translateY(-7px); }
    .ac::before { content: ''; position: absolute; top: 0; left: 5%; right: 5%; aspect-ratio: 1/1; border-radius: 9999px; background: radial-gradient(ellipse at center, rgba(229,9,20,0.3) 0%, transparent 70%); opacity: 0; transition: opacity 0.4s ease; pointer-events: none; z-index: 0; }
    .ac:hover::before { opacity: 1; }
    .ac-avatar { box-shadow: 0 0 0 2.5px rgba(255,255,255,0.07), 0 8px 24px rgba(0,0,0,0.55); transition: box-shadow 0.35s ease; }
    .ac:hover .ac-avatar { box-shadow: 0 0 0 3px #E50914, 0 0 32px rgba(229,9,20,0.42), 0 8px 24px rgba(0,0,0,0.5); }
    .ac-avatar img { transition: transform 0.48s ease, filter 0.35s ease; }
    .ac:hover .ac-avatar img { transform: scale(1.1); filter: brightness(1.1) saturate(1.12); }
    .ac-name { transition: color 0.25s; }
    .ac:hover .ac-name { color: #fca5a5; }

    /* ── Bottom navigation active/hover ── */
    .bottom-nav-link { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; padding: 8px 4px; color: #6B7280; transition: color 0.2s; text-decoration: none; }
    .bottom-nav-link.active, .bottom-nav-link:hover { color: var(--color-accent); }
    .bottom-nav-link .nav-icon { font-size: 1.2rem; }
    .bottom-nav-link .nav-label { font-size: 0.6rem; line-height: 1; }

    /* ── Scrollbar ── */
    .scrollbar-hide::-webkit-scrollbar { display: none; }
    .scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

    /* ── Movie page ── */
    .rating-circle { width: 80px; height: 80px; border-radius: 50%; background: conic-gradient(#E50914 calc(8.7 / 10 * 360deg), #333 0deg); display: flex; align-items: center; justify-content: center; }
    .rating-circle-inner { width: 64px; height: 64px; border-radius: 50%; background-color: var(--color-secondary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; color: white; }
    .cast-img { aspect-ratio: 3/4; object-fit: cover; }
    .tag-pill { background-color: rgba(229,9,20,0.12); border: 1px solid rgba(229,9,20,0.3); }
    .info-row { border-bottom: 1px solid rgba(255,255,255,0.06); }
    .info-row:last-child { border-bottom: none; }
    .review-card { border-right: 3px solid var(--color-accent); }
    .star-bar-fill { background: linear-gradient(to left, #E50914, #ff6b6b); border-radius: 9999px; height: 100%; }
    .tab-btn { border-bottom: 2px solid transparent; transition: all 0.2s; }
    .tab-btn.active { border-bottom-color: var(--color-accent); color: white; }
    .tab-content { display: none; }
    .tab-content.active { display: block; }
    .overlay-bottom { background: linear-gradient(to top, rgba(13,13,13,1) 0%, rgba(13,13,13,0.5) 60%, transparent 100%); }
    .movie-poster-main { aspect-ratio: 2/3; object-fit: cover; }

    /* Platform badges */
    .platform-badge { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); transition: all 0.2s; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none; }
    .platform-badge:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }

    /* Trailer Modal */
    #trailer-modal { display: none; }
    #trailer-modal.open { display: flex; }

    /* Review Popup */
    #review-modal { display: none; }
    #review-modal.open { display: flex; }

    /* Subtitle table */
    .sub-table th { background: rgba(229,9,20,0.1); color: #E50914; font-size: 0.8rem; padding: 10px 14px; }
    .sub-table td { padding: 10px 14px; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .sub-table tr:last-child td { border-bottom: none; }
    .sub-table tr:hover td { background: rgba(255,255,255,0.03); }

    /* ── Day theme ── */
    [data-theme="day"] body { background-color: #F3F4F6 !important; color: #111827 !important; }
    [data-theme="day"] .text-white { color: #111827 !important; }
    [data-theme="day"] .text-gray-300 { color: #4B5563 !important; }
    [data-theme="day"] .text-gray-400 { color: #6B7280 !important; }
    [data-theme="day"] .text-gray-500 { color: #9CA3AF !important; }
    [data-theme="day"] .text-gray-600 { color: #9CA3AF !important; }
    [data-theme="day"] .text-gray-700 { color: #D1D5DB !important; }
    [data-theme="day"] .secondary-bg { background-color: #FFFFFF !important; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
    [data-theme="day"] .bg-gray-800 { background-color: #E5E7EB !important; }
    [data-theme="day"] .border-gray-800 { border-color: #E5E7EB !important; }
    [data-theme="day"] .border-gray-700 { border-color: #D1D5DB !important; }
    [data-theme="day"] #navbar { background: rgba(255,255,255,0.97) !important; border-bottom: 1px solid #E5E7EB !important; }
    [data-theme="day"] #bottom-nav { background: rgba(255,255,255,0.97) !important; border-top-color: #E5E7EB !important; }
    [data-theme="day"] footer { background-color: #FFFFFF !important; border-top-color: #E5E7EB !important; }
    [data-theme="day"] .bottom-nav-link { color: #9CA3AF; }
    [data-theme="day"] .bottom-nav-link.active, [data-theme="day"] .bottom-nav-link:hover { color: #E50914; }
    [data-theme="day"] .ac-name { color: #111827; }
    [data-theme="day"] .ac:hover .ac-name { color: #b91c1c; }
    [data-theme="day"] .ac-role { background: rgba(255,255,255,0.9) !important; color: #1f2937 !important; }
    [data-theme="day"] .hero-grad-side { background: linear-gradient(to left,rgba(243,244,246,0),rgba(243,244,246,0.6) 50%,rgba(243,244,246,0.95)) !important; }
    [data-theme="day"] .hero-grad-bottom { background: linear-gradient(to top,rgba(243,244,246,1) 0%,transparent 40%) !important; }

    /* ── Theme toggle icon visibility ── */
    #theme-toggle .fa-moon { display: none; }
    #theme-toggle .fa-sun { display: inline; }
    [data-theme="day"] #theme-toggle .fa-sun { display: none; }
    [data-theme="day"] #theme-toggle .fa-moon { display: inline; }



/* =============================================
   ALERTS / NOTIFICATIONS
   ============================================= */
.alert {
  padding: 0.875rem 1rem; border-radius: 8px; border: 1px solid;
  display: flex; align-items: flex-start; gap: 0.625rem;
  font-size: 0.875rem;
}
.alert-success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: #22C55E; }
.alert-error   { background: rgba(229,9,20,0.1);   border-color: rgba(229,9,20,0.3);   color: #b91c1c; }
.alert-info    { background: rgba(59,130,246,0.1);  border-color: rgba(59,130,246,0.3); color: #3B82F6; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #F59E0B; }

/* Toast notifications */
.toast-container {
  position: fixed; top: 80px; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background:#fff; border: 1px solid #1F1F1F;
  border-radius: 10px; padding: 0.875rem 1rem;
  font-size: 0.875rem; color: #0D0D0D;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 0.625rem;
  pointer-events: all; animation: slideIn 0.35s ease;
  min-width: 260px; max-width: 320px;
}
.toast.success { border-left: 3px solid #22C55E; }
.toast.error   { border-left: 3px solid #b91c1c; }
.toast.info    { border-left: 3px solid #3B82F6; }
.toast.warning { border-left: 3px solid #F59E0B; }

@keyframes slideIn  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut  { to   { opacity: 0; transform: translateX(100%); } }