/* ========== HEADER ANIMATIONS ========== */

/* Logo Animation */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.logo-link:hover .logo-icon {
    animation: logoFloat 2s ease-in-out infinite;
}

/* Navigation Item Hover Animation */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Button Pulse Animation */
@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 0, 0);
    }
}

.btn-quote:hover {
    animation: buttonPulse 1.5s infinite;
}

/* Mobile Menu Slide In */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.mobile-menu-container.opening {
    animation: slideInRight 0.3s ease;
}

.mobile-menu-container.closing {
    animation: slideOutRight 0.3s ease;
}

/* Overlay Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.mobile-menu-overlay.active {
    animation: fadeIn 0.3s ease;
}

.mobile-menu-overlay.closing {
    animation: fadeOut 0.3s ease;
}

/* Quick Contact Button Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.quick-contact-btn:hover {
    animation: bounce 1s ease;
}

/* Shine Effect for Buttons */
@keyframes shine {
    0% {
        background-position: -100px;
    }
    100% {
        background-position: 200px;
    }
}

.btn-quote, .btn-calculator, .announcement-cta {
    background-size: 200% 100%;
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shine 3s infinite;
}

/* Dropdown Menu Animation */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.dropdown-menu {
    animation: dropdownFadeIn 0.3s ease forwards;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1004;
    transition: width 0.1s ease;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Add ripple effect to buttons */
.btn, .nav-link, .social-link, .quick-contact-btn {
    position: relative;
    overflow: hidden;
}

.btn::after, .nav-link::after, .social-link::after, .quick-contact-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after,
.nav-link:focus:not(:active)::after,
.social-link:focus:not(:active)::after,
.quick-contact-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Load Animation for Header */
@keyframes headerLoad {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-loaded .main-navigation {
    animation: headerLoad 0.6s ease;
}

/* Staggered Animation for Menu Items */
.nav-item {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay for each nav item */
.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }
.nav-item:nth-child(6) { animation-delay: 0.6s; }
.nav-item:nth-child(7) { animation-delay: 0.7s; }
.nav-item:nth-child(8) { animation-delay: 0.8s; }

/* Parallax Effect for Header */
@media (min-width: 992px) {
    .main-navigation {
        will-change: transform;
    }
    
    .scrolled .main-navigation {
        transform: translateY(0);
    }
}

/* Glow Effect for Active Items */
.nav-link.active::before {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255, 107, 0, 0.2),
                    inset 0 0 5px rgba(255, 107, 0, 0.1);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 107, 0, 0.4),
                    inset 0 0 10px rgba(255, 107, 0, 0.2);
    }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform var(--transition-normal),
                box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Apply to various elements */
.nav-link, .btn, .social-link, .quick-action, .quick-contact-btn {
    composes: hover-lift;