/* Custom styles to complement Tailwind CSS */

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

/* Custom focus styles for better accessibility */
*:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Enhanced transitions for theme switching */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

/* Custom gradient animations */
@keyframes gradient-x {
  0%, 100% {
    transform: translateX(0%);
  }
  50% {
    transform: translateX(100%);
  }
}

/* Hero section gradient animation */
.hero-gradient {
  background: linear-gradient(-45deg, #e0f2fe, #f0f9ff, #ddd6fe, #e0e7ff);
  background-size: 400% 400%;
  animation: gradient-x 15s ease infinite;
}

/* Subtle hover effects for cards */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Dark mode card hover effects */
.dark .card-hover:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

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

/* Form field enhancements */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Button press animation */
button {
  transition: transform 0.1s ease;
}

button:active {
  transform: scale(0.98);
}

/* FAQ accordion animation */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.open {
  max-height: 200px;
  padding-bottom: 1.5rem;
}

/* Mobile menu animation */
#mobile-menu {
  transition: all 0.3s ease;
}

/* Back to top button animation */
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top {
  transform: translateY(10px);
}

/* Loading states for form submission */
.form-loading {
  opacity: 0.7;
  pointer-events: none;
}

.form-loading button {
  position: relative;
}

.form-loading button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Copy feedback animation */
.copy-feedback {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Responsive typography improvements */
@media (max-width: 640px) {
  h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  
  h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

/* Print styles */
@media print {
  .fixed,
  nav,
  button,
  #back-to-top {
    display: none !important;
  }
  
  * {
    background: white !important;
    color: black !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bg-primary-50 {
    background-color: #ffffff !important;
  }
  
  .text-gray-600 {
    color: #000000 !important;
  }
  
  .border-gray-200 {
    border-color: #000000 !important;
  }
}

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