/**
 * TERREXO COMPONENT UTILITIES & SNIPPETS
 * Version 1.0
 * Ready-to-use component classes and patterns for common UI elements
 *
 * Usage in Twig templates:
 * Include these classes directly in your Twig templates following the patterns below
 */

/* ============================================
   1. HERO SECTION PATTERN
   ============================================

   <section class="min-h-screen bg-terrex-bg flex items-center justify-center relative overflow-hidden">
     <div class="absolute inset-0 bg-gradient-light-band"></div>
     <div class="container-fluid relative z-10 text-center">
       <h1 class="type-hero text-terrex-text mb-6">Your Headline</h1>
       <p class="type-body text-terrex-muted max-w-2xl mx-auto mb-8">Supporting text</p>
       <button class="btn btn-primary">Call to Action</button>
     </div>
   </section>
*/

/* ============================================
   2. FEATURE GRID PATTERN
   ============================================

   <section class="section bg-terrex-bg">
     <div class="container-fluid">
       <h2 class="type-h2 text-center mb-16">Section Title</h2>
       <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
         <div class="card hover:scale-105">
           <div class="mb-4 text-terrex-accent text-3xl">📐</div>
           <h3 class="type-h3 mb-4">Feature Title</h3>
           <p class="text-terrex-muted">Feature description</p>
         </div>
         <!-- Repeat for each feature -->
       </div>
     </div>
   </section>
*/

/* ============================================
   3. CTA SECTION PATTERN
   ============================================

   <section class="section bg-terrex-surface">
     <div class="container-fluid text-center">
       <h2 class="type-h2 mb-6">Ready to start?</h2>
       <p class="type-body text-terrex-muted mb-8 max-w-2xl mx-auto">
         Description text
       </p>
       <div class="flex flex-col sm:flex-row gap-4 justify-center">
         <button class="btn btn-primary">Get Started</button>
         <button class="btn btn-secondary">Learn More</button>
       </div>
     </div>
   </section>
*/

/* ============================================
   4. TESTIMONIAL CARD PATTERN
   ============================================

   <div class="card">
     <div class="flex items-start gap-4 mb-4">
       <img src="avatar.jpg" alt="Name" class="w-12 h-12 rounded-full">
       <div>
         <p class="type-body font-semibold text-terrex-text">Person Name</p>
         <p class="type-small text-terrex-muted">Role/Company</p>
       </div>
     </div>
     <p class="text-terrex-muted italic">"Testimonial quote here"</p>
     <div class="flex gap-1 mt-4">
       <!-- Star ratings -->
     </div>
   </div>
*/

/* ============================================
   5. FORM PATTERN
   ============================================

   <form class="space-y-6 max-w-lg mx-auto">
     <div>
       <label for="name" class="label">Full Name</label>
       <input type="text" id="name" class="input" placeholder="John Doe">
     </div>

     <div>
       <label for="email" class="label">Email</label>
       <input type="email" id="email" class="input" placeholder="john@example.com">
     </div>

     <div>
       <label for="message" class="label">Message</label>
       <textarea id="message" class="textarea" placeholder="Your message"></textarea>
     </div>

     <button type="submit" class="btn btn-primary w-full">Send Message</button>
   </form>
*/

/* ============================================
   6. STATS SECTION PATTERN
   ============================================

   <section class="section bg-terrex-surface">
     <div class="container-fluid">
       <div class="grid grid-cols-2 md:grid-cols-4 gap-8">
         <div class="text-center">
           <p class="type-hero text-terrex-accent mb-2">500+</p>
           <p class="type-body text-terrex-muted">Projects Completed</p>
         </div>
         <!-- Repeat for each stat -->
       </div>
     </div>
   </section>
*/

/* ============================================
   7. NAVIGATION BREADCRUMB PATTERN
   ============================================

   <nav class="py-4 text-terrex-muted text-sm">
     <div class="container-fluid flex gap-2 items-center">
       <a href="/" class="link-subtle">Home</a>
       <span>/</span>
       <a href="/services" class="link-subtle">Services</a>
       <span>/</span>
       <span>Current Page</span>
     </div>
   </nav>
*/

