/* See license.txt for terms of usage */

/* Amazing Animals Free Book Landing Page Styles */
/* Adapted from template with bootsland color scheme */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

/* Use bootsland colors: primary #1360ef, orange #f94f15, dark #060927 */
:root {
  --primary: #1360ef;
  --primary-soft: rgba(19, 96, 239, 0.1);
  --orange: #f94f15;
  --dark: #060927;
  --light: #f5faff;
  --text-dark: #1d1d33;
  --text-muted: #8090b5;
  --white: #ffffff;
  --border: rgba(128, 144, 181, 0.2);
  --radius: 1rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #f5faff, rgba(19, 96, 239, 0.05), #f5faff);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  /* Force GPU layer to prevent layout thrashing during scroll */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.hero-content {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-content {
    text-align: left;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--orange));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  /* Disable animation to prevent Chrome freeze during fast scrolling */
  /* animation: bounce 2s infinite; */
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.hero-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #e36100; /* var(--text-dark); */
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .hero-features {
    justify-content: flex-start;
  }
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

.hero-visual-mobile {
  display: flex;
  margin: 1.5rem 0;
}

@media (min-width: 1024px) {
  .hero-visual-mobile {
    display: none;
  }
}

.hero-visual-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .hero-visual-desktop {
    display: flex;
  }
}

