/* Performance Optimizations */

/* Optimize for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, 
  *::before, 
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize for save-data mode */
.save-data * {
  background-image: none !important;
  animation: none !important;
  transition: none !important;
}

/* Optimize images */
img {
  content-visibility: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Optimize animations */
.animate {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-font-smoothing: subpixel-antialiased;
}

/* Prevent FOUC on animated elements by hiding them initially */
.hero-title, .hero-subtitle, .hero-description, .hero-cta, .hero-marquee,
.bento-item,
.process-step,
.work-item,
.testimonial-card,
.pricing-card,
.faq-item {
 opacity: 0;
}

/* Optimize layout shifts */
img, 
video, 
iframe, 
picture, 
figure {
  max-width: 100%;
  height: auto;
}

/* Pricing card optimizations */
.pricing-card {
  transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-radius: 0.75rem !important;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Prevent layout shifts during animations */
.pricing-card {
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

/* Ensure smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Optimize text rendering */
body {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

/* Optimize for mobile */
@media (max-width: 768px) {
  .pricing-card {
    min-height: auto;
    margin-bottom: 1.5rem;
    transform: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  }
  
  .pricing-card:hover {
    transform: none !important;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Optimize for reduced motion - specific to pricing card */
@media (prefers-reduced-motion: reduce) {
  .pricing-card {
    transition: none !important;
    animation: none !important;
  }
}

/* Optimize for print */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
  
  /* Don't show links that are fragment identifiers */
  a[href^="#"]::after {
    content: "";
  }
}

/* Consistent card styling across the site */
.pricing-card,
.bento-item,
.work-item,
.testimonial-card,
.faq-item,
.process-step {
  border-radius: 0.75rem !important;
  margin: 0.5rem !important;
}

/* Enhanced responsive styles for bento grid and process steps */
.bento-container, .process-steps-container {
  transition: all 0.3s ease;
}

.bento-item, .process-step {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
}

.bento-item img, .process-step img {
  transition: all 0.3s ease;
}

/* Process steps specific styles */
.process-step {
  min-height: 260px;
  transform: translateZ(0);
  overflow: hidden;
}

.process-step:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* Responsive adjustments for bento items */
@media (max-width: 992px) {
  .bento-container {
    padding: 1rem !important;
  }
}

@media (max-width: 768px) {
  .bento-container {
    padding: 0.5rem !important;
  }
  
  .bento-item h3,
  .bento-item .font-bold {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  #features, #process, #testimonials {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .bento-container {
    padding: 0 !important;
  }
  
  .section-header {
    font-size: 32px !important;
  }
  
  .testimonial-card {
    margin: 0 0.25rem !important;
  }
}

/* Section title star decoration */
.star-decoration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 0.5rem;
  transform: translateY(-1px);
  animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: translateY(-1px) scale(1); }
  50% { opacity: 1; transform: translateY(-1px) scale(1.1); }
}

/* --- Professional Dark FAQ Accordion Styles --- */
.faq-item {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
  border-width: 1px;
  margin-bottom: 12px;
  border-radius: 0.75rem !important;
}

/* Toggle button styling */
.faq-toggle {
  position: relative;
  transition: background 0.3s ease;
  z-index: 2;
}

/* Number indicator in FAQ toggle */
.faq-toggle .flex.items-center span:first-child {
  transition: all 0.3s ease;
}

/* Plus icon container in FAQ toggle */
.faq-toggle .flex.items-center span:last-child {
  transition: all 0.3s ease;
}

/* Plus icon */
.faq-toggle svg {
  transition: transform 0.3s ease;
}

/* Content panel styling */
.faq-content {
  position: relative;
  transition: all 0.3s ease;
  z-index: 1;
}

/* Active (open) state styles */
.faq-item.active {
  border-color: rgba(100, 100, 115, 0.4) !important;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.25);
}

/* Active toggle button */
.faq-item.active .faq-toggle {
  background: rgba(15, 15, 25, 0.7) !important;
}

/* Active number indicator */
.faq-item.active .faq-toggle .flex.items-center span:first-child {
  opacity: 1;
}

/* Active plus icon container */
.faq-item.active .faq-toggle .flex.items-center span:last-child {
  background-color: rgba(20, 20, 30, 0.9) !important;
  border-color: rgba(100, 100, 115, 0.4) !important;
}

/* Active plus icon (rotated to X) */
.faq-item.active .faq-toggle svg {
  transform: rotate(45deg);
}

/* Active content area */
.faq-item.active .faq-content {
  border-top-color: rgba(100, 100, 115, 0.15);
  background: rgba(10, 10, 15, 0.4);
}

/* Content paragraph styling */
.faq-content p {
  line-height: 1.7;
  color: #E5E7EB; /* Ensure text is light for readability */
}

/* Style adjustments for each FAQ item */
.faq-item .faq-toggle {
  background: rgba(10, 10, 18, 0.5) !important;
}

.faq-item .faq-toggle:hover {
  background: rgba(15, 15, 25, 0.6) !important;
}

/* Subtle animations */
.faq-item:hover {
  transform: translateY(-1px);
}

/* Consistent colors for all elements */
.faq-item.active {
  border-color: rgba(80, 80, 100, 0.5) !important;
}

/* Consistent border and shadow */
.faq-item {
  border-radius: 12px;
  border-color: rgba(80, 80, 100, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Content spacing */
.faq-content {
  border-top-width: 1px;
  border-top-color: rgba(80, 80, 100, 0.1);
  padding: 0;
}

/* More subtle transition */
.faq-item,
.faq-toggle,
.faq-content,
.faq-toggle svg {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure text remains readable */
.faq-content p {
  color: rgba(220, 220, 230, 0.8);
}

/* Improve toggle button aesthetics */
.faq-toggle {
  border-radius: 12px;
}

/* Improve number indicator */
.faq-toggle .flex.items-center span:first-child {
  background-color: rgba(30, 30, 40, 0.6) !important;
  color: rgba(220, 220, 230, 0.9) !important;
}

/* Improve plus icon container */
.faq-toggle .flex.items-center span:last-child {
  background-color: rgba(25, 25, 35, 0.8) !important;
  border-color: rgba(80, 80, 100, 0.3) !important;
}

/* .faq-content styling is primarily handled by GSAP for animation (maxHeight, opacity) */
/* and by Tailwind classes in HTML for padding. */

/* Ensure the SVG icon itself transitions color if needed, though rotation is primary */
.faq-toggle svg {
  transition: transform 0.3s ease-in-out; /* GSAP handles rotation, but good to have */
}

/* --- End Enhanced FAQ Accordion Styles --- */
