/* ===================================
   Home Page Styles
   =================================== */

/* Carousel Container */
.carousel-container {
  padding: 20px 0;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.carousel-item-padding {
  padding: 10px;
  display: flex;
  justify-content: center;
}

.main_img_home {
  width: 100%;
  max-width: 1480px;
  height: auto;
  aspect-ratio: 16 / 8;
  margin: 0 auto;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  font-family: "Emkan";
  font-weight: bold;
  border-radius: 40px;
  object-fit: cover;
}

/* ===================================
   Hero Section with Typewriter
   =================================== */

.hero-section {
  position: relative;
  width: 100%;
  max-width: 1480px;
  margin: 130px auto 0 auto;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 5%;
  transform: translateY(-50%);
  text-align: left;
  z-index: 10;
  width: 90%;
}

/* ---- Shared base for all hero lines ---- */
.typewriter {
  font-family: "Emkan", sans-serif;
  font-weight: 700;
  color: #938d8d;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  margin: 0;
  direction: ltr;
}

/* Lines that actually "type" need these */
.typewriter--line1,
.typewriter--line2 {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  border-right: 4px solid transparent;
}

/* -------------------------------------------------------------------
   OPTION 1 — Sequential typing
   ------------------------------------------------------------------- */

/* Line 1 — big & bold; types first, caret blinks then hides */
.typewriter--line1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  animation:
    typing 3s steps(25, end) forwards,
    caret-line1 0.75s step-end 4;
}

/* Line 2 — noticeably smaller & lighter than line 1 */
.typewriter--line2 {
  font-size: 2rem;
  font-weight: 600;
  color: #938d8d;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  margin-top: 14px;
  margin-left: 10px;
  animation:
    typing-line2 2.5s steps(20, end) 3s forwards,
    blink-caret 0.75s step-end infinite 3s;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 25ch;
  }
}

@keyframes typing-line2 {
  from {
    width: 0;
  }
  to {
    width: 21ch;
  }
}

@keyframes caret-line1 {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: #938d8d;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #938d8d;
  }
}

/* -------------------------------------------------------------------
   OPTION 2 — Fade & slide up (staggered)
   ------------------------------------------------------------------- */

.typewriter--fade1 {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: fade-in-words 0.9s ease 0.2s forwards;
}

.typewriter--fade2 {
  font-size: 2rem;
  font-weight: 600;
  color: #b7b1b1;
  margin-top: 14px;
  opacity: 0;
  animation: fade-in-words 0.9s ease 0.9s forwards;
}

/* -------------------------------------------------------------------
   OPTION 3 — Soft fade for line 2 (pairs with OPTION 1 line 1)
   ------------------------------------------------------------------- */

.typewriter--soft2 {
  font-size: 2rem;
  font-weight: 600;
  color: #b7b1b1;
  margin-top: 14px;
  opacity: 0;
  animation: fade-in-words 1s ease 3s forwards; /* starts when line 1 ends */
}

/* -------------------------------------------------------------------
   OPTION 4 — Gradient text (add alongside any line-2 modifier)
   ------------------------------------------------------------------- */

.typewriter--gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

/* Shared fade keyframe (used by options 2 & 3, and mobile) */
@keyframes fade-in-words {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Pre-roll Video
   =================================== */

/* ============================================================
   StyleHome.css
   Replace your existing `.Home-Pre-Video` rule (~line 202)
   with the block below. Pure CSS — no JSX / markup changes.
   ============================================================ */

/* ============================================================
   StyleHome.css  —  Blurred-fill cinematic pre-video
   Replace your `.Home-Pre-Video` rule (~line 202) with everything
   below. Requires the .pre-video-stage wrapper in your JSX
   (blur <video> + .pre-video-veil + sharp <video>).
   ============================================================ */

/* The frame that holds everything */
.pre-video-stage {
  position: relative;
  width: 100%;
  max-width: 1380px;
  aspect-ratio: 16 / 5;
  margin: 180px auto 0 auto;
  border-radius: 40px;
  overflow: hidden;
  isolation: isolate; /* keep the blur/stacking self-contained */
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 50px rgba(124, 58, 237, 0.25);
}

/* Thin glassy glow ring around the frame (border via mask trick) */
.pre-video-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.65),
    rgba(124, 58, 237, 0.1) 45%,
    rgba(168, 85, 247, 0.45)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Background layer: the SAME footage, blurred + zoomed + slowly drifting */
