/* Valentine Theme Colors - Light Pink Focus */
:root {
  --primary: #f472b6; /* Pink-400 */
  --primary-focus: #ec4899; /* Pink-500 */
  --primary-content: #ffffff;
  --secondary: #f9a8d4; /* Pink-300 */
  --secondary-focus: #f472b6; /* Pink-400 */
  --secondary-content: #ffffff;
  --accent: #fbcfe8; /* Pink-200 */
  --accent-focus: #f9a8d4; /* Pink-300 */
  --accent-content: #831843; /* Pink-900 */
  --base-100: #fdf2f8; /* Pink-50 */
  --base-200: #fce7f3; /* Pink-100 */
  --base-300: #fbcfe8; /* Pink-200 */
  --base-content: #831843; /* Pink-900 */
}

/* Custom Styles */
body {
  background-color: var(--base-100);
  color: var(--base-content);
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23fbcfe8' fill-opacity='0.4'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  line-height: 1.8;
  text-align: right;
  direction: rtl;
  opacity: 0;
  transition: opacity 1s ease;
}

.story-section {
  position: relative;
  transition: all 0.5s ease;
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 25px rgba(244, 114, 182, 0.2);
  border: 1px solid rgba(244, 114, 182, 0.1);
}

.story-section:hover {
  background-color: var(--base-200);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(244, 114, 182, 0.3);
}

.subtitle {
  position: relative;
  display: inline-block;
}

.subtitle::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
  background-image: linear-gradient(to right, #f472b6, #ec4899);
}

.story-section:hover .subtitle::after {
  width: 100%;
}

/* Title glance/shimmer effect */
@keyframes glance {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

h1, h2, h3 {
  position: relative;
  display: inline-block;
}

h1::after, h2::after, h3::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.6) 50%, 
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: glance 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

h1 {
  color: var(--primary-focus);
}

h2 {
  color: var(--primary);
}

h3 {
  color: var(--primary);
}

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

.story-section {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.story-section:nth-child(1) { animation-delay: 0.2s; }
.story-section:nth-child(2) { animation-delay: 0.4s; }
.story-section:nth-child(3) { animation-delay: 0.6s; }
.story-section:nth-child(4) { animation-delay: 0.8s; }

/* Form styling */
.form-control input:focus, 
.form-control textarea:focus,
.form-control select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(233, 109, 123, 0.2);
}

.btn-primary, 
.btn.bg-pink-500 {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-content);
  transition: all 0.3s ease;
}

.btn-primary:hover,
.btn.bg-pink-500:hover {
  background-color: var(--primary-focus);
  border-color: var(--primary-focus);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(244, 114, 182, 0.4);
}

/* Expanded content animation */
.expanded-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.expanded-content.show {
  max-height: 500px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--base-200);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-focus);
}

/* Add heart-shaped bullets to lists */
ul {
  list-style: none;
}

ul li::before {
  content: '♥';
  color: var(--primary);
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* Add subtle floating animation to lottie players */
lottie-player {
  filter: drop-shadow(0 5px 15px rgba(244, 114, 182, 0.3));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* RTL specific adjustments */
.btn {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
}

.subtitle {
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

p {
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  line-height: 1.8;
}

/* Fix lottie player positions for RTL */
.absolute.right-0 {
  left: 0;
  right: auto;
}

.absolute.left-0 {
  right: 0;
  left: auto;
}

/* Chatbot Styles */
#chatbot-container {
  font-family: 'Tajawal', sans-serif;
}

#chat-button {
  transition: transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.4);
}

#chat-button:hover {
  transform: scale(1.1);
}

#chat-window {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

#chat-window.active {
  max-height: 500px;
  opacity: 1;
}

.chat-message {
  padding: 8px 12px;
  border-radius: 18px;
  max-width: 80%;
  word-break: break-word;
}

.user-message {
  background-color: var(--primary);
  color: white;
  border-top-right-radius: 4px;
  margin-left: auto;
}

.bot-message {
  background-color: var(--accent);
  color: var(--accent-content);
  border-top-left-radius: 4px;
  margin-right: auto;
}

.typing-indicator {
  display: flex;
  align-items: center;
  margin-right: auto;
  background-color: var(--accent);
  padding: 8px 16px;
  border-radius: 18px;
  border-top-left-radius: 4px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 1px;
  background-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  opacity: 0.4;
}

.typing-indicator span:nth-child(1) {
  animation: pulse 1s infinite;
}

.typing-indicator span:nth-child(2) {
  animation: pulse 1s infinite 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation: pulse 1s infinite 0.4s;
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .story-section {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2.5rem !important;
  }
  
  h2 {
    font-size: 1.8rem !important;
  }
}

/* Story result styling */
#story-result {
  display: none;
  padding: 2rem;
  background-color: var(--accent);
  border-radius: 1rem;
  margin-top: 2rem;
  box-shadow: 0 10px 25px rgba(233, 109, 123, 0.3);
  animation: fadeIn 0.8s ease forwards;
}

/* Remove chapter navigation styles */
#chapter-navigation {
  display: none; /* Hide the navigation instead of removing it completely */
}

/* Visual separator between chapters */
.chapter-separator {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  margin: 40px auto;
  width: 70%;
  opacity: 0.7;
  position: relative;
}

.chapter-separator::before {
  content: '❦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--base-100);
  color: var(--primary);
  padding: 0 15px;
  font-size: 20px;
}

/* Chapter section styling */
.chapter-section {
  transition: transform 0.3s ease;
  padding-top: 20px;
  padding-bottom: 20px;
  position: relative;
}

.chapter-section:hover {
  z-index: 10;
}

.chapter-section:hover img {
  transform: translateZ(20px) scale(1.05);
  transition: transform 0.5s ease;
}

/* Improve RTL support for navigation */
html[dir="rtl"] #chapter-navigation {
  right: 20px;
  left: auto;
}

html[dir="rtl"] .chapter-dot::after {
  right: 25px;
  left: auto;
}

/* Add a subtle pulse animation to the active chapter dot */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 114, 182, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 114, 182, 0);
  }
}

/* Add smooth scrolling to the whole page */
html {
  scroll-behavior: smooth;
}

/* Add a subtle background pattern to each chapter section */
.chapter-section:nth-child(odd) {
  background-image: radial-gradient(var(--accent) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  background-repeat: repeat;
  background-attachment: fixed;
}

/* Page load transition */
body.page-loaded {
  opacity: 1;
}

/* Add animation for chapter transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(30px);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.fade-out-down {
  animation: fadeOutDown 0.5s ease forwards;
}
