/**
 * Motion & Interactive Enhancements
 *
 * Adds subtle motion and interactive elements to make the site more engaging
 * Focus: Parallax, floating elements, interactive hovers, smooth animations
 */

/* ============================================
   FLOATING BACKGROUND ELEMENTS
   ============================================ */

/* Subtle floating circles in background - using dedicated elements instead of body pseudo-elements */
.floating-bg-circle-1,
.floating-bg-circle-2 {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
    filter: blur(80px);
}

.floating-bg-circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(112, 141, 87, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: float-1 25s ease-in-out infinite;
}

.floating-bg-circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(79, 109, 122, 0.12) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float-2 30s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 100px) scale(1.1); }
    66% { transform: translate(50px, -50px) scale(0.9); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, -100px) scale(1.15); }
}

/* ============================================
   PARALLAX SCROLLING SECTIONS
   ============================================ */

.section {
    position: relative;
    overflow: hidden;
}

/* Add parallax data attribute to sections in HTML: data-parallax="slow" */
.section[data-parallax="slow"] {
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Decorative parallax shapes */
.section::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 155, 139, 0.08) 0%, transparent 70%);
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.section:nth-child(odd)::before {
    top: 10%;
    right: 5%;
}

.section:nth-child(even)::before {
    bottom: 10%;
    left: 5%;
}

/* ============================================
   INTERACTIVE CARD EFFECTS
   ============================================ */

.card,
.feature-card,
.service-card,
.pricing-card,
.portfolio-item {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.card:hover,
.feature-card:hover,
.service-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 8px 24px rgba(28, 35, 33, 0.12),
        0 16px 48px rgba(28, 35, 33, 0.08);
}

/* ============================================
   INTERACTIVE BUTTONS
   ============================================ */

.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 109, 122, 0.25);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 109, 122, 0.2);
}

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */

.hero-value-props-unified,
.about-hero,
.services-hero,
.portfolio-hero,
.contact-hero {
    position: relative;
    overflow: hidden;
}

/* Animated gradient overlay - DISABLED for solid white background */
/* .hero-value-props-unified::before - removed to match features section */

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Ensure content is above gradient */
.hero-value-props-unified > .container,
.about-hero > .container,
.services-hero > .container,
.portfolio-hero > .container,
.contact-hero > .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */

/* Add decorative floating particles */
@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-20px) translateX(5px);
        opacity: 0.7;
    }
}

.section::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-moss-green);
    opacity: 0.3;
    animation: particle-float 8s ease-in-out infinite;
    pointer-events: none;
}

.section:nth-child(1)::after {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.section:nth-child(2)::after {
    top: 40%;
    right: 20%;
    animation-delay: 2s;
}

.section:nth-child(3)::after {
    top: 60%;
    left: 25%;
    animation-delay: 4s;
}

/* Hide floating particles and decorative shapes on sections - they conflict with gradients */
/* Note: pricing-section::before is used for angled divider in front-page.css */
.portfolio-section::before,
.portfolio-section::after,
.pricing-section::after,
.cta-section::after,
.cta-section::before {
    display: none !important;
}

/* ============================================
   IMAGE ZOOM & PAN EFFECT
   ============================================ */

.portfolio-image-large,
.portfolio-item-large {
    overflow: hidden;
    position: relative;
}

.portfolio-image-large img {
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.portfolio-image-large:hover img {
    transform: scale(1.15);
}

/* Overlay gradient on hover */
.portfolio-image-large::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(112, 141, 87, 0.4) 0%,
        rgba(79, 109, 122, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.portfolio-image-large:hover::before {
    opacity: 1;
}

/* ============================================
   FEATURE ICON INTERACTIONS
   ============================================ */

.feature-icon,
.service-icon,
.value-icon {
    transition: all 0.3s ease;
    position: relative;
}

/* Simple glow effect - no rotation */
.feature-card:hover .feature-icon,
.service-card:hover .service-icon,
.value-card:hover .value-icon {
    filter: drop-shadow(0 4px 12px rgba(112, 141, 87, 0.3));
}

.feature-card:hover .feature-icon svg,
.service-card:hover .service-icon svg,
.value-card:hover .value-icon svg {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 8px rgba(112, 141, 87, 0.3));
}

/* ============================================
   TEXT REVEAL ANIMATIONS
   ============================================ */

/* Gradient text shimmer - DISABLED for cleaner look */
/*
.page-title,
h1 {
    background: linear-gradient(
        90deg,
        var(--color-deep-forest) 0%,
        var(--color-river-clay) 25%,
        var(--color-moss-green) 50%,
        var(--color-river-clay) 75%,
        var(--color-deep-forest) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}
*/

/* ============================================
   SMOOTH SCROLL BEHAVIOR
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* Progress bar for scroll - DISABLED */
/*
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-river-clay) 0%,
        var(--color-moss-green) 100%
    );
    width: var(--scroll-progress, 0%);
    z-index: 9999;
    transition: width 0.2s ease;
    pointer-events: none;
}
*/

/* ============================================
   TESTIMONIAL CARD INTERACTIONS
   ============================================ */

.testimonial-card,
.testimonial-slide {
    transition: all 0.5s ease;
    cursor: default;
    pointer-events: none;
}

/* No hover effects - testimonials are for viewing only */
.testimonial-card:hover,
.testimonial-slide:hover {
    transform: none;
}

/* ============================================
   PRICING CARD EFFECTS
   ============================================ */

/* Add extra padding to prevent cards from being cut off on hover */
/* Note: padding-bottom for .pricing-section is now set in front-page.css for gradient buffer */
section:has(.pricing-grid) {
    overflow: visible !important;
}

.pricing-grid {
    padding: 2rem 0 5rem 0 !important;
    overflow: visible !important;
}

.pricing-card {
    transition: all 0.4s ease;
    cursor: pointer;
    overflow: visible !important;
    margin-bottom: 2rem;
}

/* Hover effect: Make cards look like the featured card */
.pricing-card:hover {
    transform: scale(1.05) translateY(-4px);
    z-index: 2;
    box-shadow:
        0 12px 32px rgba(79, 109, 122, 0.2),
        0 20px 60px rgba(79, 109, 122, 0.15);
}

/* Featured card already has scale, so just enhance shadow on hover */
.pricing-card.featured-pricing {
    box-shadow:
        0 8px 24px rgba(79, 109, 122, 0.15),
        0 16px 48px rgba(79, 109, 122, 0.1);
}

.pricing-card.featured-pricing:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow:
        0 16px 40px rgba(112, 141, 87, 0.25),
        0 24px 70px rgba(112, 141, 87, 0.2);
}

/* ============================================
   FORM INTERACTIONS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    transform: scale(1.02);
    box-shadow:
        0 0 0 4px rgba(112, 141, 87, 0.2),
        0 8px 24px rgba(79, 109, 122, 0.2);
}

/* ============================================
   STATS NUMBER ANIMATION
   ============================================ */

.stat-card,
.stat-box-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.stat-card:hover,
.stat-box-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(28, 35, 33, 0.2);
}

