/* Custom styles for FitGenius - Optimized */

/* Custom colors based on weight loss website research */
:root {
  --primary-blue: #2C5D82;
  --bright-turquoise: #1FBCC9;
  --energizing-orange: #FF8A3D;
  --coral-pink: #FF6F7A;
  --health-green: #2ECC71;
  --neutral-gray: #9AA0A6;
  --light-gray: #B0B6BA;
  --tw-shadow-color: rgba(0, 0, 0, 0.1);
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
}

/* Enhanced Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.logo-text {
  font-family: 'Montserrat', 'Bebas Neue', sans-serif;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(44, 93, 130, 0.4), 0 2px 10px rgba(31, 188, 201, 0.3);
  position: relative;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
}

/* Smooth animations - Optimized */
* {
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

/* Custom gradient backgrounds */
.bg-primary-gradient {
  background: linear-gradient(135deg, var(--primary-blue), var(--bright-turquoise));
}

.bg-cta-gradient {
  background: linear-gradient(135deg, var(--energizing-orange), var(--coral-pink));
}

.bg-success-gradient {
  background: linear-gradient(135deg, var(--health-green), var(--bright-turquoise));
}

/* Transformation Image Effects */
.transformation-image {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.transformation-image:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.transformation-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(31, 188, 201, 0.1), rgba(255, 138, 61, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.transformation-image:hover::before {
  opacity: 1;
}

.muscle-inspire {
  filter: contrast(1.1) saturate(1.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.muscle-inspire:hover {
  filter: contrast(1.2) saturate(1.3) brightness(1.05);
  transform: scale(1.05);
}

.inspiration-badge {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced button styles - Improved */
.btn-primary {
  background: linear-gradient(135deg, var(--energizing-orange), var(--coral-pink));
  border: none;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: none;
  box-shadow: 0 4px 15px rgba(255, 138, 61, 0.3);
  transform: translateY(0);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 138, 61, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 138, 61, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--bright-turquoise), var(--primary-blue));
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: white;
  box-shadow: 0 3px 10px rgba(31, 188, 201, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(31, 188, 201, 0.4);
}

/* Card enhancements */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Pricing card specific styles */
.pricing-card {
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bright-turquoise), var(--health-green));
}

.pricing-card.popular {
  border: 2px solid var(--bright-turquoise);
  transform: scale(1.05);
}

.pricing-card.popular::before {
  background: linear-gradient(90deg, var(--energizing-orange), var(--coral-pink));
}

/* Form enhancements - Better UX */
.form-input {
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--bright-turquoise);
  box-shadow: 0 0 0 3px rgba(31, 188, 201, 0.1);
  transform: translateY(-1px);
}

.form-input:hover {
  border-color: #d1d5db;
}

.form-input.error {
  border-color: #ef4444;
  animation: shake 0.4s ease-in-out;
}

.form-input.success {
  border-color: var(--health-green);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background-color: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--bright-turquoise));
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Loading animation */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Questionnaire specific styles */
.question-option {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.question-option:hover {
  border-color: var(--bright-turquoise);
  background-color: rgba(31, 188, 201, 0.05);
  transform: translateX(5px);
}

.question-option.selected {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, rgba(44, 93, 130, 0.1), rgba(31, 188, 201, 0.1));
}

/* Modal enhancements */
.modal-overlay {
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bright-turquoise) #f1f1f1;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--bright-turquoise);
  border-radius: 10px;
}

/* Feature icons */
.feature-icon {
  background: linear-gradient(135deg, var(--energizing-orange), var(--coral-pink));
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 20px rgba(255, 138, 61, 0.3);
}

.feature-icon.turquoise {
  background: linear-gradient(135deg, var(--bright-turquoise), var(--primary-blue));
  box-shadow: 0 4px 20px rgba(31, 188, 201, 0.3);
}

