/* Custom Animations */
@keyframes blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(-10px, -10px) scale(1.05); }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

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

/* Scroll offset for fixed navbar (90px) */
section[id],
#home,
#features,
#download,
#faq,
#contact,
#pricing {
    scroll-margin-top: 90px;
}

/* Navbar Scroll Effect */
#navbar {
    background-color: rgba(255, 255, 255, 0);
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Navigation Links Active State */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #22c55e, #16a34a);
    transition: width 0.3s ease;
}

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

/* Button Hover Effects */
button, a {
    transition: all 0.2s ease;
}

/* Card Hover Effects */
.feature-slide {
    opacity: 1;
    transform: translateY(0);
}

/* Details/Summary Accordion */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    border-bottom: 1px solid #f3f4f6;
}

details {
    transition: all 0.3s ease;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, #22c55e, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats Counter */
.stat-card {
    opacity: 1;
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.show {
    display: block;
}

/* Hero Background Parallax */
.hero-bg {
    will-change: transform;
}

/* Focus Styles for Accessibility */
a:focus, button:focus, details:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* 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;
    }
}

/* Print Styles */
@media print {
    nav, footer, #download, #contact {
        display: none;
    }
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

/* Selection Color */
::selection {
    background-color: #22c55e;
    color: white;
}

::-moz-selection {
    background-color: #22c55e;
    color: white;
}

/* Image Loading */
img {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Utility Classes */
.text-balance {
    text-wrap: balance;
}

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

/* Mobile Sticky CTA */
@media (max-width: 768px) {
    .sticky-mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        background: white;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 40;
    }
}

/* Feature Image Placeholder */
.feature-image-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(to right, #22c55e, #16a34a);
}

.gradient-primary-soft {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* Shadow Utilities */
.shadow-glow {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.shadow-glow-hover:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

/* Transform Utilities */
.transform-gpu {
    transform: translateZ(0);
    will-change: transform;
}

/* Typography Utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Grid Patterns */
.grid-pattern {
    background-image:
        linear-gradient(to right, rgba(34, 197, 94, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(34, 197, 94, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Hero Phone Animation */
.hero-phone {
    transform: rotate(6deg) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-phone:hover {
    transform: rotate(0deg) scale(1);
}

@keyframes phoneIntro {
    0% {
        opacity: 0;
        transform: rotate(20deg) scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: rotate(6deg) scale(0.95) translateY(0);
    }
}

.hero-phone-animated {
    animation: phoneIntro 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

/* Feature Screenshot Animations */
.feature-screenshot-container {
    opacity: 0;
    transform: translateY(80px) scale(0.95) rotate(-3deg);
}

.feature-screenshot-container.animated {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Slide In Animation */
@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);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

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

/* Image Slider Styles */
.image-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-height: 80vh; /* Limit height on mobile */
    margin: 0 auto;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.slider-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.slider-slide img {
    width: 100%;
    max-width: 24rem; /* max-w-sm to match other screenshots */
    height: auto;
    max-height: 80vh; /* Prevent images from going off-screen on mobile */
    object-fit: contain;
    display: block;
}

/* Desktop - Remove height restrictions */
@media (min-width: 768px) {
    .image-slider {
        max-height: none;
    }

    .slider-slide img {
        max-height: none;
    }
}

/* Navigation Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot:hover {
    background-color: #9ca3af;
    transform: scale(1.2);
}

.slider-dot.active {
    background-color: #22c55e;
    width: 24px;
    border-radius: 4px;
}

.slider-dot:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Arrow Navigation - Always visible */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-nav:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slider-nav-prev {
    left: 10px;
}

.slider-nav-next {
    right: 10px;
}

.slider-nav svg {
    width: 20px;
    height: 20px;
    color: #374151;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .slider-nav {
        width: 32px;
        height: 32px;
    }

    .slider-nav svg {
        width: 16px;
        height: 16px;
    }
}

/* Play/Pause Button */
.slider-play-pause {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-play-pause:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.slider-play-pause:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
    opacity: 1;
}

.slider-play-pause svg {
    width: 20px;
    height: 20px;
    color: #374151;
}

@media (max-width: 640px) {
    .slider-play-pause {
        width: 32px;
        height: 32px;
        bottom: 8px;
        right: 8px;
    }

    .slider-play-pause svg {
        width: 16px;
        height: 16px;
    }
}
