/* ==========================================================================
   QuranLearning - Premium Mobile-First Landing Page
   Theme: Luxury Islamic Emerald & Gold Design
   ========================================================================== */

:root {
  --color-bg-deep: #020b08;
  --color-bg-surface: #061a12;
  --color-emerald-glow: rgba(16, 185, 129, 0.22);
  --color-gold: #d4af37;
  --color-gold-light: #f5df93;
  --color-gold-glow: rgba(212, 175, 55, 0.35);
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #128c7e;
  --color-whatsapp-hover: #22bf5b;
  --color-text-white: #ffffff;
  --color-text-muted: #94a3b8;
  
  --radius-video: 20px;
  --radius-btn: 16px;
  
  --shadow-video: 0 25px 60px -15px rgba(0, 0, 0, 0.85),
                  0 0 40px -5px rgba(16, 185, 129, 0.2),
                  0 0 0 1px rgba(212, 175, 55, 0.28);
  --shadow-btn: 0 12px 30px -5px rgba(37, 211, 102, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-btn-hover: 0 16px 36px -4px rgba(37, 211, 102, 0.65),
                      0 6px 16px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: 'Hind Siliguri', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-bg-deep);
  color: var(--color-text-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  background: radial-gradient(circle at 50% 18%, #0d3124 0%, #061912 45%, #020b08 100%);
  padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 24px) env(safe-area-inset-left, 16px);
}

/* --------------------------------------------------------------------------
   Atmospheric Islamic Geometric Pattern & Glow
   -------------------------------------------------------------------------- */
.bg-pattern {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23D4AF37' fill-rule='evenodd'%3E%3Cpath d='M40 0l5 12 12-5-5 12 12 5-12 5 5 12-12-5-5 12-5-12-12 5 5-12-12-5 12-5-5-12 12 5zM0 40l5 12 12-5-5 12 12 5-12 5 5 12-12-5-5 12-5-12-12 5 5-12-12-5 12-5-5-12 12 5zM80 40l5 12 12-5-5 12 12 5-12 5 5 12-12-5-5 12-5-12-12 5 5-12-12-5 12-5-5-12 12 5zM40 80l5 12 12-5-5 12 12 5-12 5 5 12-12-5-5 12-5-12-12 5 5-12-12-5 12-5-5-12 12 5z' opacity='0.7'/%3E%3Ccircle cx='40' cy='40' r='14' fill='none' stroke='%23D4AF37' stroke-width='1' opacity='0.5'/%3E%3Cpolygon points='40,28 43,36 52,36 44,41 47,49 40,44 33,49 36,41 28,36 37,36' fill='none' stroke='%23D4AF37' stroke-width='0.75' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}

.ambient-glow {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(850px, 120vw);
  height: min(450px, 70vh);
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.18) 0%, rgba(212, 175, 55, 0.09) 45%, transparent 75%);
  filter: blur(75px);
  pointer-events: none;
  z-index: 0;
  animation: gentleBreathe 8s ease-in-out infinite alternate;
}

@keyframes gentleBreathe {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 20px;
}

.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Premium Video Section
   -------------------------------------------------------------------------- */
.video-section {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
}

.video-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-video);
  overflow: hidden;
  box-shadow: var(--shadow-video);
  background: #020a07;
  border: 1px solid rgba(212, 175, 55, 0.35);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.video-card:hover {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.9),
              0 0 48px -5px rgba(16, 185, 129, 0.3),
              0 0 0 1px rgba(212, 175, 55, 0.45);
}

/* Strict 16:9 Aspect Ratio Container */
.video-responsive-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  overflow: hidden;
}

/* Fallback for browsers not supporting aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-responsive-wrapper {
    height: 0;
    padding-bottom: 56.25%; /* 16:9 ratio */
  }
}

/* Native HTML5 Video Player */
.video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
  border: 0;
  outline: none;
}

/* --------------------------------------------------------------------------
   Custom Video Play Overlay (Thumbnail + Prominent Play Button + Bengali CTA)
   -------------------------------------------------------------------------- */
.play-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      to bottom,
      rgba(3, 13, 9, 0.35) 0%,
      rgba(3, 13, 9, 0.45) 55%,
      rgba(3, 13, 9, 0.8) 100%
    ),
    url('../poster.jpg') center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 5;
  user-select: none;
  padding: 16px;
  touch-action: manipulation;
}

/* Ensure child elements do not block click events on the overlay */
.play-overlay * {
  pointer-events: none;
}

.play-overlay.hidden {
  display: none !important;
}

/* Prominent Glowing Play Button */
.play-button-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5df93 0%, #d4af37 50%, #aa8214 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.7), 0 10px 30px rgba(0, 0, 0, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.8);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  animation: playPulse 2.8s ease-in-out infinite;
}