.pre-video-blur {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(42px) brightness(0.5) saturate(1.25);
  transform: scale(1.2);
  will-change: transform;
  animation: preVideoDrift 22s ease-in-out infinite alternate;
}

@keyframes preVideoDrift {
  from {
    transform: scale(1.2) translate3d(-1.5%, -1%, 0);
  }
  to {
    transform: scale(1.32) translate3d(1.5%, 1%, 0);
  }
}

/* Purple veil: vignette for depth + brand tint */
.pre-video-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 28%,
      rgba(13, 10, 31, 0.55) 100%
    ),
    linear-gradient(135deg, rgba(124, 58, 237, 0.22), transparent 60%);
}

/* Foreground: the sharp, centered clip */
.Home-Pre-Video {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 10px 34px rgba(0, 0, 0, 0.6));
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .pre-video-blur {
    animation: none;
  }
}

/* Phones: 16:5 is too short — loosen the frame and ease the blur cost */
@media (max-width: 600px) {
  .pre-video-stage {
    aspect-ratio: 16 / 7;
    margin-top: 100px;
    border-radius: 24px;
  }
  .pre-video-blur {
    filter: blur(28px) brightness(0.5) saturate(1.2);
  }
}

/* .Home-Pre-Video {
  width: 100%;
  max-width: 1380px;
  height: auto;
  aspect-ratio: 16 / 5;
  margin: 180px auto 0 auto;
  display: block;
  border-radius: 40px;
  background: linear-gradient(to bottom, #434343, #000000);
  font-family: "Emkan";
  object-fit: cover;
} */

/* Container for centering content like nav */
/* .home-container {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
} */

/* ===================================
   Course Card Styles
   =================================== */

.course-card-home {
  position: relative;
  width: 350px;
  margin: 40px auto 20px auto;
  border-radius: 24px;
  overflow: hidden;
  /* background: rgba(255, 255, 255, 0.08); */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  pointer-events: none;
}

.course-card-home:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* Image Wrapper */
.course-card-home__image-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  /* overflow: hidden; */
  border-radius: 16px;
  overflow: visible;
  animation: simpleGlow 2s ease-in-out infinite;
}

@keyframes simpleGlow {
  0% {
    box-shadow: 0 0 0px rgba(0, 239, 139, 0);
  }
  30% {
    box-shadow: 0 0 24px rgba(97, 97, 97, 0.75);
  }
  100% {
    box-shadow: 0 0 0px rgba(0, 255, 150, 0);
  }
}

/* Card Image */
.course-card-home__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.course-card-home:hover .course-card-home__image {
  transform: scale(1.1);
}

/* Overlay Gradient */
.course-card-home__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

/* Badge */
.course-card-home__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #012df1 0%, #764ba2 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  z-index: 2;
}

/* Play Button */
.course-card-home__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.course-card-home:hover .course-card-home__play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Play Icon (Triangle) */
.course-card-home__play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #667eea;
  margin-left: 4px;
}

/* Content Area */
.course-card-home__content {
  padding: 24px;
  direction: rtl;
}

/* Title */
.course-card-home__title {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.6;
  text-align: center;
}

/* Footer */
.course-card-home__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Episodes Info */
.course-card-home__episodes {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.course-card-home__episode-icon {
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.7);
}

/* View Button */
.course-card-home__view-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  text-decoration: none;
  display: inline-block;
}

.course-card-home__view-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ===================================
   Buy Link Container
   =================================== */

.buy-link-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 30px;
  margin-bottom: 30px;
}

.buy-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-align: center;
  text-decoration: none;
  width: 430px;
  max-width: 90%;
  justify-content: center;
  /* margin-top: 30px; */
  padding: 15px 30px;
  font-size: 30px;
  font-weight: bold;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.buy-link:hover {
  background-color: rgba(24, 22, 22, 0.75);
}

