/* ========================================
   MODERN ENHANCEMENTS
   Additional polish and modern design touches
   ======================================== */

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

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #46bbe5 0%, #2d9cdb 100%);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #3aa8d1 0%, #2589c4 100%);
}

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

/* Selection styling */
::selection {
  background: rgba(70, 187, 229, 0.3);
  color: #1e293b;
}

.dark-mode ::selection {
  background: rgba(70, 187, 229, 0.5);
  color: #f3f4f6;
}

/* Focus visible for better accessibility */
*:focus-visible {
  outline: 3px solid rgba(70, 187, 229, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
  .stat-item {
    backdrop-filter: blur(15px) saturate(180%);
  }

  .cta-primary,
  .cta-secondary {
    backdrop-filter: blur(10px) saturate(160%);
  }
}

/* Image lazy loading optimization */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  .feature-card {
    border-width: 3px;
  }

  .cta-primary,
  .cta-secondary {
    border: 2px solid currentColor;
  }
}

/* Print styles */
@media print {
  .hero,
  header,
  .scroll-indicator,
  .floating-elements {
    display: none !important;
  }

  .feature-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 2px solid #000;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .feature-card:hover {
    transform: none;
  }

  .cta-primary:active,
  .cta-secondary:active {
    transform: scale(0.95);
  }

  .option-btn:active {
    transform: scale(0.97);
  }
}

/* Grid gap fallback for older browsers */
@supports not (gap: 1rem) {
  .features-grid > * {
    margin-bottom: 2.5rem;
  }

  .hero-stats > * {
    margin-right: 2.5rem;
  }
}

/* Container query support (future-proofing) */
@supports (container-type: inline-size) {
  .container {
    container-type: inline-size;
  }
}

/* Gradient text fallback */
@supports not (-webkit-background-clip: text) {
  .hero-title {
    color: #46bbe5;
    background: none;
  }

  .stat-number {
    color: #46bbe5;
    background: none;
  }
}

/* Enhanced link animations */
a {
  text-decoration-skip-ink: auto;
}

/* Better button resets */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Loading state utilities */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Utility classes for spacing */
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
.p-4 {
  padding: 2rem;
}

/* Text utilities */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.font-bold {
  font-weight: 700;
}
.font-semibold {
  font-weight: 600;
}
.font-medium {
  font-weight: 500;
}

/* Color utilities */
.text-primary {
  color: var(--primary-color);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-muted {
  color: var(--text-light);
}

/* Background utilities */
.bg-white {
  background-color: white;
}
.bg-primary {
  background-color: var(--bg-primary);
}
.bg-secondary {
  background-color: var(--bg-secondary);
}

/* Border radius utilities */
.rounded {
  border-radius: var(--radius);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}
.rounded-2xl {
  border-radius: var(--radius-2xl);
}
.rounded-full {
  border-radius: var(--radius-full);
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}
.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Visibility utilities */
.hidden {
  display: none;
}
.invisible {
  visibility: hidden;
}
.visible {
  visibility: visible;
}

/* Responsive visibility */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}
