/* Custom styles extending Tailwind */

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #4f46e5;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 100;
  font-weight: 600;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Smooth animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

/* Staggered animation delays */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

/* Card hover lift */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Form input styles */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  font-size: 16px;
}

.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.success {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Error message */
.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.visible {
  display: block;
}

/* Success message */
.success-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  display: none;
}

.success-banner.visible {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Cookie consent entrance */
#cookie-consent {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

#cookie-consent.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile menu transitions */
#mobile-menu {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.open {
  display: flex;
  opacity: 1;
}

/* Blog card image zoom */
.blog-card-img {
  transition: transform 0.4s ease;
}

.group:hover .blog-card-img {
  transform: scale(1.05);
}

/* Print styles */
@media print {
  header, footer, #cookie-consent, #mobile-menu {
    display: none !important;
  }

  main {
    padding-top: 0 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}

/* Reduced motion preference */
@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;
  }
}
