/* Desktop-first: keep layout close to the provided reference screenshots */
:root {
  --ebook-cover-width: 320px;     /* desktop reference-like cover */
  --digiapp-cover-width: 320px;   /* match visual weight */
  --qr-size: 140px;
  --digiapp-qr-size: 160px;
  --ebook-title-size: 2.6rem;
  --ebook-body-size: 1.05rem;
}

/* Move eBook cover to very top of screen and stretch to bottom */
#ebook {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

.cover.medium {
  margin: 0 !important;
  margin-top: 15px !important;
  display: block;
  width: var(--ebook-cover-width) !important;
  height: auto !important;
  align-self: center;
  transition: transform 0.3s ease !important;
  animation: coverPulse 3s ease-in-out infinite !important;
  cursor: pointer !important;
}

/* Pulsing animation for eBook cover */
@keyframes coverPulse {
  0%, 70%, 100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.05);
  }
}

/* Hover effect for eBook cover */
.cover.medium:hover {
  transform: scale(1.08) !important;
  animation-play-state: paused !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2) !important;
}

/* Add click effect */
.cover.medium:active {
  transform: scale(0.98) !important;
}

/* Apply tokenized typography */
#ebook h2 {
  font-size: var(--ebook-title-size) !important;
}

#ebook .description {
  font-size: var(--ebook-body-size) !important;
}

.ebook-desktop-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.ebook-copy {
  width: 100%;
}

/* Keep cover from blowing up on large screens */
.cover.medium {
  max-width: 380px !important;
  width: var(--ebook-cover-width) !important;
}

#digiapp .cover.medium {
  max-width: 380px !important;
  width: var(--digiapp-cover-width) !important;
}

/* Position Codee App section closer to bottom */
#digiapp {
  margin-top: 130 !important;
  padding-bottom: 110px !important;
}

/* Add spacing between Codee App cover and title */
#digiapp .cover.medium {
  margin-bottom: 25px !important;
}

#digiapp .benefits {
  margin: 0 auto 18px !important;
  padding: 0 0 0 22px !important;
  max-width: 620px;
  color: #34495e !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 1rem !important;
  line-height: 1.55 !important;
  text-align: left !important;
}

#digiapp .benefits li {
  margin-bottom: 12px !important;
}

#digiapp h2 {
  margin-top: 25px !important;
  margin-bottom: 15px !important;
}

/* Make buy button larger for accessibility with Apple Store styling */
.buy-button {
  font-size: 1.6rem !important;
  padding: 20px 35px !important;
  min-height: 100px !important;
  min-width: 200px !important;
  width: 200px !important;
  height: 100px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  text-align: center !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  background: linear-gradient(135deg, #007aff, #0056cc) !important;
  border: none !important;
  border-radius: 16px !important;
  color: white !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  animation: subtleBounce 2s ease-in-out infinite !important;
}

/* Apple Store hover effects */
.buy-button:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 35px rgba(0, 122, 255, 0.4) !important;
  background: linear-gradient(135deg, #0084ff, #005acc) !important;
}

.buy-button:active {
  transform: translateY(-2px) scale(0.98) !important;
  transition: all 0.1s ease !important;
}

/* Subtle bounce animation */
@keyframes subtleBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-1px);
  }
}

/* Apple Store body styling */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Apple Store container styling */
.container {
  margin: 0 !important;
  padding: 0 5px !important;
  width: 100% !important;
  backdrop-filter: blur(20px) !important;
}

/* Apple Store card styling */
.qr-section, .buy-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 10px auto !important;
  gap: 30px !important;
  width: 95% !important;
  padding: 15px !important;
  max-width: none !important;
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Make QR codes much larger */
.qr {
  width: var(--qr-size) !important;
  height: var(--qr-size) !important;
}

#digiapp .qr {
  width: var(--digiapp-qr-size) !important;
  height: var(--digiapp-qr-size) !important;
}

/* Apple Store text styling */
h2 {
  font-size: 2.2rem !important;
  margin: 5px 0 !important;
  font-weight: 700 !important;
  color: #1d1d1f !important;
  letter-spacing: -0.5px !important;
}

