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

:root {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #333333;
  background-color: #ffffff;
}

#root {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* Smooth scrolling for all elements */

html {
  scroll-behavior: smooth;
}

/* Custom scrollbar - smaller on mobile */

::-webkit-scrollbar {
  width: 6px;
}

@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
  }
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8A2BE2 0%, #228B22 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #6A1FA3 0%, #1B5E20 100%);
}

/* Animation utilities */

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

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

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@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 zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Utility classes */

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

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Responsive images */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Focus styles for accessibility */

button:focus-visible,
a:focus-visible {
  outline: 2px solid #8A2BE2;
  outline-offset: 2px;
}

/* Mobile-specific optimizations */

@media (max-width: 768px) {
  /* Improve touch targets */
  button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Reduce animations on mobile for performance */
  *, *::before, *::after {
    animation-duration: 0.5s !important;
    animation-delay: 0.1s !important;
    transition-duration: 0.3s !important;
  }
  
  /* Optimize fonts for mobile */
  body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  /* Prevent zoom on input focus (iOS Safari) */
  input, select, textarea {
    font-size: 16px;
  }
  
  /* Improve scrolling performance */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* High-DPI display optimizations */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for retina displays */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Touch device optimizations */

@media (hover: none) and (pointer: coarse) {
  /* Hover states for touch devices */
  .hover-lift:hover {
    transform: none;
  }
  
  /* Larger tap targets for touch */
  button, .clickable {
    padding: 12px 16px;
  }
}

/* Reduce 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 */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
  }
}

/* iOS Safari specific fixes */

@supports (-webkit-touch-callout: none) {
  /* iOS Safari viewport fix */
  #root {
    min-height: -webkit-fill-available;
  }
  
  /* Disable callouts and selections on iOS */
  * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  /* Allow text selection for content */
  p, span, div, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    user-select: text;
  }
  
  /* Allow input selection */
  input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
  }
}

/* Performance optimizations */

.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Smooth scrolling with better performance */

.smooth-scroll {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Print styles */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  /* Hide non-essential elements */
  .no-print {
    display: none !important;
  }
}
