@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Custom CSS variables and base styles */
:root {
  --background: 0 0% 100%;
  --foreground: 220 20% 10%;
  --card: 0 0% 100%;
  --card-foreground: 220 20% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 220 20% 10%;
  --primary: 1 97% 44%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 96%;
  --secondary-foreground: 220 20% 10%;
  --muted: 0 0% 96%;
  --muted-foreground: 220 10% 46%;
  --accent: 0 0% 96%;
  --accent-foreground: 220 20% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 100%;
  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --ring: 1 97% 44%;
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Utility classes */
.card-shadow {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.fade-out {
  animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.25s ease-out;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced hover effects for better visibility */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgb(239 68 68 / 0.3);
}

/* Enhanced animation classes */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.pulse-once {
  animation: pulse 0.6s ease-in-out;
}

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

/* Loading and interaction states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgb(239 68 68);
  outline-offset: 2px;
}

/* Enhanced button interactions */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::before,
.btn-secondary:active::before {
  width: 300px;
  height: 300px;
}

/* Card entrance animations */
.card-animate {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-animate.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Staggered animations */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile menu enhancements */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Enhanced mobile menu animations */
#mobile-menu {
  transform-origin: top;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.animate-slide-down {
  animation: mobileMenuSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.animate-slide-up {
  animation: mobileMenuSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mobileMenuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobileMenuSlideUp {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* Better touch targets for mobile */
#mobile-menu a {
  min-height: 44px;
  touch-action: manipulation;
}

/* Hamburger menu improvements */
#mobile-menu-button {
  touch-action: manipulation;
  user-select: none;
}

#mobile-menu-button:active {
  transform: scale(0.95);
}

/* Mobile menu link hover effects */
#mobile-menu a:hover {
  transform: translateX(4px);
}

#mobile-menu a:active {
  transform: translateX(2px) scale(0.98);
}

/* Force dark text for mobile menu inactive items */
#mobile-menu a:not([href="/waitlist"]) {
  color: #374151 !important;
}

#mobile-menu a:not([href="/waitlist"]).bg-red-600 {
  color: white !important;
}

/* Additional override for inactive menu items */
#mobile-menu a.text-gray-800 {
  color: #374151 !important;
}

#mobile-menu a.text-gray-800:hover {
  color: #111827 !important;
}

/* Form input enhancements */
.form-input:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.form-input:hover:not(:focus) {
  border-color: rgb(239 68 68);
}

/* Counter animations */
.counter {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.counter.counting {
  transform: scale(1.1);
  color: rgb(239 68 68);
}

/* Scroll indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, rgb(239 68 68), rgb(249 115 115));
  transition: width 0.3s ease;
  z-index: 9999;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* 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;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Custom button styles — use low-specificity defaults so Tailwind classes can override */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgb(239 68 68 / 0.4);
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgb(0 0 0 / 0.2);
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* Loading spinner */
.spinner {
  border: 2px solid hsl(var(--muted));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

/* Toast notification styles */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-color: hsl(142 76% 36%);
  background-color: hsl(142 76% 96%);
}

.toast.error {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.1);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  /* Stack hero buttons vertically on very small screens */
  .flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .flex-wrap > a {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }

  .mobile-full {
    width: 100%;
  }

  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* Improve card padding on mobile */
  .rounded-xl {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Mobile menu specific improvements */
  #mobile-menu {
    margin: 0 -1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  #mobile-menu a {
    font-size: 16px !important;
    line-height: 1.5;
  }

  /* Ensure proper spacing on small screens */
  .mobile-menu-spacing {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Container constraints for large screens */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  max-width: 1280px;
}

/* Section spacing */
section {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

/* Typography responsiveness - handled via Tailwind classes in HTML */


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

::-webkit-scrollbar-track {
  background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--foreground));
}

/* Additional hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 30px -10px rgb(0 0 0 / 0.15);
}

.link-hover {
  position: relative;
  transition: color 0.3s ease;
}

.link-hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: rgb(239 68 68);
  transition: width 0.3s ease;
}

.link-hover:hover::after {
  width: 100%;
}

.icon-container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-container:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 16px -4px rgb(239 68 68 / 0.2);
}