.play-button-circle svg {
  width: 36px;
  height: 36px;
  fill: #04140f;
  margin-left: 5px; /* Optical center alignment */
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

.play-overlay:hover .play-button-circle {
  transform: scale(1.1);
  box-shadow: 0 0 52px rgba(212, 175, 55, 0.95), 0 14px 38px rgba(0, 0, 0, 0.85);
}

.play-overlay:active .play-button-circle {
  transform: scale(0.95);
}

@keyframes playPulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.55), 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(212, 175, 55, 0.45);
  }
  50% {
    box-shadow: 0 0 48px rgba(212, 175, 55, 0.9), 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 0 14px rgba(212, 175, 55, 0);
  }
}

/* Bengali Call-to-Action Text Badge */
.play-text-badge {
  margin-top: 18px;
  padding: 8px 24px;
  background: rgba(3, 13, 9, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(212, 175, 55, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 92%;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.play-overlay:hover .play-text-badge {
  transform: translateY(-2px);
  background: rgba(7, 25, 18, 0.96);
  border-color: var(--color-gold);
}

.play-text {
  font-family: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   WhatsApp Group Button Section
   -------------------------------------------------------------------------- */
.cta-section {
  width: 100%;
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  min-height: 58px;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #25d366 0%, #20ba5c 50%, #128c7e 100%);
  color: #ffffff;
  text-decoration: none;
  font-family: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-btn);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              background 0.25s ease;
  animation: whatsappPulse 3s ease-in-out infinite;
}

/* Official WhatsApp SVG Icon inside button */
.whatsapp-btn svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.25s ease;
}

/* Elegant light reflection sweep across button */
.whatsapp-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  animation: shineSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.whatsapp-btn:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: var(--shadow-btn-hover);
  background: linear-gradient(135deg, #28e06d 0%, #22c763 50%, #159b8c 100%);
}

.whatsapp-btn:hover svg {
  transform: scale(1.08) rotate(-4deg);
}

.whatsapp-btn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

@keyframes whatsappPulse {
  0%, 100% {
    box-shadow: 0 12px 30px -5px rgba(37, 211, 102, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 14px 34px -4px rgba(37, 211, 102, 0.65), 0 0 0 8px rgba(37, 211, 102, 0);
  }
}

@keyframes shineSweep {
  0%, 70% {
    left: -70%;
  }
  100% {
    left: 140%;
  }
}

/* --------------------------------------------------------------------------
   Mobile-First Responsiveness & Android Ad-Traffic Optimization
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  body {
    padding: env(safe-area-inset-top, 14px) 12px env(safe-area-inset-bottom, 20px) 12px;
    justify-content: center;
  }

  .page-container {
    padding: 6px 0 14px;
    max-width: 100%;
  }

  .video-card {
    border-radius: 16px;
  }

  .play-button-circle {
    width: 70px;
    height: 70px;
  }

  .play-button-circle svg {
    width: 30px;
    height: 30px;
    margin-left: 4px;
  }

  .play-text-badge {
    margin-top: 14px;
    padding: 7px 18px;
  }

  .play-text {
    font-size: 1.05rem;
  }

  .cta-section {
    margin-top: 20px;
  }

  .whatsapp-btn {
    max-width: 100%;
    min-height: 56px;
    padding: 13px 20px;
    font-size: 1.15rem;
    gap: 12px;
  }

  .whatsapp-btn svg {
    width: 26px;
    height: 26px;
  }
}

/* Ultra-compact screens (e.g. 320px - 360px) */
@media (max-width: 360px) {
  body {
    padding: 8px 8px 16px 8px;
  }

  .video-card {
    border-radius: 12px;
  }

  .play-button-circle {
    width: 62px;
    height: 62px;
  }

  .play-button-circle svg {
    width: 24px;
    height: 24px;
  }

  .play-text {
    font-size: 0.96rem;
  }

  .whatsapp-btn {
    font-size: 1.05rem;
    padding: 12px 16px;
  }

  .whatsapp-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 10px 16px;
    justify-content: flex-start;
  }

  .page-container {
    max-width: 580px;
    padding: 4px 0 16px;
  }

  .play-button-circle {
    width: 60px;
    height: 60px;
  }

  .play-button-circle svg {
    width: 24px;
    height: 24px;
  }

  .play-text-badge {
    margin-top: 8px;
    padding: 5px 14px;
  }

  .play-text {
    font-size: 0.98rem;
  }

  .cta-section {
    margin-top: 16px;
  }

  .whatsapp-btn {
    min-height: 48px;
    padding: 10px 20px;
    font-size: 1.05rem;
  }
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion Preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ambient-glow {
    animation: none;
  }
  .play-button-circle {
    animation: none;
  }
  .whatsapp-btn {
    animation: none;
  }
  .whatsapp-btn::after {
    display: none;
  }
}
