/* Book styling */
.book {
    perspective: 1500px;
    touch-action: pan-y;
    cursor: grab;
  }
  
  .book:active {
    cursor: grabbing;
  }
  
  .mobile-view {
    perspective: 1000px;
  }
  
  .book-cover {
    background: linear-gradient(to right, #6a5acd, #9d8bc4);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow: 
      inset 0 0 30px rgba(0, 0, 0, 0.5),
      0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
  }
  
  /* Add animated background to book cover */
  .book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 25%),
      radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.2) 0%, transparent 30%);
    opacity: 0.7;
    animation: coverGlow 8s ease-in-out infinite alternate;
  }
  
  /* Add sparkles to book cover */
  .book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.8) 0%, transparent 0.5%),
      radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.7) 0%, transparent 0.5%),
      radial-gradient(circle at 30% 60%, rgba(255, 255, 255, 0.8) 0%, transparent 0.5%),
      radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.7) 0%, transparent 0.5%),
      radial-gradient(circle at 60% 15%, rgba(255, 255, 255, 0.8) 0%, transparent 0.5%),
      radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.7) 0%, transparent 0.5%),
      radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.8) 0%, transparent 0.5%),
      radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.7) 0%, transparent 0.5%);
    animation: twinkling 5s linear infinite;
  }
  
  .flipped {
    transform: rotateY(-180deg);
  }
  
  .page {
    background-color: #fff;
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    border-radius: 0 10px 10px 0;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform-style: preserve-3d;
    backface-visibility: hidden; /* Hide the back of the page */
  }
  
  .page.flipped {
    transform: rotateY(-180deg);
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow 0.8s ease;
  }
  
  .page-front, .page-back {
    backface-visibility: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  .page-back {
    transform: rotateY(180deg);
  }
  
  .book-edge {
    background: linear-gradient(to right, #d8c8ef, #f5f0ff, #d8c8ef);
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.1);
  }
  
  .page-content {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f9f7ff, #ffffff);
    scrollbar-width: thin;
    scrollbar-color: #9d8bc4 #e0d8f0;
    position: relative;
    transition: all 0.5s ease;
  }
  
  .page-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(224, 216, 240, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  
  .page-content:hover::before {
    opacity: 1;
  }
  
  .page-content:hover {
    background-color: #fdfcff;
  }
  
  .page-content::-webkit-scrollbar {
    width: 6px;
  }
  
  .page-content::-webkit-scrollbar-track {
    background: #e0d8f0;
  }
  
  .page-content::-webkit-scrollbar-thumb {
    background-color: #9d8bc4;
    border-radius: 10px;
  }
  
  /* 3D book effect */
  .book::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, #d8c8ef, #f5f0ff, #d8c8ef);
    transform: translateX(15px) rotateY(15deg);
    transform-origin: left;
    z-index: -1;
    box-shadow: 
      5px 0 10px rgba(0, 0, 0, 0.1),
      inset -2px 0 5px rgba(0, 0, 0, 0.05);
  }
  
  .book::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.01));
    transform-origin: left;
    pointer-events: none;
  }
  
  /* Page turn particles */
  .page-turn-particles {
    position: absolute;
    z-index: 100;
    pointer-events: none;
  }
  
  .turn-particle {
    position: absolute;
    border-radius: 50%;
  }
  
  /* Bubble animation */
  .bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
    pointer-events: none;
  }
  
  /* Heart particles */
  .heart-particle {
    position: absolute;
    background-color: rgba(255, 192, 203, 0.6);
    display: inline-block;
    pointer-events: none;
    z-index: -1;
  }
  
  .heart-particle:before,
  .heart-particle:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 192, 203, 0.6);
    border-radius: 50%;
  }
  
  .heart-particle:before {
    left: -50%;
    top: 0;
  }
  
  .heart-particle:after {
    top: -50%;
    left: 0;
  }
  
  /* Magic shine effect */
  .magic-shine {
    position: relative;
    overflow: hidden;
  }
  
  .magic-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      to bottom right, 
      rgba(255, 255, 255, 0) 0%, 
      rgba(255, 255, 255, 0.3) 50%, 
      rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
  }
  
  /* Particle burst effect */
  .particle-burst {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
  }
  
  .burst-particle {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  