/* Updated peel.css with enhanced styles */

#book {
  width: 100%;
  height: 100vh; 
  max-height: 100vh;
  position: relative;
}

#book .turn-page {
  background-color: #FFF;
}

#book .loader {
  background-image: url(loader.gif);
  width: 24px;
  height: 24px;
  display: block;
  position: absolute;
  top: 238px;
  left: 188px;
}

/* Peel hint indicator - bottom right corner only */
.turn-page-wrapper[page="2"]::after,
.turn-page-wrapper[page="1"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  /* border-width: 0 0 60px 60px;
  border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent; */
  border-width: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

/* Hover state for peel hint */
.turn-page-wrapper[page="2"]:hover::after,
.turn-page-wrapper[page="1"]:hover::after {
  /* border-width: 0 0 80px 80px;
  border-color: transparent transparent rgba(0, 0, 0, 0.15) transparent; */

  border-width: 0;
}

/* Logo on peeled corner */
.turn-page-wrapper[page="2"]::before {
  content: '';
  position: absolute;
  bottom: -1rem;
  right: 1rem;
  width: 10vw;
  height: 10vw;
  background-image: url('/assets/images/logo/vision_logo.png');
  /* background-color: rgba(43, 43, 43, 0.8); */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.3s ease;
}
/* .turn-page-wrapper[page="2"]::before {
  content: '';
  position: absolute;
  bottom: 0rem;
  right: 3rem;
  width: 7vw;
  height: 7vw;
  background-image: url('/assets/images/logo/legacy_icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 5;
  opacity: 0.8;
  transition: opacity 0.3s ease;
} */

@media screen and (max-width: 1599px) and (min-width: 1200px) {
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 8rem;
    bottom: -0.5rem;
    right: 0.2rem;
  }
}

@media screen and (max-width: 1199px) and (min-width: 992px) {
  .turn-page-wrapper[page="2"]::before {
    width: 9rem;
    height: 7rem;
    bottom: 0.5rem;
    right: 0.5rem;
  }
}

/* Tablet devices */
@media screen and (max-width: 991px) and (min-width: 768px) {
  .turn-page-wrapper[page="2"]::before {
    width: 8rem;
    height: 6rem;
    bottom: 1rem;
    right: 0.9rem;
  }
}

@media screen and (max-width: 767px) and (min-width: 576px) {
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 6rem;
    bottom: 0.7rem;
    right: 0.2rem;
  }
}

@media screen and (max-width: 575px) and (min-width: 481px) {
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 6rem;
    bottom: 0.7rem;
    right: 0.2rem;
  }
}

/* Mobile devices - Large */
@media screen and (max-width: 480px) and (min-width: 376px){
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 8rem;
    bottom: -0.5rem;
    right: 0.3rem;
  }
}

/* Mobile devices - Small */
@media screen and (max-width: 375px) {
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 8rem;
    bottom: -0.5rem;
    right: 0.5rem;
  }
}

/* Very small mobile devices */
@media screen and (max-width: 320px) {
  .turn-page-wrapper[page="2"]::before {
    width: 10rem;
    height: 8rem;
    bottom: -0.5rem;
    right: 0.5rem;
  }
}

