/* Custom styles for Bedtime Stories */

/* Body padding for fixed navbar */
body {
  padding-top: 0;
}

/* Fix for anchor link scroll offset with fixed navbar */
section[id] {
  scroll-margin-top: 80px; /* Navbar height (70px) + 10px padding */
}

/* Specific adjustment for FAQ section */
#faqAccordion {
  scroll-margin-top: 80px;
}

/* Navbar enhancements */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  min-height: 70px;
}

.navbar-brand {
  font-weight: 700;
  color: #667eea !important;
}

.nav-link {
  font-weight: 500;
  color: #495057 !important;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #667eea !important;
}

.nav-link.active {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea !important;
  border-radius: 8px;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #667eea;
  padding-left: 2rem;
}

.dropdown-divider {
  margin: 0.5rem 0;
}

/* Base wizard styling */
.wizard-container {
  max-width: 600px;
  width: 100%;
  padding: 20px 0; /* Remove left/right padding */
  margin-top: 70px !important;
}

.wizard-card,
.story-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.5s ease-out;
}

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

/* Step header styling */
.step-header h2 {
  color: #2c3e50;
  font-weight: 600;
}

.step-icon i {
  color: #667eea !important;
}

/* Option card styling */
.option-card {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.option-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.option-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.option-content {
  font-weight: 500;
  font-size: 1.1rem;
}

/* Gender option specific styling */
.gender-option {
  cursor: pointer;
  display: block;
}

.gender-option .option-card {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Interests grid styling */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.interest-option {
  cursor: pointer;
  display: block;
}

.interest-card {
  padding: 15px;
  font-size: 1rem;
}

/* Style option specific styling */
.style-option {
  cursor: pointer;
  display: block;
}

.style-card {
  text-align: left;
  padding: 20px;
}

.style-emoji {
  font-size: 2rem;
  line-height: 1;
}

.style-label {
  font-weight: 600;
  font-size: 1.1rem;
  color: inherit;
}

.style-description {
  font-size: 0.9rem;
  margin-top: 2px;
}

.style-card.selected .style-description {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Form input styling */
.form-control-lg {
  border-radius: 12px;
  border: 2px solid #e9ecef;
  padding: 15px 20px;
  font-size: 1.1rem;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button styling */
.btn {
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 12px 24px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  border: none;
  padding: 12px 24px;
}

.btn-success:hover {
  background: linear-gradient(135deg, #4e9a28 0%, #96d4bb 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(86, 171, 47, 0.3);
}

.btn-outline-secondary {
  border: 2px solid #6c757d;
  color: #6c757d;
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
  transform: translateY(-2px);
}

/* Progress bar styling */
.progress {
  background-color: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: width 0.6s ease;
}

.progress-section {
  margin-top: 30px;
}

/* Story result styling */
.story-card {
  max-width: 800px;
  margin: 0 auto;
}

.story-content {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
  border-left: 5px solid #667eea;
}

.story-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2c3e50;
  font-family: "Georgia", serif;
}

.story-details {
  border-left: 4px solid #28a745;
}

/* Wizard footer */
.wizard-footer {
  margin-top: 40px;
  padding-top: 20px;
}

/* Age input specific styling */
input[type="number"] {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Navbar Styles */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 600;
  color: #667eea;
  font-size: 1.5rem;
}

.navbar-brand:hover {
  color: #5a6fd8;
}

.nav-link {
  color: #667eea;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: #5a6fd8;
}

/* CTA Button Styles */
.nav-btn-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  margin-left: 1rem;
}

.nav-btn-cta:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Mobile Navigation */
@media (max-width: 991.98px) {
  .nav-btn-cta {
    margin: 0.5rem 0;
    margin-left: 0;
    display: inline-block;
    text-align: left;
  }

  /* Mobile hero section spacing */
  .hero-section {
    padding-top: 120px !important;
  }

  .hero-section .row {
    padding-top: 20px !important;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .wizard-card,
  .story-card {
    padding: 25px 15px; /* Reduced horizontal padding for more reading space */
    margin: 10px;
  }

  .interests-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }

  .interest-card,
  .option-card {
    padding: 12px;
    font-size: 0.95rem;
  }

  .style-card {
    padding: 15px;
  }

  .style-emoji {
    font-size: 1.5rem;
  }
  
  /* Reduce horizontal padding for story content on mobile */
  .story-content {
    padding: 30px 15px; /* Keep vertical padding, reduce horizontal */
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fade transitions */
.fade-enter {
  opacity: 0;
  transform: translateY(20px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-exit {
  opacity: 1;
  transform: translateY(0);
}

.fade-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hero Image Animations */
.hero-image {
  overflow: visible;
}

/* Floating animation for the main book */
.book-float {
  animation: float 3s ease-in-out infinite;
}

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

/* Twinkling animation for stars */
.star-1 {
  animation: twinkle 2s ease-in-out infinite;
}

.star-2 {
  animation: twinkle 2.5s ease-in-out infinite 0.5s;
}

.star-3 {
  animation: twinkle 3s ease-in-out infinite 1s;
}

.star-4 {
  animation: twinkle 2.2s ease-in-out infinite 0.3s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.4;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
    transform: rotate(180deg) scale(1.3);
  }
}

/* Moon gentle glow animation */
.moon-accent {
  animation: moonGlow 4s ease-in-out infinite;
}

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

/* Desktop adjustments for hero section spacing */
@media (min-width: 992px) {
  .hero-section {
    padding-top: 60px !important; /* Reduced from 80px */
  }
  
  .hero-section .row {
    min-height: 60vh !important; /* Reduced from 70vh */
    padding-top: 20px !important; /* Reduced from 40px */
  }
}

/* Responsive adjustments for hero animations */
@media (max-width: 991px) {
  .hero-image {
    height: 300px !important;
  }

  .book-float i {
    font-size: 140px !important;
  }

  /* Adjust star sizes for mobile */
  .star-1 i,
  .star-2 i,
  .star-3 i,
  .star-4 i {
    font-size: 16px !important;
  }

  .moon-accent {
    top: 10% !important;
    right: 20% !important;
  }
}
