/* Book Preview Styles */
.book-preview-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(5px 5px 25px rgba(0, 0, 0, 0.5));
  z-index: 1;
}

.preview-section {
  text-align: center;
  margin: 80px auto 50px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.age-verification-overlay {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  height: 525px;
  justify-self: anchor-center;
  background: rgb(255 196 196 / 5%);
  backdrop-filter: blur(3px) saturate(110%);
  -webkit-backdrop-filter: blur(3px) saturate(110%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  opacity: 1;
  transition: opacity 1.2s ease-out, backdrop-filter 1.2s ease-out;
  -webkit-transition: opacity 1.2s ease-out, -webkit-backdrop-filter 1.2s ease-out;
  pointer-events: none;
  border-radius: 30px;
  box-sizing: border-box;
}

.age-verification-overlay.hiding {
  opacity: 0;
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
  pointer-events: none;
}

.age-verification-overlay.hidden {
  display: none;
}

.age-verification-content {
  background: rgb(255 200 109);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  padding: 32px 28px;
  border-radius: 12px;
  max-width: 340px;
  width: 85%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  border: 3px solid rgb(0 0 0 / 56%);
  transition: transform 1.2s ease-out, opacity 1.2s ease-out, background 0.3s ease;
  transform: scale(1);
  opacity: 1;
  position: relative;
  z-index: 999;
  pointer-events: auto;
}

.age-verification-content:hover,
.age-verification-content:focus-within {
  background: rgb(255 210 135);
}

.age-verification-overlay.hiding .age-verification-content {
  transform: scale(0.95);
  opacity: 0;
}

.lock-emoji {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lock-image {
  width: 62px;
  height: 62px;
  object-fit: contain;
  opacity: 0.9;
  transition: transform 0.3s ease;
}

.age-verification-content:hover .lock-image,
.age-verification-content:focus-within .lock-image {
  transform: scale(1.1);
}

.age-verification-content h2 {
  color: #000;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  letter-spacing: -0.3px;
  text-align: center;
}

.age-verification-content p {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.age-verification-content form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.age-email-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 4px;
}

.age-email-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 16px;
  z-index: 1;
}

.age-email-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #ffe8c1;
  color: #333;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.age-email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(177, 0, 35, 0.1);
}

.age-email-input::placeholder {
  color: #999;
}

/* Preview Email Confirmation Modal */
.preview-email-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-email-confirm-modal.show {
  display: flex;
  opacity: 1;
}

.preview-email-confirm-content {
  background: #000;
  border: 2px solid #ffb335;
  border-radius: 12px;
  padding: 30px;
  max-width: 320px;
  width: 90%;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(255, 179, 53, 0.3);
  animation: previewConfirmSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes previewConfirmSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.preview-email-confirm-counter {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #ffb335;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.preview-email-confirm-counter span {
  color: #ffb335;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.preview-email-confirm-text {
  flex: 1;
}

.preview-email-confirm-text h3 {
  margin: 0 0 8px 0;
  color: #ffb335;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.preview-email-confirm-text p {
  margin: 0;
  color: #ffb335;
  font-size: 16px;
  line-height: 1.5;
}

.age-consent-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.4;
}

.age-consent-label input[type="checkbox"] {
  width: 36px;
  height: 36px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.age-verification-button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.age-verification-button:hover {
  background: #8a0019;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(177, 0, 35, 0.3);
}

.age-verification-button:active {
  transform: translateY(0);
}

.age-verification-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.preview-section h1 {
  color: #fff;
  font-size: 22px;
  margin: 18px 0 8px;
  text-align: center;
  margin-bottom: 30px;
}

.book-content {
  position: relative;
  background: #f4e8d0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='paper' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Crect width='100' height='100' fill='%23f4e8d0'/%3E%3Cpath d='M0 0L100 100M100 0L0 100' stroke='%23e8dcc0' stroke-width='0.5' opacity='0.3'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23paper)'/%3E%3C/svg%3E");
  background-size: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 640px;
  height: 55vh;
  max-height: 55vh;
  padding: 60px 80px;
  z-index: 1;
  /*filter: brightness(0.95) sepia(30%) saturate(80%);*/
  border-radius: 30px;
  clip-path: polygon(
    0% 2.5%,
    3% 1.5%,
    8% 2%,
    15% 1.8%,
    22% 2.2%,
    30% 1.5%,
    38% 2%,
    46% 1.8%,
    54% 2.2%,
    62% 1.5%,
    70% 2%,
    78% 1.8%,
    85% 2.2%,
    92% 1.5%,
    97% 2%,
    100% 1.8%,
    100% 97%,
    97% 98.5%,
    91% 97.8%,
    84% 98%,
    76% 97.5%,
    68% 98.2%,
    60% 97.8%,
    52% 98%,
    44% 97.5%,
    36% 98.2%,
    28% 97.8%,
    20% 98%,
    12% 97.5%,
    5% 98.5%,
    0% 97%
  );
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.book-entry {
  width: 100%;
  text-align: center;
  margin-bottom: 0px;
  position: relative;
}

.book-entry:last-child {
  margin-bottom: 40px;
}

.book-breadcrumbs {
  font-size: 12pt;
  color: #8b7355;
  margin-bottom: 15px;
  font-style: italic;
  letter-spacing: 1px;
  text-shadow: 0.2px 0.2px 1px rgba(139, 115, 85, 0.5);
}

.book-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
}

.book-title-wrapper {
  flex: 1;
  text-align: left;
}

.book-title {
  font-family: "Roboto Slab", serif;
  font-size: 28pt;
  font-weight: 400;
  color: #35312b;
  text-shadow: 0.3px 0.3px 2px rgba(139, 115, 85, 0.8);
  margin: 0;
  line-height: 1.3;
  text-align: left;
}

.book-rating-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 20px;
}

.book-pepper-rating {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
}

.book-icon {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-icon-image {
  filter: sepia(20%) contrast(1.1);
  opacity: 0.9;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.book-icon-emoji {
  font-size: clamp(32px, 5vw, 64px);
  opacity: 0.8;
}

.book-stamp {
  opacity: 0.6;
  filter: sepia(40%) contrast(0.9);
  z-index: 1;
}

.book-stamp-image {
  max-width: 33px;
  height: auto;
}

.book-image-wrapper {
  width: 100%;
  margin: 25px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.book-moment-image {
  width: 100%;
  max-width: 167px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(139, 115, 85, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  filter: sepia(10%) contrast(1.05);
  object-fit: contain;
}

.book-pepper-icon {
  filter: sepia(30%) contrast(1.1);
  opacity: 0.85;
}

.book-text {
  font-size: 16pt;
  font-weight: 400;
  line-height: 26pt;
  color: #2c2a26;
  letter-spacing: 0.5px;
  word-spacing: 3px;
  text-shadow: 0.2px 0.2px 1.3px rgba(139, 115, 85, 0.5);
  text-align: justify;
  margin: 0 0 10px 0;
  padding: 0;
  width: 100%;
}

.book-text:first-letter {
  font-family: "Roboto Slab", serif;
  font-size: 340%;
  font-weight: 400;
  float: left;
  line-height: 0.8;
  margin: 3px 8px 0 0;
  opacity: 0.8;
  color: #35312b;
}

.book-separator {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 100px 0;
  padding: 0;
}

.book-separator-image {
  max-width: 100%;
  height: auto;
  opacity: 0.7;
  filter: sepia(20%) contrast(0.9);
}

.book-preview-footer {
  font-family: "Roboto Slab", serif;
  font-size: 26pt;
  font-weight: 400;
  font-style: normal;
  color: #35312b;
  text-shadow: 0.3px 0.3px 2px rgba(139, 115, 85, 0.8);
  text-align: center;
  margin: 40px 0 60px 0;
  padding: 0;
  line-height: 1.4;
}

.book-preview-footer-link {
  color: #8b7555;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 0.3s ease;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 20px;
  animation: musicShake 2s infinite;
}

.book-preview-footer-link:hover {
  color: #6b5d42;
  text-decoration-color: #6b5d42;
}

/* Scrollbar styling */
@keyframes scrollbarPulse {
  0%, 100% {
    box-shadow: 
      0 0 0 0 rgba(255, 179, 53, 0.9),
      0 0 0 0 rgba(255, 179, 53, 0.6);
  }
  50% {
    box-shadow: 
      0 0 0 12px rgba(255, 179, 53, 0),
      0 0 0 6px rgba(255, 179, 53, 0.5);
  }
}

@keyframes arrowSpacing {
  0%, 100% {
    background-position: center 50%;
    background-size: 36px 34px;
  }
  50% {
    background-position: center 50%;
    background-size: 36px 56px;
  }
}

.book-content::-webkit-scrollbar {
  width: 32px;
}

.book-content::-webkit-scrollbar-track {
  background: #d1bf9a;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L40 40M40 0L0 40' stroke='%23968b6a' stroke-width='0.5' opacity='0.4'/%3E%3C/svg%3E");
  border-radius: 16px;
  margin: 0 2px;
}

.book-content::-webkit-scrollbar-thumb {
  background: #ff9f00;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 16 32'%3E%3Cpath fill='%23ffffff' d='M8 2L3 7h10L8 2z'/%3E%3Cpath fill='%23ffffff' d='M8 30l5-5H3l5 5z'/%3E%3C/svg%3E");
  background-size: 36px 45px;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 18px;
  opacity: 1;
  border-left: 4px solid #ff9f00;
  border-right: 4px solid #ff9f00;
  min-height: 100px;
  animation: scrollbarPulse 2.5s ease-in-out infinite, arrowSpacing 2s ease-in-out infinite;
  position: relative;
}

.book-content::-webkit-scrollbar-thumb:hover {
  background: #ffb335;
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 16 32'%3E%3Cpath fill='%23ffffff' d='M8 2L3 7h10L8 2z'/%3E%3Cpath fill='%23ffffff' d='M8 30l5-5H3l5 5z'/%3E%3C/svg%3E");
  background-size: 36px 45px;
  background-position: center center;
  background-repeat: no-repeat;
  border-left-color: #ffb335;
  border-right-color: #ffb335;
  animation: scrollbarPulse 2s ease-in-out infinite, arrowSpacing 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media screen and (max-width: 868px) {
  .book-content {
    padding: 40px 60px 50px 60px;
    height: 65vh;
    max-height: 65vh;
  }
  
  .book-title-row {
    gap: 15px;
  }
  
  .book-icon-image {
    width: 70px;
    height: 70px;
  }
  
  .book-icon-emoji {
    font-size: 56px;
  }
  
  .book-text {
    font-size: 14pt;
    line-height: 28pt;
    padding: 0;
    width: 100%;
  }
  
  .book-title {
    font-size: 26pt;
  }
  
  .book-preview-footer {
    font-size: 26pt;
  }
}

@media screen and (max-width: 480px) {
  .age-verification-overlay {
    top: 90px;
    left: 0;
    width: 100%;
    height: 550px;
  }
  
  .book-preview-container {
    margin: 20px 0;
  }
  
  .book-content {
    padding: 30px 30px 50px 30px;
    max-width: 400px;
    height: 60vh;
    max-height: 60vh;
  }
  
  .book-title {
    font-size: 18pt;
    margin: 15px 0 10px;
  }
  
  
  .book-text {
    font-size: 13pt;
    line-height: 24pt;
    padding: 0;
    width: 100%;
    margin-bottom: 10px;
  }
  
  .book-text:first-letter {
    font-size: 255%;
    margin-top: 3px;
  }
  
  .book-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .book-rating-wrapper {
    align-self: flex-end;
    margin-left: 0;
  }
  
  .book-pepper-rating {
    margin-bottom: 15px;
  }
  
  .book-title {
    font-size: 18pt;
    margin: 15px 0 10px;
  }
  
  .book-preview-footer {
    font-size: 22pt;
    margin: 30px 0 40px 0;
  }
  
  .book-icon-emoji {
    font-size: 48px;
  }
  
  .book-icon-image {
    width: 24px;
    height: 24px;
  }
  
  .book-moment-image {
    max-width: 167px;
  }
  
  .book-stamp-image {
    max-width: 35px;
  }
  
  .book-entry {
    margin-bottom: 0px;
  }
  
  .age-verification-content {
    padding: 24px 20px;
    max-width: 300px;
  }
  
  .age-verification-content h2 {
    font-size: 1rem;
  }
  
  .age-verification-content p {
    font-size: 0.85rem;
  }
  
  .age-consent-label {
    font-size: 0.8rem;
  }
  
  .age-consent-label input[type="checkbox"] {
    width: 32px;
    height: 32px;
  }
  
  .age-verification-button {
    padding: 8px 20px;
    font-size: 0.8rem;
  }
  
  .button-icon {
    width: 14px;
    height: 14px;
  }
}
