/* ================= RESET & BASE ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
}

html,
body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-gradient, linear-gradient(135deg, #fdfbfb 0%, #f3f4f6 100%));
  color: var(--text-main);
}

/* ================= HERO SECTION ================= */
.hero-section {
  position: relative;
  padding: 90px 20px 80px;
  text-align: center;
  color: #fff;
  background: linear-gradient(150deg, #0d3b66 0%, #1565a8 60%, #1a7bbf 100%), url('../images/image10.png') center/cover fixed;
  background-blend-mode: multiply;
  border-radius: 0 0 32px 32px;
  margin-bottom: 60px;
  box-shadow: 0 8px 32px rgba(13, 59, 102, 0.18);
  overflow: hidden;
}

.hero-tagline {
  font-size: 48px;
  color: #ffffff; /* Dark blue as seen in screenshot */
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.75;
}


/* ================= PREMIUM BOOKSHELF & SHELF VISUAL ================= */
.premium-bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.series-title {
  text-align: center;
  font-size: 28px;
  color: #334155;
  font-weight: 800;
  margin: 60px 0 40px;
  position: relative;
  text-transform: uppercase;
}

.series-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #A360F3; /* Purple underline */
  margin: 15px auto 0;
  border-radius: 2px;
}

.premium-book-card {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: fadeIn 0.8s ease backwards;
}

/* Entrance Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Premium Visible Shelf */
.premium-book-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 145%;
  /* Shelf extends slightly beyond the book */
  height: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-top: 2px solid rgba(255, 255, 255, 1);
  border-radius: 50% / 12px;
  /* Elliptical perspective */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25), inset 0 2px 8px rgba(255, 255, 255, 0.9);
  z-index: 1;
}

/* Under-Shelf Glow */
.premium-book-card::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(163, 96, 243, 0.2) 0%, rgba(163, 96, 243, 0) 70%);
  filter: blur(10px);
  opacity: 0.6;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.premium-book-card:hover::before {
  opacity: 1;
}


/* Book Wrapper */
.book-flipper {
  position: relative;
  width: 170px;
  height: 230px;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  z-index: 2;
  /* Book sits on top of the shelf */
}

/* Flip and Lift Animation */
.premium-book-card:hover .book-flipper {
  transform: rotateY(180deg) translateY(-25px) translateZ(30px);
}

.book-front,
.book-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Book Front with Skeleton Loader */
.book-front {
  background: #e2e8f0;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 2;
  transform: rotateY(0deg);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.book-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.book-front img[src] {
  opacity: 1;
}

/* Series Badge on Front */
.series-badge {
  position: absolute;
  top: 15px;
  right: -30px;
  background: #A360F3;
  color: white;
  padding: 5px 30px;
  font-size: 12px;
  font-weight: bold;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.book-back {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 240, 240, 0.95));
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  border: 4px solid rgba(255, 255, 255, 0.8);
}

.book-back h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
  font-weight: 700;
}

.book-back p {
  font-size: 13px;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.checkout-btn {
  background: linear-gradient(135deg, #111827, #4f46e5);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
  transition: transform 0.2s, background 0.2s;
  border: none;
  cursor: pointer;
}

.checkout-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #4f46e5, #3730a3);
}

/* ================= DECORATIVE ICONS ================= */
.decorative-icon.absolute-right {
  position: absolute;
  right: 40px;
  /* Align near the right edge of the grid */
  bottom: 80px;
  /* Sit comfortably in the empty space */
  display: flex;
  pointer-events: none;
  z-index: 10;
}

.decorative-icon.absolute-right img {
  width: 140px;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.2));
  animation: floatUpDown 5s ease-in-out infinite;
}

@keyframes floatUpDown {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(4deg);
  }
}

/* ================= PURCHASE SECTION (Demo Style) ================= */
.purchase-section {
  padding: 60px 20px 100px;
  margin: 20px;
}

.purchase-container {
  max-width: 1000px;
  margin: auto;
  border-radius: 30px;
  background: linear-gradient(135deg, #ad80d9 0%, #cbb4d4 60%, #ad80d9 100%);
  padding: 60px;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.8s ease;
}

.purchase-title {
  font-size: 38px;
  color: #4a3a55;
  margin-bottom: 30px;
  font-weight: 800;
  text-align: center;
}

.purchase-toggle {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.3);
  padding: 8px;
  border-radius: 40px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toggle-btn {
  padding: 12px 30px;
  border-radius: 30px;
  border: none;
  background: transparent;
  color: #4a3a55;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.toggle-btn.active {
  background: #fff;
  color: #A360F3;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Forms Content */
.purchase-box {
  display: none;
  width: 100%;
  max-width: 800px;
}

.purchase-box.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.5s ease;
}

.purchase-info {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.purchase-info h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

/* QR Code Display */
.qr-area {
  margin-bottom: 30px;
}

.qr-area img {
  width: 250px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border: 6px solid #fff;
  transition: transform 0.3s ease;
}

.qr-area img:hover {
  transform: scale(1.05);
}

/* Form Styles */
.purchase-form {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(255, 255, 255, 0.4);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.purchase-form input,
.purchase-form textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.purchase-form input:focus,
.purchase-form textarea:focus {
  background: #fff;
  border-color: #A360F3;
  box-shadow: 0 0 0 3px rgba(163, 96, 243, 0.2);
}

.purchase-form textarea {
  resize: vertical;
  min-height: 120px;
}

.send-btn {
  background: linear-gradient(135deg, #111827, #4f46e5);
  color: white;
  padding: 16px;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
  margin-top: 10px;
}

.send-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, #4f46e5, #3730a3);
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .premium-bookshelf {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 50px 15px;
  }

  .premium-book-card::after {
    width: 160%;
    height: 10px;
  }

  .decorative-icon.absolute-right {
    display: none;
    /* Hide on mobile to prevent overlapping tight book grids */
  }

  .hero-title {
    font-size: 32px;
  }

  .purchase-container {
    padding: 30px 20px;
  }

  .purchase-title {
    font-size: 28px;
  }

  .purchase-form {
    padding: 20px;
  }
}