/* Military font styling for eBook section */
#ebook h2 {
  font-family: 'Impact', 'Arial Black', 'Bebas Neue', sans-serif !important;
  font-size: 2.4rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
  color: #2c3e50 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
  margin: 15px 0 15px 0 !important;
  padding: 10px 0 !important;
}

.description {
  font-size: 1.1rem;
  margin: 5px 0;
  line-height: 1.3;
  padding: 0;
  text-align: left;
  color: #1d1d1f !important;
  font-weight: 400 !important;
}

@media (min-width: 980px) {
  #ebook {
    padding: 24px 24px 0 !important;
  }

  .ebook-desktop-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    align-items: start;
    gap: 36px;
    width: min(100%, 980px);
    margin: 0 auto 18px;
  }

  #ebook .cover.medium {
    width: 100% !important;
    max-width: 320px !important;
    margin: 8px 0 0 !important;
    justify-self: center;
  }

  #ebook .ebook-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    max-width: 600px;
    padding-top: 28px;
  }

  #ebook h2 {
    width: 100%;
    text-align: left !important;
    margin: 0 0 20px !important;
    font-size: 2.9rem !important;
    line-height: 1.02 !important;
    letter-spacing: 1px !important;
  }

  #ebook .description {
    width: 100%;
    margin: 0 !important;
    padding-left: 22px !important;
    font-size: 1.14rem !important;
    line-height: 1.55 !important;
  }

  #ebook .description li {
    margin-bottom: 16px !important;
  }

  #ebook .qr-section {
    margin-top: 26px !important;
    width: min(100%, 960px) !important;
  }

  #digiapp {
    display: grid !important;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    grid-template-areas:
      "cover benefits"
      "buy buy"
      "social social"
      "footer footer";
    align-items: start;
    column-gap: 48px;
    row-gap: 18px;
    width: min(100%, 980px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 24px 18px 72px !important;
  }

  #digiapp .cover.medium {
    grid-area: cover;
    width: 100% !important;
    max-width: 280px !important;
    margin: 8px auto 0 !important;
    justify-self: center;
  }

  #digiapp .benefits {
    grid-area: benefits;
    max-width: 100%;
    margin: 12px 0 0 !important;
    padding: 26px 30px 14px 42px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    border-radius: 24px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    min-height: 280px;
  }

  #digiapp .buy-row {
    grid-area: buy;
    width: min(100%, 940px) !important;
    margin-top: 2px !important;
  }

  #digiapp .social-media {
    grid-area: social;
  }

  #digiapp .footer-text {
    grid-area: footer;
  }
}

/* Military font styling for eBook description */
#ebook .description {
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 1.02rem !important;
  font-weight: 500 !important;
  color: #34495e !important;
  letter-spacing: 0 !important;
  line-height: 1.55 !important;
}

#ebook .description li {
  margin-bottom: 10px !important;
  text-transform: none !important;
  font-size: 1rem !important;
}