.stat-card:hover .stat-number,
.stat-box-item:hover .stat-box-number {
    animation: number-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes number-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================
   UNIFIED GRADIENT ACROSS SECTIONS
   ============================================ */

/* Hero and features use mirrored gradients - defined in front-page.css */
.hero-value-props-unified {
    position: relative;
    margin: 0 !important;
}

/* Removed gradient pseudo-element - gradients now in front-page.css */

/* Section margins reset - backgrounds defined in front-page.css */
/* Note: .features-section and .portfolio-section excluded - they have specific backgrounds */
.section-compact:not(.features-section) {
    margin: 0 !important;
    background: var(--color-sand-white) !important;
    position: relative;
}

.portfolio-section {
    margin: 0 !important;
    position: relative;
}

/* Ensure sections have proper padding */
.section-compact {
    padding: var(--spacing-lg) 0 !important;
}

/* Note: padding for .portfolio-section is now set in front-page.css for gradient buffer */
.portfolio-section {
    padding-top: var(--spacing-xl);
}

.section-compact .section-header {
    margin-bottom: var(--spacing-md) !important;
}

.section-compact .section-description {
    display: none;
}

.features-grid-compact {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--spacing-md) !important;
}

.features-grid-compact .feature-card {
    padding: var(--spacing-md) !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.features-grid-compact .feature-card h3 {
    font-size: 1.25rem !important;
    margin: 0.75rem 0 0.5rem 0 !important;
}

.features-grid-compact .feature-card p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    opacity: 0.85;
}

.features-grid-compact .feature-icon {
    margin: 0 !important;
}

.features-grid-compact .feature-content {
    display: contents;
}

@media (max-width: 768px) {
    .features-grid-compact {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce motion on mobile for performance */
    .floating-bg-circle-1,
    .floating-bg-circle-2 {
        animation: none;
        opacity: 0.2;
    }

    .card:hover,
    .feature-card:hover,
    .service-card:hover {
        transform: translateY(-4px);
    }

    .pricing-card:hover {
        transform: translateY(-6px);
    }

    /* Disable parallax on mobile */
    .section[data-parallax] {
        transition: none !important;
    }
}

/* ============================================
   SUBTLE MICRO-ANIMATIONS v2.0
   Professional, polished interactions
   ============================================ */

/* --- Navigation Link Underline Effect --- */
.nav-menu a,
.primary-menu a {
    position: relative;
    overflow: hidden;
}

.nav-menu a::after,
.primary-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-moss-green);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu a:hover::after,
.primary-menu a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Button Ripple Effect --- */
.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.btn:active::before {
    opacity: 1;
    transform: scale(2.5);
    transition: transform 0s, opacity 0s;
}

/* --- Card Shine Effect on Hover --- */
.feature-card,
.pricing-card,
.portfolio-item,
.config-section {
    position: relative;
    overflow: hidden;
}

.feature-card::after,
.config-section::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    transform: rotate(25deg);
    transition: all 0.7s ease;
    pointer-events: none;
}

