/* HomeMover Delivery - Modern Minimalist Design */

* {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Added card flip 3D animation styles */
.card-interactive {
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.card-interactive:hover {
  transform: translateY(-2px);
}

.card-interactive .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 1.5rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.card-interactive .card-back.hidden {
  opacity: 0;
  pointer-events: none;
}

.card-interactive .card-back:not(.hidden) {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

/* Smooth transitions for interactive elements */
a, button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Updated focus states to match minimal design */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Minimal scrollbar design */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f9fafb;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Image transitions */
img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

/* Added smooth scale on hover for images */
.group:hover img {
  transform: scale(1.05);
}

/* Cookie popup animation */
#cookiePopup {
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#cookiePopup.show {
  transform: translateY(0) !important;
}

/* Enhanced card hover effects matching reference design */
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-sm:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-lg:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile menu slide animation */
#mobileMenu {
  transition: all 0.3s ease;
}

/* Subtle button press effect */
button:active,
a.bg-gray-900:active,
a.bg-yellow-400:active {
  transform: scale(0.98);
}

/* Loading state for form */
form.submitting {
  opacity: 0.6;
  pointer-events: none;
}

form.submitting button[type="submit"]::after {
  content: "...";
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

/* Print styles */
@media print {
  header,
  footer,
  #cookiePopup,
  button,
  nav {
      display: none;
  }
  
  body {
      background: white !important;
  }
}

/* Accessibility improvements */
.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;
}

/* Updated focus styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Responsive image containers */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Added fade in animation for sections */
@keyframes fadeInUp {
  from {
      opacity: 0;
      transform: translateY(30px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Added stagger animation for grid items */
@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.grid > * {
  animation: fadeIn 0.5s ease forwards;
}

.grid > *:nth-child(1) { animation-delay: 0.05s; }
.grid > *:nth-child(2) { animation-delay: 0.1s; }
.grid > *:nth-child(3) { animation-delay: 0.15s; }
.grid > *:nth-child(4) { animation-delay: 0.2s; }
.grid > *:nth-child(5) { animation-delay: 0.25s; }
.grid > *:nth-child(6) { animation-delay: 0.3s; }

/* Smooth gradient background transitions */
.bg-gradient-to-br {
  background-size: 150% 150%;
  transition: background-position 0.5s ease;
}

.bg-gradient-to-br:hover {
  background-position: right center;
}

/* Tag/badge hover effects */
.rounded-full {
  transition: all 0.2s ease;
}

button.rounded-full:hover,
a.rounded-full:hover:not(.bg-gray-900):not(.bg-yellow-400) {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Image overlay effects on cards */
.relative img {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.relative:hover img {
  filter: brightness(0.95);
}

/* Smooth text color transitions */
.text-gray-600,
.text-gray-700 {
  transition: color 0.2s ease;
}

/* Enhanced link underline animation */
a:hover {
  text-decoration-color: currentColor;
}

/* Form validation styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

/* Loading spinner for async actions */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Pulse animation for important elements */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive typography scaling */
@media (max-width: 640px) {
  h1 {
      font-size: 2.5rem;
      line-height: 1.1;
  }
  
  h2 {
      font-size: 2rem;
      line-height: 1.2;
  }
  
  h3 {
      font-size: 1.5rem;
      line-height: 1.3;
  }
}

/* Smooth height transitions */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

/* Glass morphism effect for overlays */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Reduced motion for accessibility */
@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;
  }
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
  /* Uncomment when implementing dark mode */
  /* body {
      background-color: #111827;
      color: #f9fafb;
  } */
}

/* Selection styling */
::selection {
  background-color: #111827;
  color: #fbbf24;
}

::-moz-selection {
  background-color: #111827;
  color: #fbbf24;
}

/* Improved mobile touch targets */
@media (max-width: 768px) {
  button,
  a {
      min-height: 44px;
      min-width: 44px;
  }
}