/* Enhanced scroll button with Apple styling */
.scroll-cta {
  margin: 0 !important;
  padding: 8px 20px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #007aff !important;
  border: 1px solid rgba(0, 122, 255, 0.2) !important;
  border-radius: 25px !important;
  min-height: 40px !important;
  opacity: 0;
  transform: translateY(20px);
  animation: popupAnimation 0.6s ease-out 5s forwards;
  align-self: center;
  margin-bottom: 20px !important;
  backdrop-filter: blur(20px) !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.scroll-cta:hover {
  background: rgba(0, 122, 255, 0.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.2) !important;
}

/* Popup animation keyframes */
@keyframes popupAnimation {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Social media section */
.social-media {
  text-align: center;
  padding: 8px 5px;
  margin-top: 3px;
}

.social-media h3 {
  margin-bottom: 6px;
  color: #333;
  font-size: 1.2rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.social-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 22px;
  transition: transform 0.3s ease;
  font-weight: bold;
  font-family: Arial, sans-serif;
}

.social-icon:hover {
  transform: scale(1.1);
}

.youtube { background: #FF0000; color: white; font-size: 20px; }
.instagram { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); color: white; font-size: 16px; border-radius: 12px; }
.facebook { background: #1877F2; color: white; font-size: 24px; font-weight: bold; }
.tiktok { background: #000; color: white; font-size: 16px; }
.twitch { background: #9146FF; color: white; font-size: 18px; }
.twitter { background: #1DA1F2; color: white; font-size: 16px; }
.whatsapp { background: #25D366; color: white; font-size: 18px; }

/* Footer text */
.footer-text {
  text-align: center;
  padding: 15px 5px;
  font-size: 1rem;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --ebook-cover-width: 228px;
    --digiapp-cover-width: 210px;
    --qr-size: 122px;
    --digiapp-qr-size: 142px;
    --ebook-title-size: 2.05rem;
    --ebook-body-size: 0.95rem;
  }

  /* Hard cap so the cover cannot render oversized on iOS Safari */
  #ebook .cover.medium {
    max-width: 228px !important;
  }

  /* Keep Codee App visual weight slightly larger than ebook on mobile */
  #digiapp .cover.medium {
    max-width: 210px !important;
  }

  #ebook .description li {
    font-size: 0.95rem !important;
    margin-bottom: 4px !important;
  }

  /* Make the description block shorter on mobile */
  #ebook .description {
    font-size: 0.90rem !important;
    line-height: 1.12 !important;
  }

  #ebook .description li {
    font-size: 0.88rem !important;
    line-height: 1.1 !important;
  }

  .buy-button {
    width: 220px !important;
    min-width: 220px !important;
    height: 95px !important;
    min-height: 95px !important;
    font-size: 1.45rem !important;
    padding: 18px 26px !important;
  }

  .qr-section, .buy-row {
    gap: 18px !important;
    padding: 12px !important;
    margin: 8px auto !important;
  }

  /* Reduce excessive vertical space so the Codee App CTA can appear on initial mobile load */
  #ebook {
    min-height: 100svh !important;
    justify-content: flex-start !important;
    padding-bottom: 18px !important;
  }

  #ebook h2 {
    margin: 14px 0 10px 0 !important;
    padding: 0 !important;
    line-height: 1.05 !important;
  }

  /* tighten the whole description block */
  #ebook .description {
    margin: 10px 0 0 !important;
    padding: 0 6px !important;
    line-height: 1.18 !important;
  }

  #ebook .description ul {
    margin: 4px 0 0 0 !important;
    padding-left: 18px !important;
  }

  #ebook .description li {
    margin-bottom: 2px !important;
  }

  /* tighten spacing between cover/title/description */
  .cover.medium {
    margin-top: 18px !important;
  }

  #ebook .scroll-cta {
    margin-top: auto !important;
    margin-bottom: 10px !important;
  }
}

@media (max-width: 480px) {
  :root {
    --ebook-cover-width: 210px;
    --digiapp-cover-width: 190px;
    --qr-size: 112px;
    --digiapp-qr-size: 132px;
    --ebook-title-size: 1.85rem;
    --ebook-body-size: 0.90rem;
  }

  /* Hard cap so the cover cannot render oversized on iOS Safari */
  #ebook .cover.medium {
    max-width: 210px !important;
  }

  #digiapp .cover.medium {
    max-width: 190px !important;
  }

  #ebook .description {
    line-height: 1.25 !important;
  }

  /* Aggressive tighten for small iPhones */
  #ebook .description {
    font-size: 0.86rem !important;
    line-height: 1.08 !important;
  }

  #ebook .description li {
    font-size: 0.84rem !important;
    line-height: 1.06 !important;
  }

  /* Optional: show fewer bullets on very small screens to reveal Codee App CTA */
  #ebook .description li:nth-child(n+5) {
    display: none !important;
  }

  .buy-button {
    width: 200px !important;
    min-width: 200px !important;
    height: 90px !important;
    min-height: 90px !important;
    font-size: 1.3rem !important;
  }

  #ebook h2 {
    margin: 12px 0 8px 0 !important;
  }

  #ebook .description {
    margin-top: 8px !important;
    padding: 0 10px !important;
    line-height: 1.14 !important;
  }

  #ebook .description ul {
    margin-top: 3px !important;
  }

  #ebook .description li {
    margin-bottom: 1px !important;
  }

  #ebook .scroll-cta {
    margin-bottom: 14px !important;
  }
}

/* Accessibility styles */
@media (prefers-reduced-motion: reduce) {
  .cover.medium, .buy-button, .social-icon {
    animation: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .buy-button {
    border: 2px solid #000 !important;
  }
  
  .social-icon {
    border: 1px solid #000 !important;
  }
}
