/* Structure Services Interactions
 * Motion personality: Smooth & Subtle
 * Generated: 2026-01-24
 * Skill: interaction-design
 *
 * This file contains:
 * - Reduced motion support (accessibility)
 * - Animation keyframes
 * - Enhanced interaction states
 */

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION SUPPORT
   Accessibility: Respect user preferences 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;
  }
  
  /* Keep opacity changes for state feedback, just make them instant */
  .mobile-menu,
  .toast,
  .booking-modal {
    transition: opacity 0.01ms, visibility 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATION KEYFRAMES
   Reusable animations for dynamic elements
   ═══════════════════════════════════════════════════════════════ */

/* Fade in - for modals, toasts, overlays */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade out */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Slide in from top - for toasts */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from bottom - for mobile menu, bottom sheets */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale in - for modals */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse - for loading skeletons */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Spin - for loading spinners */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATES
   Visual feedback during async operations
   ═══════════════════════════════════════════════════════════════ */

.is-loading {
  position: relative;
  pointer-events: none;
}

.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Skeleton loading placeholder */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-section-bg) 25%,
    var(--color-border-light) 50%,
    var(--color-section-bg) 75%
  );
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════
   FOCUS STATES
   Enhanced keyboard navigation visibility
   ═══════════════════════════════════════════════════════════════ */

/* Focus visible - only show focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL BEHAVIOR
   Smooth scrolling for anchor links
   ═══════════════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
}

/* Offset for fixed header */
:target {
  scroll-margin-top: calc(var(--nav-height) + var(--space-4));
}

@media (max-width: 767px) {
  :target {
    scroll-margin-top: calc(var(--nav-height-mobile) + var(--space-4));
  }
}