/* ============================================
   8. ALERT PATTERN
   ============================================

   <div class="bg-terrex-surface border border-terrex-success rounded-lg p-4 mb-4">
     <p class="type-body text-terrex-success">Success message</p>
   </div>

   <div class="bg-terrex-surface border border-terrex-warning rounded-lg p-4 mb-4">
     <p class="type-body text-terrex-warning">Warning message</p>
   </div>

   <div class="bg-terrex-surface border border-terrex-error rounded-lg p-4 mb-4">
     <p class="type-body text-terrex-error">Error message</p>
   </div>
*/

/* ============================================
   9. PRICING TABLE PATTERN
   ============================================

   <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
     <div class="card">
       <h3 class="type-h3 mb-4">Plan Name</h3>
       <p class="type-hero text-terrex-accent mb-2">$99</p>
       <p class="text-terrex-muted text-sm mb-6">/month</p>
       <ul class="space-y-3 mb-8">
         <li class="flex gap-2">
           <span>✓</span>
           <span class="text-terrex-muted">Feature</span>
         </li>
       </ul>
       <button class="btn btn-primary w-full">Get Started</button>
     </div>
   </div>
*/

/* ============================================
   10. TIMELINE PATTERN
   ============================================

   <div class="relative">
     <div class="absolute left-4 top-0 bottom-0 w-px bg-terrex-border"></div>
     <div class="space-y-8 pl-16">
       <div>
         <div class="absolute left-0 w-8 h-8 bg-terrex-accent rounded-full"></div>
         <p class="type-h3">Milestone</p>
         <p class="text-terrex-muted">Description</p>
       </div>
     </div>
   </div>
*/

/* ============================================
   11. CARD HOVER ANIMATIONS
   ============================================ */

.card-hover {
  @apply transition-all duration-300 hover:scale-105 hover:shadow-xl;
}

.card-hover-lift {
  @apply transition-all duration-300 hover:-translate-y-2 hover:shadow-xl;
}

/* ============================================
   12. TEXT ANIMATIONS
   ============================================ */

.text-gradient {
  @apply bg-gradient-accent bg-clip-text text-transparent;
}

.text-truncate-multi {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   13. VISIBILITY UTILITIES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Z-Index Utilities */
.z-dropdown {
  z-index: var(--z-dropdown);
}

.z-sticky {
  z-index: var(--z-sticky);
}

.z-fixed {
  z-index: var(--z-fixed);
}

.z-modal-backdrop {
  z-index: var(--z-modal-backdrop);
}

.z-modal {
  z-index: var(--z-modal);
}

.z-popover {
  z-index: var(--z-popover);
}

.z-tooltip {
  z-index: var(--z-tooltip);
}

@media (max-width: 640px) {
  .container-fluid {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  .section {
    padding-top: var(--section-mobile);
    padding-bottom: var(--section-mobile);
  }
}

/* ============================================
   15. ANIMATION KEYFRAMES - Matching Framer Motion
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUpSmall {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUpMedium {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation classes - will be added via JS */
.animate-in {
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: both;
}

.animate-fade-in {
  animation-name: fadeIn;
  animation-duration: 0.8s;
}

.animate-fade-in-up {
  animation-name: fadeInUp;
  animation-duration: 0.8s;
}

.animate-fade-in-up-small {
  animation-name: fadeInUpSmall;
  animation-duration: 0.6s;
}

.animate-fade-in-up-medium {
  animation-name: fadeInUpMedium;
  animation-duration: 0.5s;
}

.animate-slide-in-left {
  animation-name: slideInLeft;
  animation-duration: 0.8s;
}

.animate-slide-in-right {
  animation-name: slideInRight;
  animation-duration: 0.8s;
}

.animate-scale-in {
  animation-name: scaleIn;
  animation-duration: 0.6s;
}

/* Initial state for elements that will animate */
[data-animate],
[data-animate-load] {
  opacity: 1; /* Make visible by default */
  transform: none; /* Reset transforms */
}

/* When animated, make visible */
[data-animate].animated,
[data-animate-load].animated {
  /* Animation handles the final state */
}

/* ============================================
   16. ACCESSIBILITY UTILITIES
   ============================================ */

.visually-hidden {
  @apply sr-only;
}

.focus-visible {
  @apply focus:ring-2 focus:ring-offset-2 focus:ring-terrex-accent;
}

/* ============================================
   17. BREAKPOINT DEBUGGING (Remove in production)
   ============================================

   Add to body::before in development:

   @media (max-width: 640px) {
     content: "sm";
   }

   @media (min-width: 641px) and (max-width: 768px) {
     content: "md";
   }
*/