/* Landscape orientation for mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .turn-page-wrapper[page="2"]::before {
    width: 45px;
    height: 45px;
  }
}



#book .data {
  text-align: center;
  font-size: 40px;
  color: #999;
  line-height: 500px;
}

#controls {
  width: 20vw;
  text-align: center;
  margin: 20px 0px;
  font: 30px arial;
}

/* Page gradients for depth */
#book .odd {
  background: linear-gradient(to right, #FFF 95%, #ddd 100%);
  background: -webkit-linear-gradient(left, #FFF 95%, #ddd 100%);
  background: -moz-linear-gradient(left, #FFF 95%, #ddd 100%);
  background: -o-linear-gradient(left, #FFF 95%, #ddd 100%);
  background: -ms-linear-gradient(left, #FFF 95%, #ddd 100%);
  background-color: #FFF;
}

#book .even {
  background: linear-gradient(to left, #FFF 95%, #ddd 100%);
  background: -webkit-linear-gradient(right, #FFF 95%, #ddd 100%);
  background: -moz-linear-gradient(right, #FFF 95%, #ddd 100%);
  background: -o-linear-gradient(right, #FFF 95%, #ddd 100%);
  background: -ms-linear-gradient(right, #FFF 95%, #ddd 100%);
  background-color: #FFF;
}

/* Peel indicator for mobile/touch devices */
.peel-indicator {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 50px !important;
  height: 50px !important;
  /* background: linear-gradient(135deg, transparent 40%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.3) 100%) !important; */
  border-radius: 0 0 50px 0 !important;
  z-index: 999 !important;
  pointer-events: none !important;
  animation: peelPulse 2s ease-in-out infinite;
  display: none; /* Hidden by default, shown via JS on touch devices */
}

@keyframes peelPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Show peel indicator on touch devices */
@media (hover: none) and (pointer: coarse) {
  .peel-indicator {
    display: block !important;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  #book {
    height: 100vh;
    max-height: 100vh;
  }
  
  #book .data {
    font-size: 24px;
    line-height: 300px;
  }
  
  #controls {
    width: 80vw;
    font-size: 20px;
  }
  
  /* Stronger visual cue for mobile */
  /* .turn-page-wrapper[page="2"]::after,
  .turn-page-wrapper[page="1"]::after {
    border-width: 0 0 50px 50px;
    border-color: transparent transparent rgba(0, 0, 0, 0.2) transparent;
  } */
  
  /* More pronounced gradients for mobile */
  #book .odd {
    background: #FFF;
    border-right: 1px solid #ddd;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.1);
  }

  #book .even {
    background: #FFF;
    border-left: 1px solid #ddd;
    box-shadow: inset 2px 0 4px rgba(0,0,0,0.1);
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  #book .data {
    font-size: 18px;
    line-height: 250px;
  }
  
  #controls {
    width: 90vw;
    font-size: 16px;
  }
  
  /* Smaller peel hint for small screens */
  .turn-page-wrapper[page="2"]::after,
  .turn-page-wrapper[page="1"]::after {
    border-width: 0 0 0px 0px;
    background: none;
  }
  
  .peel-indicator {
    width: 40px !important;
    height: 40px !important;
    bottom: 15px !important;
    right: 15px !important;
  }
}



/* Text positioning */
.behind-text {
  position: absolute;
  top: 30%;
  left: 55%;
  transform: translateX(-50%);
  text-align: start;
  z-index: 10;
  width: 60%;
  color: #000;
  font-size: clamp(20px, 1.5vw, 2rem);
}

/* Tablet and below */
@media (max-width: 768px) {
  .behind-text {
    top: 18%;
    left: 50%;
    width: 90%;
  }
}

/* Mobile landscape */
@media (max-width: 576px) {
  .behind-text {
    top: 15%;
    left: 50%;
    width: 90%;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .behind-text {
    top: 20%;
    left: 50%;
    width: 95%;
    text-align: center;
  }
}

/* Extra small mobile */
@media (max-width: 375px) {
  .behind-text {
    top: 30%;
    left: 55%;
    width: 98%;
    text-align: center;

  }
}

/* Large screens */
@media (min-width: 1200px) {
  .behind-text {
    top: 30%;
    left: 55%;
    width: 80%;
    font-size: clamp(24px, 1.2vw, 2.5rem);
  }
}

/* Extra large screens */
@media (min-width: 1600px) {
  .behind-text {
    top: 30%;
    left: 55%;
    width: 75%;
    font-size: clamp(28px, 1vw, 3rem);
  }
}

/* Performance optimizations */
#book {
  transition: none !important;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Ensure smooth rendering */
#book .turn-page-wrapper,
#book .turn-page {
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: none !important;
}

/* Prevent content jumping */
#book .page {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Ensure images don't cause reflow */
#book img {
  display: block;
  max-width: 100%;
  height: 100vh !important;
}

/* Smooth peeling animation */
.turn-page-wrapper {
  will-change: transform;
}

.turn-page-wrapper {
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

.turn-fold-gradient {
  background: linear-gradient(135deg, 
    rgba(0,0,0,0) 0%, 
    rgba(0,0,0,0.05) 30%, 
    rgba(0,0,0,0.1) 50%, 
    rgba(0,0,0,0.15) 70%, 
    rgba(0,0,0,0.2) 100%) !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}


/* Custom cursor for bottom-right corner */
#book .turn-page-wrapper {
  cursor: default;
}

/* Only bottom-right corner should have grab cursor */
#book .turn-page-wrapper:hover {
  cursor: default;
}

/* Add grab cursor only to bottom-right area */
#book {
  position: relative;
}

/* #book::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 150px;
  height: 150px;
  cursor: grab;
  z-index: 100;
  pointer-events: all;
}

#book:active::after {
  cursor: grabbing;
} */

/* Hide cursor hint on non-interactive areas */
#book .turn-page-wrapper[page] {
  cursor: default;
}

/* .turn-page > .p-temporal-parent {
  border-radius: 5rem;
}
 */

.p-temporal {
  border-radius:3rem;
  cursor: pointer;
}

.p-temporal::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 120px; /* bigger = deeper fold */
  height: 120px;
  /* background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.1) 50%); */
  border-bottom-right-radius: 3rem;
  cursor: pointer;
}


#peel-corner {
  background: transparent !important;
  cursor: pointer;
}

.peel-bg-hero {
  width: 100%; 
  height: 65vh; 
  display: block;  
  transform: translate(-10%, -50%);
}

.peel-bg-footer {
  width: 90%; 
  height: 65vh; 
  display: block;  
  transform: translate(10%, 10%); 
  overflow: hidden;
}

@media (max-width: 1599px) and (min-width: 1200px) {
  .peel-bg-hero {
    transform: translate(-2%, -50%);
  }

  .peel-bg-footer {
    /* transform: translate(5%, 40%); */
  }

  
}

@media (max-width: 1199px) and (min-width: 992px) {
  .peel-bg-hero {
    transform: translate(2%, -50%);
  }

  /* .peel-bg-footer {
    width: 100%;
    transform: translateY(60%) !important;
    transform: translatex(-5%) !important;
  } */
}

@media (max-width: 991px) and (min-width: 768px) {
  .peel-bg-hero {
    transform: translate(-2%, -40%);
  }

  /* .peel-bg-footer {
    width: 100% !important;
    transform: translateY(90%) !important;
    transform: translatex(-6%) !important;
  } */
}

@media (max-width: 767px) and (min-width: 550px) {
  .peel-bg-hero {
    transform: translate(-2%, -30%);
  }
}

@media (max-width: 549px) and (min-width: 350px) {
  .peel-bg-hero {
    width: 100%; 
    height: 65vh;
    transform: translate(-2%, -30%);
  }
}