/**
 * Glänne & Söner - Enhancement Styles
 * Animations, transitions, and responsive improvements
 */

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.animate-ready {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-ready.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-child {
    transition-delay: 0s;
}

/* Fade in from different directions */
.fade-up { transform: translateY(40px); }
.fade-down { transform: translateY(-40px); }
.fade-left { transform: translateX(40px); }
.fade-right { transform: translateX(-40px); }

.fade-up.animate-in,
.fade-down.animate-in,
.fade-left.animate-in,
.fade-right.animate-in {
    transform: translate(0);
}

/* ============================================
   BUTTON HOVER EFFECTS
   ============================================ */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.service-card,
.project-card,
.feature-card,
.testimonial-card,
.ai-card,
.review-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover,
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.service-card img,
.project-card img {
    transition: transform 0.4s ease;
}

.service-card:hover img,
.project-card:hover img {
    transform: scale(1.05);
}

/* ============================================
   NAVBAR SCROLL EFFECT
   ============================================ */
.navbar {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PARALLAX HERO
   ============================================ */
.hero,
.page-hero {
    background-attachment: scroll; /* Changed for mobile compatibility */
    will-change: background-position;
}

@media (min-width: 769px) {
    .hero,
    .page-hero {
        background-attachment: fixed;
    }
}

/* ============================================
   RESPONSIVE IMPROVEMENTS - TABLET (768-1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    .hero-content h1 {
        font-size: 2.6rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .ai-team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-menu {
        gap: 16px;
    }

    .nav-menu a {
        font-size: 0.85rem;
    }

    .featured-grid {
        grid-template-columns: 220px 1fr;
        gap: 40px;
    }
}

/* ============================================
   TOUCH TARGETS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        padding: 16px 32px;
        font-size: 1rem;
    }

    .nav-menu a {
        padding: 12px 16px;
        display: block;
    }

    .nav-cta {
        padding: 14px 24px !important;
        text-align: center;
        width: 100%;
    }

    /* Better spacing for touch */
    .service-card,
    .project-card {
        margin-bottom: 16px;
    }

    .footer a {
        padding: 8px 0;
        display: inline-block;
    }

    /* Disable hover effects on touch */
    .touch-device .service-card:hover,
    .touch-device .project-card:hover {
        transform: none;
    }

    .touch-device .btn:hover {
        transform: none;
    }
}

/* ============================================
   LINK HOVER EFFECTS
   ============================================ */
.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold, #C9A227);
    transition: width 0.3s ease;
}

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

/* Project link arrow animation */
.project-link {
    transition: gap 0.2s ease;
}

.project-card:hover .project-link {
    gap: 10px;
}

/* ============================================
   IMAGE LOADING ANIMATION
   ============================================ */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Removed problematic lazy loading opacity rule that caused images to fade out */

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
a:focus,
button:focus,
.btn:focus {
    outline: 2px solid var(--gold, #C9A227);
    outline-offset: 2px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-ready {
        opacity: 1;
        transform: none;
    }
}
