/* Mobile-first CSS */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 1rem 1rem;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scroll progress bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 252, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}
.preloader-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

/* Animated gradient background */
.animated-gradient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1200px 800px at 20% 10%, rgba(59, 130, 246, 0.12), transparent 50%),
        radial-gradient(1000px 700px at 80% 20%, rgba(139, 92, 246, 0.12), transparent 55%);
    animation: gradientShift 10s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes gradientShift {
    0% { filter: hue-rotate(0deg) saturate(1); }
    100% { filter: hue-rotate(20deg) saturate(1.1); }
}

/* Toasts */
#toast-container .toast {
    min-width: 240px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(10px);
    animation: toastIn 0.2s ease-out forwards;
}
#toast-container .toast-success { background: #065f46; }
#toast-container .toast-error { background: #7f1d1d; }
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }

/* Feature card hover */
.feature-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); border-color: #c7d2fe; }

/* Carousel dots */
.carousel-dot.active { background: #3b82f6 !important; }

/* Email validation */
input.is-valid { border-color: #10b981 !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important; }
input.is-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important; }

/* Dark mode overrides */
html.dark body { background-color: #0b1220; color: #e5e7eb; }
html.dark .bg-white { background-color: #0f172a !important; color: #e5e7eb; }
html.dark .bg-gray-50 { background-color: #0b1220 !important; }
html.dark .text-gray-900 { color: #e5e7eb !important; }
html.dark .text-gray-800 { color: #e5e7eb !important; }
html.dark .text-gray-700 { color: #cbd5e1 !important; }
html.dark .text-gray-600 { color: #94a3b8 !important; }
html.dark .border-gray-200 { border-color: #243143 !important; }
html.dark #preloader { background: rgba(11, 18, 32, 0.98); }
html.dark .animated-gradient-bg { filter: brightness(0.9); }
html.dark .glassmorphism { background: rgba(15, 23, 42, 0.7); border-color: rgba(255, 255, 255, 0.1); }
html.dark .carousel-dot { background: #334155 !important; }
html.dark .carousel-dot.active { background: #60a5fa !important; }

/* Map tweaks */
#map .leaflet-control-attribution { font-size: 10px; }

/* Reduced motion: progress and gradient */
@media (prefers-reduced-motion: reduce) {
  #scroll-progress { transition: none; }
  .animated-gradient-bg { animation: none; }
}

/* Hide scrollbar for snap slider */
.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Mobile glassmorphism - lighter for better readability */
.glassmorphism {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px 0 rgba(59, 130, 246, 0.1);
}

/* Optimized floating animation for mobile */
.floating {
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* Mobile-optimized typing effect */
.typing-text::after {
    content: '|';
    font-weight: 300;
    color: #3b82f6;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Mobile spinner */
.spinner {
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile confetti effect */
@keyframes confetti-explode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confetti-explode 1.5s ease-out forwards;
    z-index: 9999;
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
    .glassmorphism {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    
    .floating {
        animation: float 10s ease-in-out infinite;
    }
}

/* Touch-friendly button styles */
.touch-button {
    min-height: 48px;
    touch-action: manipulation;
}

/* Form styles */
.waitlist-form input {
    transition: all 0.2s ease;
}

.waitlist-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Success animation */
.success-bounce {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
    0% { transform: scale(0.8) rotate(-3deg); opacity: 0; }
    50% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .floating, .typing-text::after, .success-bounce {
        animation: none;
    }
}