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

body {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Touch-friendly tap targets on mobile */
@media (max-width: 768px) {
  button, a, input[type="radio"], input[type="checkbox"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Larger touch targets for mobile nav */
  nav a {
    padding: 0.75rem 0;
  }
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Progress bar animation */
.progress-bar {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quiz options */
.quiz-option {
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quiz-option:hover {
  background-color: #f3f4f6;
  border-color: #374151;
}

.quiz-option.selected {
  background-color: #1f2937;
  color: white;
  border-color: #1f2937;
}

.quiz-option input[type="radio"] {
  cursor: pointer;
}

/* Card hover effects - disabled on mobile for performance */
.card-hover {
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .card-hover: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-friendly form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  /* Prevent zoom on iOS */
  font-size: 16px;
}

/* Improve file input appearance on mobile */
input[type="file"]::file-selector-button {
  margin-right: 0.5rem;
  padding: 0.5rem 1rem;
}

@media (max-width: 640px) {
  input[type="file"] {
    font-size: 14px;
  }
}

/* Better checkbox/radio button styling */
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

/* Loading skeleton */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Error messages */
.error-message {
  animation: slideIn 0.3s ease-out;
}

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

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

/* Improve button press feedback on mobile */
button:active {
  transform: scale(0.98);
}

/* Sticky header shadow on scroll */
header.sticky {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Better text selection */
::selection {
  background-color: #1f2937;
  color: white;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}

/* Remove focus outline on mouse click but keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Improve prose readability on mobile */
.prose {
  max-width: 100%;
}

.prose p,
.prose li {
  line-height: 1.75;
}

@media (max-width: 640px) {
  .prose {
    font-size: 0.875rem;
  }
  
  .prose h1 {
    font-size: 1.5rem;
  }
  
  .prose h2 {
    font-size: 1.25rem;
  }
  
  .prose h3 {
    font-size: 1.125rem;
  }
}

/* Better spacing on mobile */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
  
  /* Reduce padding on mobile for more content space */
  .max-w-6xl,
  .max-w-4xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
}

/* Improve readability */
p, li, label {
  text-rendering: optimizeLegibility;
}

/* Smooth transitions */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  header {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
}

/* Improve button appearance */
button {
  -webkit-appearance: none;
  appearance: none;
}

/* Better form validation styling */
input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:focus):not(:placeholder-shown) {
  border-color: #10b981;
}

/* Loading states */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Improve image loading */
img {
  max-width: 100%;
  height: auto;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Mobile viewport height fix for iOS */
@supports (-webkit-touch-callout: none) {
  .min-h-screen {
    min-height: -webkit-fill-available;
  }
}

/* Prevent text size adjustment on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Better focus for keyboard navigation */
.focus-visible:focus {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}