.book-container {
  position: relative;
  /* Disable animation to prevent Chrome freeze during fast scrolling */
  /* animation: float 3s ease-in-out infinite; */
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.book-image {
  width: 200px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

@media (min-width: 768px) {
  .book-image {
    width: 280px;
  }
}

@media (min-width: 1024px) {
  .book-image {
    width: 350px;
  }
}

.animals-bg {
  position: absolute;
  top: -2rem;
  right: -2rem;
  width: 200px;
  opacity: 0.8;
  z-index: -1;
}

/* Email Form */
.email-form {
  background: white;
  padding: 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  max-width: 400px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .email-form {
    margin: 0;
  }
}

.email-form h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.email-form p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-input {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background-color: white;
  line-height: 1.5;
  box-sizing: border-box;
}

/* Ensure select elements match input height on mobile */
select.email-input {
  /* Remove browser-specific styling that affects height */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Ensure consistent height matching inputs */
  /* Height = padding-top + padding-bottom + line-height + border-top + border-bottom */
  min-height: calc(0.875rem * 2 + 1.5rem + 4px);
}

.email-input:focus {
  border-color: var(--primary);
}

.submit-btn {
  background: linear-gradient(135deg, var(--primary), var(--orange));
  color: white;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.submit-btn:disabled {
  background: #cccccc;
  color: #666666;
  opacity: 0.6;
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* Features Section */
.features-section {
  padding: 5rem 0;
  background: white;
  /* Prevent layout shifts that trigger media query recursion */
  contain: layout;
  /* Force GPU layer to prevent layout thrashing during scroll */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.features-header {
  text-align: center;
  margin-bottom: 3rem;
}

.features-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

@media (min-width: 768px) {
  .features-title {
    font-size: 2.5rem;
  }
}

.features-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
}

.feature-card {
  background: var(--light);
  padding: 2rem;
  border-radius: 1.5rem;
  text-align: center;
  border: 2px solid var(--border);
  height: 100%;
  /* All hover effects and transitions disabled to prevent Chrome recursion bug */
  /* Isolate layout to prevent triggering media query recalculation */
  contain: layout style paint;
  /* Force GPU acceleration to prevent layout thrashing */
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: auto;
}

/* Prevent layout recalculation on small screens - Chrome recursion bug fix */
@media (max-width: 991.98px) {
  .features-section .row,
  .features-section .row > [class*="col-"] {
    /* Prevent layout shifts that trigger media query recalculation */
    contain: layout;
  }

  .feature-card {
    /* Ensure no layout changes on hover */
    position: relative;
    z-index: 1;
  }
}

.feature-images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.feature-image {
  /*width: 100%;*/
  max-width: 200px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 0;
}

@media (min-width: 768px) {
  .feature-image {
    max-width: 180px;
  }
}

@media (min-width: 992px) {
  .feature-image {
    max-width: 150px;
  }
}

.feature-image-separator {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.feature-emoji {
  font-size: 3rem;
  line-height: 1;
  display: inline-block;
}

@media (min-width: 768px) {
  .feature-emoji {
    font-size: 2.5rem;
  }
}

@media (min-width: 992px) {
  .feature-emoji {
    font-size: 2rem;
  }
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.feature-icon.yellow {
  background: rgba(250, 215, 118, 0.2);
}
.feature-icon.blue {
  background: var(--primary-soft);
}
.feature-icon.green {
  background: rgba(40, 167, 69, 0.1);
}
.feature-icon.orange {
  background: rgba(249, 79, 21, 0.1);
}
.feature-icon.purple {
  background: rgba(110, 0, 255, 0.1);
}
.feature-icon.red {
  background: rgba(220, 53, 69, 0.1);
}

.feature-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Book Preview Section */
.book-preview-section {
  padding: 5rem 0;
  background: linear-gradient(180deg, rgba(19, 96, 239, 0.03), var(--light));
  /* Force GPU layer to prevent layout thrashing during scroll */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.book-preview-image {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.book-preview-image-mobile {
  display: flex;
  margin: 1.5rem 0;
}

@media (min-width: 992px) {
  .book-preview-image-mobile {
    display: none;
  }
}

.book-preview-image-desktop {
  display: none;
}

@media (min-width: 992px) {
  .book-preview-image-desktop {
    display: flex;
  }
}

.book-preview-image a {
  display: inline-block;
  text-decoration: none;
  /* Disable transitions to prevent Chrome freeze during fast scrolling */
  /* transition: transform 0.2s, opacity 0.2s; */
}

.book-preview-img {
  width: 250px;
  border-radius: var(--radius);
  /*box-shadow: 0 20px 40px rgba(0,0,0,0.2);*/
}

.amazon-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.amazon-btn-mobile {
  display: flex;
}

@media (min-width: 992px) {
  .amazon-btn-mobile {
    display: none;
  }
}

.amazon-btn-desktop {
  display: none;
}

@media (min-width: 992px) {
  .amazon-btn-desktop {
    display: flex;
  }
}

.book-preview-content h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

@media (min-width: 768px) {
  .book-preview-content h2 {
    font-size: 2rem;
  }
}

.book-preview-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.book-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.book-feature-tag {
  background: var(--primary);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.amazon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 1.5rem;
}

.amazon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  color: white;
}

/* CTA Section */
.cta-section {
  padding: 5rem 0;
  background: white;
  color: var(--text-dark);
  text-align: center;
  /* Force GPU layer to prevent layout thrashing during scroll */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.cta-content h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .cta-content h2 {
    font-size: 2.5rem;
  }
}

.cta-content p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-form {
  max-width: 400px;
  margin: 0 auto 3rem;
}

.cta-form .form-group {
  flex-direction: row;
}

@media (max-width: 500px) {
  .cta-form .form-group {
    flex-direction: column;
  }
}

.cta-form .email-input {
  flex: 1;
  border: 2px solid var(--border);
  background: white;
}

.cta-form .submit-btn {
  white-space: nowrap;
}

/* Testimonials */
.testimonials {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
}

.testimonial {
  background: var(--primary-soft);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  max-width: 300px;
  text-align: left;
}

.testimonial p {
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  opacity: 1;
}

.testimonial cite {
  font-size: 0.875rem;
  opacity: 0.8;
  font-style: normal;
}

.testimonial cite a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s, text-decoration 0.2s;
}

.testimonial cite a:hover {
  opacity: 1;
  text-decoration: underline;
}