.feature-icon.green {
  background: linear-gradient(135deg, var(--health-green), var(--bright-turquoise));
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

/* Responsive enhancements */
@media (max-width: 768px) {
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .pricing-card.popular {
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .question-option:hover {
    transform: none;
  }
  
  /* Optimize mobile animations */
  .hover-lift:hover {
    transform: translateY(-4px);
  }
  
  /* Better mobile spacing */
  .logo-text {
    font-size: 2.5rem !important;
  }
}

/* Image lazy loading optimization - Images will load naturally */
img[loading="lazy"] {
  transition: opacity 0.3s ease;
}

/* Typography enhancements */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue), var(--bright-turquoise));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-cta-gradient {
  background: linear-gradient(135deg, var(--energizing-orange), var(--coral-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Success states */
.success-checkmark {
  animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Floating elements animation */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Custom scrollbar for the page */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-blue), var(--bright-turquoise));
  border-radius: 10px;
}

body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--bright-turquoise), var(--primary-blue));
}

/* Advanced Animations */
.fade-in-up {
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.animate-gradient {
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pulse glow animation - Optimized */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 4px 20px rgba(255, 138, 61, 0.4);
  }
  to {
    box-shadow: 0 8px 35px rgba(255, 138, 61, 0.6);
  }
}

.text-gradient {
  background: linear-gradient(135deg, var(--energizing-orange), var(--coral-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Staggered animations */
.stagger-fade {
  animation: fadeInUp 0.6s ease-out backwards;
}

.stagger-fade:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade:nth-child(4) { animation-delay: 0.4s; }

/* Modal animations */
.modal-show {
  animation: modalFadeIn 0.3s ease-out;
}

.modal-show #modal-content {
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Enhanced form animations */
.form-input {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(31, 188, 201, 0.15);
}

/* Question option animations */
.question-option {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.question-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(31, 188, 201, 0.1), transparent);
  transition: left 0.5s ease;
}

.question-option:hover::before {
  left: 100%;
}

.question-option:hover {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 10px 30px rgba(31, 188, 201, 0.2);
}

.question-option.selected {
  transform: translateX(8px) scale(1.02);
  background: linear-gradient(135deg, rgba(44, 93, 130, 0.1), rgba(31, 188, 201, 0.1));
  box-shadow: 0 10px 30px rgba(44, 93, 130, 0.2);
}

/* Progress bar enhancement */
.progress-fill {
  background: linear-gradient(90deg, var(--primary-blue), var(--bright-turquoise), var(--energizing-orange));
  background-size: 200% 100%;
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Pricing card entrance animation */
.pricing-card-enter {
  animation: priceCardEnter 0.6s ease-out backwards;
}

.pricing-card-enter:nth-child(1) { animation-delay: 0.1s; }
.pricing-card-enter:nth-child(2) { animation-delay: 0.2s; }
.pricing-card-enter:nth-child(3) { animation-delay: 0.3s; }

@keyframes priceCardEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Success animation enhancement */
.success-enter {
  animation: successBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-10deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Loading animation enhancement */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bright-turquoise);
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
  0%, 80%, 100% { 
    transform: scale(0);
    opacity: 0.5;
  } 
  40% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive enhancements */
@media (max-width: 768px) {
  .hover-lift:hover {
    transform: none;
  }
  
  .question-option:hover {
    transform: none;
  }
  
  .fade-in-up {
    animation-duration: 0.6s;
  }
}

/* Feature Cards Enhancement */
.feature-card {
  position: relative;
  padding: 2rem 1.5rem;
  border-radius: 1.5rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: visible;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(44, 93, 130, 0.05) 0%, 
    rgba(31, 188, 201, 0.05) 50%, 
    rgba(255, 138, 61, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  border-radius: 1.5rem;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 
              0 0 30px rgba(31, 188, 201, 0.2);
  border-color: rgba(31, 188, 201, 0.3);
}

/* Enhanced modal styles */
#questionnaire-modal {
  animation-duration: 0.4s;
  animation-fill-mode: both;
}

#questionnaire-modal.modal-show {
  animation-name: modalBackdropFade;
}

@keyframes modalBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

#modal-content {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-show #modal-content {
  animation: modalContentEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalContentEnter {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Back button styles */
.back-button {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: 1px solid #d1d5db;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.back-button:active {
  transform: translateX(-1px) scale(0.98);
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}