/* ===================================
   Carousel Custom Dots
   =================================== */

.custom-dot-list-style {
  margin-top: 20px;
}

.custom-dot-list-style li button {
  border: none;
  background: rgba(102, 126, 234, 0.3);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  transition: all 0.3s ease;
}

.custom-dot-list-style li.react-multi-carousel-dot--active button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scale(1.2);
}

/* ===================================
   Carousel Arrow Customization
   =================================== */

.react-multi-carousel-arrow {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.react-multi-carousel-arrow:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.react-multi-carousel-arrow::before {
  font-size: 18px;
  color: #fff;
}

/* ===================================
   Responsive Adjustments
   =================================== */

/* Tablet landscape */
@media (max-width: 1024px) {
  .hero-section {
    margin-top: 110px;
  }

  .main_img_home {
    border-radius: 30px;
  }

  .typewriter--line1,
  .typewriter--fade1 {
    font-size: 3.6rem;
    font-weight: 800;
  }

  .typewriter--line2,
  .typewriter--fade2,
  .typewriter--soft2 {
    font-size: 1.7rem;
    font-weight: 600;
  }

  .Home-Pre-Video {
    margin-top: 50px;
    border-radius: 30px;
  }
}

@media (max-width: 768px) {
  .home-container {
    padding: 0 15px;
  }

  .hero-section {
    margin-top: 100px;
  }

  .main_img_home {
    border-radius: 24px;
    aspect-ratio: 16 / 7;
  }

  /* On phones, every option collapses to a clean wrapping fade
     so long lines never overflow the hero. */
  .typewriter--line1,
  .typewriter--fade1 {
    font-size: 2.2rem;
    font-weight: 800;
    white-space: normal;
    border-right: none;
    width: auto;
    opacity: 0;
    animation: fade-in-words 0.9s ease 0.2s forwards;
  }

  .typewriter--line2,
  .typewriter--fade2,
  .typewriter--soft2 {
    font-size: 1.4rem;
    font-weight: 600;
    white-space: normal;
    border-right: none;
    width: auto;
    opacity: 0;
    animation: fade-in-words 0.9s ease 0.9s forwards;
  }

  .Home-Pre-Video {
    margin-top: 40px;
    border-radius: 24px;
    aspect-ratio: 16 / 7;
  }

  .course-card-home {
    width: 320px;
  }

  .course-card-home__image-wrapper {
    height: 240px;
  }

  .course-card-home__title {
    font-size: 16px;
  }

  .course-card-home__content {
    padding: 20px;
  }

  .course-card-home__play-btn {
    width: 60px;
    height: 60px;
  }

  .course-card-home__play-icon {
    border-width: 10px 0 10px 16px;
  }
}

@media (max-width: 480px) {
  .home-container {
    padding: 0 10px;
  }

  .hero-section {
    margin-top: 80px;
  }

  .main_img_home {
    border-radius: 16px;
    aspect-ratio: 4 / 3;
  }

  .typewriter--line1,
  .typewriter--fade1 {
    font-size: 1.6rem;
    font-weight: 800;
  }

  .typewriter--line2,
  .typewriter--fade2,
  .typewriter--soft2 {
    font-size: 1.1rem;
    font-weight: 600;
  }

  .Home-Pre-Video {
    margin-top: 30px;
    border-radius: 16px;
    aspect-ratio: 4 / 3;
  }

  .course-card-home {
    width: 290px;
  }

  .course-card-home__image-wrapper {
    height: 220px;
  }

  .course-card-home__badge {
    padding: 6px 12px;
    font-size: 12px;
  }

  .course-card-home__view-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  .buy-link {
    padding: 14px 36px;
    font-size: 16px;
  }
}

/* Extra large screens */
@media (min-width: 1600px) {
  .home-container {
    max-width: 1600px;
  }

  .main_img_home,
  .Home-Pre-Video {
    max-width: 1540px;
  }
}
