/* =============================================
   1. Global Resets & Base Styles
   ============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Font Loading --- */
@font-face {
  font-family: "Arslan Wessam B";
  src: url("fonts/arfonts-arslan-wessam-b-arslan-wessam-b.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Display";
  src: url("fonts/LyonArabicDisplay-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Display";
  src: url("fonts/LyonArabicDisplay-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Text";
  src: url("fonts/LyonArabicText-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Text";
  src: url("fonts/LyonArabicText-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Text";
  src: url("fonts/LyonArabicText-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lyon Arabic Text";
  src: url("fonts/LyonArabicText-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables (Root) --- */
:root {
  /* Brand Colors */
  --color-primary-light-blue: #82e9f4;
  --color-primary-dark-blue: #0303ff;
  --color-primary-yellow: #eaff55;

  /* Secondary & Utility Colors */
  --color-secondary-dark-teal: #0a4651;
  --color-secondary-red: #d91c24;
  --color-secondary-pink: #ff9fbf;
  --color-background-dark: #0a4651;
  --color-text-light: #f0f0f0;
  --color-text-dark: #121212;
  --color-white: #ffffff;

  /* Fonts */
  --font-primary: "Lyon Arabic Text", "Times New Roman", serif;
  --font-secondary: "Arslan Wessam B", "Tahoma", sans-serif;
  --font-fallback: "Tahoma", "Arial", sans-serif;

  /* Spacing & Sizing */
  --spacing-small: 8px;
  --spacing-medium: 16px;
  --spacing-large: 32px;
  --spacing-xlarge: 64px;
  --navbar-height: 70px;
}

/* --- General Body & Typography --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary), var(--font-fallback);
  background-image: url("images/backgrounds/page_bg_without_lines.jpg");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--color-text-light);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary), var(--font-fallback);
  font-weight: bold;
  margin-bottom: var(--spacing-medium);
  color: var(--color-primary-yellow);
  line-height: 1.3;
}

h1 {
  font-size: 2.8rem;
}
h2 {
  font-size: 2.2rem;
}
h3 {
  font-size: 1.8rem;
}

p {
  margin-bottom: var(--spacing-medium);
}

a {
  color: var(--color-primary-light-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-yellow);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Reusable Container --- */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--spacing-large) var(--spacing-medium);
}

/* =============================================
   2. Navigation Bar
   ============================================= */
.navbar {
  background-color: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
  height: var(--navbar-height);
}

.navbar .nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 var(--spacing-medium);
}

.logo {
  height: 55px;
  width: auto;
}
.logo-link {
  line-height: 0; /* Removes extra space around the logo image */
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin: 0 var(--spacing-small);
}

.nav-links a {
  font-family: var(--font-secondary), var(--font-fallback);
  color: var(--color-text-light);
  padding: var(--spacing-small) var(--spacing-medium);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}


.nav-links a:hover {
  background-color: var(--color-primary-yellow);
  color: var(--color-text-dark);
}

/* Top-nav social icons (desktop) */
.nav-social-links {
  display: flex;
  align-items: center;
}
.nav-social-links a {
  margin-left: var(--spacing-medium);
  display: inline-block;
}
.nav-social-links img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.nav-social-links a:hover img {
  opacity: 1;
  transform: scale(1.1);
}

/* Mobile: hide top-nav social icons so only the footer ones show */
/* Mobile (≤768px): center nav-links, hide social icons, pin logo */
@media (max-width: 768px) {
  .navbar .nav-container {
    position: relative;
    justify-content: center;
  }

  .logo-link {
    position: absolute;
    right: var(--spacing-medium);
    top: 50%;
    transform: translateY(-50%);
  }

  .nav-social-links {
    display: none;
  }

  .nav-links {
    display: flex;
    gap: 0.5rem;
    transform: translateX(-50px); /* ← shift links left by 20px */
  }
  .nav-links li {
    margin: 0 0.25rem;
  }
  .nav-links a {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
  }
}


/* =============================================
   3. Full-Screen Poster Section
   ============================================= */
.poster-section {
  height: 100vh;
  min-height: 500px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  background-image: url("images/poster-vertical.webp");
  /* Fades the bottom of the poster to blend with the content below */
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 75%,
    transparent 95%
  );
  mask-image: linear-gradient(to bottom, black 75%, transparent 95%);
}

/* =============================================
   4. Main Content Area
   ============================================= */
.main-content-area {
  position: relative;
  z-index: 2;
  background-color: transparent;
  /* Pulls the content up to overlap with the faded poster */
  margin-top: -15vh;
  padding-top: 15vh;
}

/* --- Movie Title and Tagline --- */
.movie-intro {
  text-align: center;
  padding: var(--spacing-xlarge) 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.4) 20%,
    rgba(0, 0, 0, 0.4) 80%,
    rgba(0, 0, 0, 0) 100%
  );
}

.movie-intro h1 {
  font-family: var(--font-primary), var(--font-fallback);
  color: var(--color-primary-yellow);
  font-size: 3.5rem;
  margin-bottom: var(--spacing-small);
  text-shadow: 0 0 15px rgba(234, 255, 85, 0.5);
}

.movie-intro .tagline {
  font-family: var(--font-secondary), var(--font-fallback);
  font-size: 1.6rem;
  color: var(--color-primary-light-blue);
}

/* =============================================
   5. About the Movie Section
   ============================================= */
.about-movie-section {
  padding: var(--spacing-xlarge) 0;
  background-image: url("images/backgrounds/page_bg_with_lines.jpg");
  background-size: cover;
  background-position: center;
  color: var(--color-text-light);
  /* Fades the top and bottom to blend with other sections */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

/* Mobile-first layout using CSS Grid for custom ordering */
.about-movie-container {
  display: grid;
  grid-template-columns: 1fr; /* Single column for mobile */
  gap: var(--spacing-large);
  align-items: center;
  max-width: 95%;
}

/* Allows us to directly control the grid position of h2 and p */
.about-text-content {
  display: contents;
}

.about-text-content h2 {
  font-family: var(--font-primary), var(--font-fallback);
  font-size: 3rem;
  color: var(--color-primary-yellow);
  margin-bottom: var(--spacing-medium);
  grid-row: 1; /* Order: 1. Heading */
  text-align: center;
}

.about-text-content p {
  font-size: 1.2rem;
  line-height: 1.7;
  color: black;
  background-image: url("images/backgrounds/paper.png");
  background-size: cover;
  padding: 1rem;
  grid-row: 3; /* Order: 3. Paragraph */
}

.about-image-content {
  max-width: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  grid-row: 2; /* Order: 2. Image */
}

.about-image-content img {
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* =============================================
   6. Trailer Section
   ============================================= */
.trailer-section {
  text-align: center;
  padding-top: var(--spacing-xlarge);
  padding-bottom: var(--spacing-xlarge);
}

.trailer-section h2 {
  font-family: var(--font-secondary), var(--font-fallback);
  font-size: 2.8rem;
  color: var(--color-primary-yellow);
  margin-bottom: var(--spacing-large);
}

/* Responsive video container to maintain 16:9 aspect ratio */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 0 auto;
  border: 5px solid var(--color-primary-dark-blue);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(3, 3, 255, 0.7);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* =============================================
   7. Buttons & Ticket Section
   ============================================= */
.ticket-section {
  text-align: center;
  padding: var(--spacing-large) var(--spacing-medium);
  margin-bottom: var(--spacing-xlarge);
}

/* --- General Button Styles --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: var(--spacing-medium) var(--spacing-large);
  font-family: var(--font-primary), var(--font-fallback);
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  margin-top: var(--spacing-medium);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* --- Primary Button (Yellow) --- */
.btn-primary {
  background-color: var(--color-primary-yellow);
  color: var(--color-text-dark);
  animation: pulse 2.5s infinite;
}
.btn-primary:hover {
  background-color: #d4e04a;
  color: var(--color-text-dark);
  animation-play-state: paused;
}

/* --- Secondary Button (Blue) --- */
.btn-secondary {
  background-color: var(--color-primary-dark-blue);
  color: var(--color-white);
}
.btn-secondary:hover {
  background-color: #0000dd;
  color: var(--color-white);
}

/* --- Larger Button Variant --- */
.btn-larger {
  padding: calc(var(--spacing-medium) * 1.5)
    calc(var(--spacing-large) * 1.8);
  font-size: 1.5rem;
  letter-spacing: 1.5px;
}

/* --- Icon inside a button --- */
.btn img {
  height: 1.6em; /* Scales with the button's font-size */
  width: auto;
}

/* =============================================
   8. Game Section
   ============================================= */
.game-section {
  text-align: center;
  padding: var(--spacing-xlarge) var(--spacing-medium);
  margin-bottom: var(--spacing-large);
  background-image: url("images/backgrounds/game_text_bg.png");
  background-size: cover;
  border-radius: 12px;
  min-height: 350px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}

.game-content-wrapper {
  padding: var(--spacing-xlarge) var(--spacing-large);
  margin-bottom: var(--spacing-large);
  border-radius: 10px;
  max-width: 400px;
  width: 100%;
  position: relative;
  /* Shifts the content slightly for a layered effect */
  transform: translate(10px, 100px);
}

.game-section h2 {
  font-family: var(--font-primary), var(--font-fallback);
  color: var(--color-primary-yellow);
  font-size: 4rem;
}

.game-section p {
  color: var(--color-primary-light-blue);
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  font-size: 4rem;
  line-height: 1.6;
}

/* =============================================
   9. Footer
   ============================================= */
.social-section {
  background-color: var(--color-background-dark);
  color: var(--color-text-light);
  text-align: center;
  padding: var(--spacing-medium) 0;
  border-top: 2px solid var(--color-primary-dark-blue);
}

.social-section h3 {
  margin-bottom: var(--spacing-small);
  color: var(--color-primary-light-blue);
  font-size: 1.5rem;
}

.social-links a {
  margin: 0 var(--spacing-medium);
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-links img {
  width: 32px;
  height: 32px;
  filter: grayscale(20%) brightness(110%);
}

.social-links a:hover img {
  filter: grayscale(0%) brightness(100%)
    drop-shadow(0 0 6px var(--color-primary-light-blue));
  transform: scale(1.18);
}

.footer-logos {
  margin: var(--spacing-medium) auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-large);
  flex-wrap: wrap;
}
.footer-logos img {
  max-height: 50px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
.footer-logos a:hover img,
.footer-logos img:hover {
  opacity: 1;
}
.studio-logo img {
  max-height: 40px;
}

.copyright,
.made-by {
  margin-top: var(--spacing-small);
  font-size: 0.9rem;
  color: #aaa;
}
.copyright {
  margin-top: 0;
}
.made-by {
  font-size: 0.85rem;
  color: #888;
}

/* =============================================
   10. Animations
   ============================================= */

/* --- Pulsing effect for primary buttons --- */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(234, 255, 85, 0.7);
  }
  70% {
    transform: scale(1.03);
    box-shadow: 0 0 0 15px rgba(234, 255, 85, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(234, 255, 85, 0);
  }
}

/* --- On-scroll fade-in animation for sections --- */
.animated-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animated-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   11. Responsive Design (Media Queries)
   ============================================= */

/* --- Small Mobile Devices (up to 480px) --- */
@media (max-width: 480px) {
  .nav-links {
    font-size: 0.8rem;
  }
  .nav-links li {
    margin: 0 3px;
  }
  .nav-social-links a {
    margin-left: var(--spacing-small);
  }
  .nav-social-links img {
    width: 20px;
    height: 20px;
  }
  .logo {
    height: 45px;
  }

  .movie-intro h1 {
    font-size: 2.5rem;
  }
  .movie-intro .tagline {
    font-size: 1.2rem;
  }
  .about-text-content h2 {
    font-size: 2.5rem;
  }
  .trailer-section h2 {
    font-size: 2rem;
  }
  .game-section h2 {
    font-size: 3rem;
  }
  .game-section p {
    font-size: 2rem;
  }
  .game-content-wrapper {
    padding: var(--spacing-medium) var(--spacing-small);
  }
  .btn-larger {
    padding: var(--spacing-medium) var(--spacing-large);
    font-size: 1.2rem;
  }
}

/* --- Mobile Game Section Fix (up to 768px) --- */
@media (max-width: 768px) {
  .game-section {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .game-content-wrapper {
    max-width: 100%;
    transform: none; /* Reset position on mobile */
  }
}

/* --- Tablet & Larger Screens (768px and up) --- */
@media (min-width: 768px) {
  .poster-section {
    /* Switch to the horizontal poster on larger screens */
    background-image: url("images/poster-horizontal.jpg") !important;
  }

  h1 {
    font-size: 3.8rem;
  }
  h2 {
    font-size: 2.8rem;
  }
  .movie-intro h1 {
    font-size: 4.5rem;
  }
  .movie-intro .tagline {
    font-size: 1.8rem;
  }

  .container {
    width: 85%;
  }

  .nav-links a {
    font-size: 1rem;
  }
  .nav-social-links img {
    width: 26px;
    height: 26px;
  }
  
  .nav-links {
    transform: translateX(-55px);
  }

  /* Revert "About" section to flexbox for standard side-by-side layout */
  .about-movie-container {
    display: flex;
    flex-direction: row;
    text-align: right;
    gap: var(--spacing-xlarge);
    max-width: 1300px;
  }
  .about-text-content {
    display: block; /* Revert from 'contents' */
    text-align: right;
    padding-left: var(--spacing-large);
    flex: 1.2;
  }
  .about-image-content {
    justify-content: flex-start;
    flex: 0.8;
    max-width: 600px;
  }
  .about-text-content h2 {
    font-size: 3rem;
    text-align: right; /* Ensure heading is right-aligned */
  }
  .about-text-content p {
    font-size: 1.3rem;
    line-height: 1.8;
  }

  .trailer-section h2 {
    font-size: 4rem;
  }
  .game-section h2 {
    font-size: 3rem;
  }
  .game-section p {
    font-size: 2rem;
  }
  .btn-larger {
    padding: calc(var(--spacing-medium) * 1.6)
      calc(var(--spacing-large) * 2);
    font-size: 1.6rem;
  }
}

/* --- Desktop Screens (1024px and up) --- */
@media (min-width: 1024px) {
  .container {
    width: 80%;
    max-width: 1200px;
  }
  .movie-intro h1 {
    font-size: 5rem;
  }
  .movie-intro .tagline {
    font-size: 2rem;
  }

  /* Further refine "About" section for large desktops */
  .about-movie-container {
    max-width: 1500px;
  }
  .about-text-content h2 {
    font-size: 3rem;
  }
  .about-text-content p {
    font-size: 1.5rem;
  }
  .about-image-content {
    max-width: 700px;
  }

  .trailer-section h2 {
    font-size: 3.2rem;
  }
  .game-section h2 {
    font-size: 3rem;
  }
  .btn-larger {
    font-size: 1.7rem;
  }
  .social-links img {
    width: 34px;
    height: 34px;
  }
  .footer-logos img {
    max-height: 60px;
  }
  .studio-logo img {
    max-height: 50px;
  }
}