/* Floating Book Suggestion Button */
.floating-book-suggestion {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.book-suggestion-link {
  display: block;
  text-decoration: none;
  position: relative;
}

.book-girl-container {
  position: relative;
  width: 120px;
  height: 120px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.book-girl-default,
.book-girl-hover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.book-girl-hover {
  opacity: 0;
}

/* Show hover variant on hover */
.floating-book-suggestion:hover .book-girl-default,
.floating-book-suggestion.active .book-girl-default {
  opacity: 0;
}

.floating-book-suggestion:hover .book-girl-hover,
.floating-book-suggestion.active .book-girl-hover {
  opacity: 1;
  animation: girlAppear 0.3s ease forwards;
}

@keyframes girlAppear {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Dialogue Box */
.dialogue-box {
  position: absolute;
  top: -50px; /* Moved up from -20px */
  left: -200px; /* Adjusted for smaller width */
  background: url('/themes/custom/storyfulls/images/cantfindittellusdialoguebox.png') no-repeat center center;
  background-size: contain;
  width: 200px; /* Reduced from 240px for more compact look */
  height: 85px; /* Reduced from 100px for more compact look */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease; /* Slower, smoother transition */
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px; /* Adjusted padding for smaller box */
  text-align: center;
}

.floating-book-suggestion:hover .dialogue-box,
.floating-book-suggestion.active .dialogue-box {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  /* Removed conflicting animation that causes flickering */
}

/* Removed flickering animation */
/* @keyframes dialogueAppear removed to prevent flickering */

.dialogue-text {
  font-family: 'Roboto Slab', serif;
  font-size: 16px; /* Increased from 14px */
  color: #2C3E50;
  font-weight: 600;
  text-align: center;
  line-height: 1.5; /* Increased from 1.4 for better readability */
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  width: 100%;
  max-width: 100%;
}

.tell-us {
  color: #FF6B6B;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Hover effect on entire button */
.floating-book-suggestion:hover .book-girl-container {
  transform: scale(1.05);
}

/* Pulse animation to draw attention */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.floating-book-suggestion {
  animation: pulse 3s ease-in-out infinite;
}

.floating-book-suggestion:hover {
  animation: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .floating-book-suggestion {
    bottom: 20px;
    right: 20px;
  }
  
  .book-girl-container {
    width: 100px;
    height: 100px;
  }
  
  .dialogue-box {
    left: -160px;
    width: 180px;
    height: 70px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .floating-book-suggestion {
    bottom: 15px;
    right: 15px;
  }
  
  .book-girl-container {
    width: 80px;
    height: 80px;
  }
  
  .dialogue-box {
    left: -140px;
    width: 150px;
    height: 60px;
    font-size: 11px;
  }
}