.feature-card:hover::after,
.config-section:hover::after {
    left: 150%;
}

/* --- Smooth Icon Pulse --- */
.value-prop-icon,
.guarantee-icon {
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.95;
    }
}

/* --- Trust Badge Subtle Float --- */
.trust-badge-item {
    animation: trust-float 4s ease-in-out infinite;
}

.trust-badge-item:nth-child(2) {
    animation-delay: 0.5s;
}

.trust-badge-item:nth-child(3) {
    animation-delay: 1s;
}

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

/* --- Staggered Card Entrance --- */
.feature-card,
.portfolio-item,
.pricing-card {
    opacity: 0;
    transform: translateY(20px);
    animation: card-entrance 0.6s ease forwards;
}

.feature-card:nth-child(1),
.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2),
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3),
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes card-entrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Slider Thumb Glow --- */
.calc-slider::-webkit-slider-thumb {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(112, 141, 87, 0);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.calc-slider:active::-webkit-slider-thumb {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(112, 141, 87, 0.2);
}

/* --- Toggle Switch Bounce --- */
.toggle-slider::before {
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- Section Header Text Reveal --- */
.section-header h2 {
    background: linear-gradient(90deg, var(--color-deep-forest) 50%, transparent 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: text-reveal 0.8s ease forwards;
    animation-play-state: paused;
}

.section-header h2.revealed {
    animation-play-state: running;
}

@keyframes text-reveal {
    to {
        background-position: 0% 0;
    }
}

/* --- Logo Hover Subtle Glow --- */
.site-logo img,
.custom-logo {
    transition: filter 0.3s ease, transform 0.3s ease;
}

.site-logo:hover img,
.site-logo:hover .custom-logo {
    filter: drop-shadow(0 2px 8px rgba(112, 141, 87, 0.3));
    transform: scale(1.02);
}

/* --- Footer Link Hover Slide --- */
.footer-links a,
.footer-nav a {
    position: relative;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-links a:hover,
.footer-nav a:hover {
    padding-left: 6px;
    color: var(--color-moss-green);
}

/* --- Social Icon Bounce --- */
.social-links a,
.social-icon {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), color 0.3s ease;
}

.social-links a:hover,
.social-icon:hover {
    transform: translateY(-4px) scale(1.1);
}

/* --- Stats Counter Highlight on Update --- */
.stat-number-compact,
.stat-number {
    transition: color 0.3s ease, transform 0.3s ease;
}

.stat-number-compact.counting,
.stat-number.counting {
    color: var(--color-moss-green);
    transform: scale(1.05);
}

/* --- CTA Button Shimmer --- */
.cta-section .btn-primary,
.calculator-cta .btn {
    background-size: 200% auto;
    transition: all 0.3s ease, background-position 0.5s ease;
}

.cta-section .btn-primary:hover,
.calculator-cta .btn:hover {
    background-position: right center;
}

/* --- Portfolio Tag Hover Pop --- */
.portfolio-tags .tag {
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.portfolio-item:hover .tag {
    transform: scale(1.05);
}

.portfolio-item:hover .tag:nth-child(1) { transition-delay: 0s; }
.portfolio-item:hover .tag:nth-child(2) { transition-delay: 0.05s; }
.portfolio-item:hover .tag:nth-child(3) { transition-delay: 0.1s; }

/* --- Smooth Focus States for Accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-moss-green);
    outline-offset: 3px;
    transition: outline-offset 0.2s ease;
}

a:focus-visible:not(:active),
button:focus-visible:not(:active) {
    outline-offset: 5px;
}

/* --- Testimonial Dot Active Transition --- */
.testimonial-dots .dot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-dots .dot:hover:not(.active) {
    background: rgba(112, 141, 87, 0.5);
    transform: scale(1.2);
}

/* --- Calculator Summary Sticky Glow --- */
.calculator-summary {
    transition: box-shadow 0.3s ease;
}

.calculator-summary:hover {
    box-shadow: 0 0 40px rgba(112, 141, 87, 0.15);
}

/* --- Hosting Option Selection Animation --- */
.hosting-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hosting-option.selected {
    animation: option-selected 0.4s ease;
}

@keyframes option-selected {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* --- Price Update Flash --- */
.price-amount {
    transition: all 0.3s ease;
}

.price-amount.updating {
    color: var(--color-moss-green);
    text-shadow: 0 0 10px rgba(112, 141, 87, 0.5);
}

/* ============================================
   MOBILE MICRO-ANIMATION ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Disable shine effects on mobile (performance) */
    .feature-card::after,
    .config-section::after {
        display: none;
    }

    /* Reduce floating animations */
    .trust-badge-item {
        animation: none;
    }

    /* Simpler card entrance */
    .feature-card,
    .portfolio-item,
    .pricing-card {
        animation-duration: 0.4s;
    }

    /* Disable text reveal animation */
    .section-header h2 {
        animation: none;
        background: none;
        -webkit-text-fill-color: inherit;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
