/* ========================================
   Mont Royale Advisory - Animations
   Subtle scroll animations for professional look
   ======================================== */

/* Initial state for scroll-animated elements */
/* Start with opacity 1 so content is visible even if JS doesn't load */
[data-scroll-animation] {
    opacity: 1;
    transform: translateY(0);
}

/* JavaScript will handle the animation from this state */
[data-scroll-animation].will-animate {
    opacity: 0;
    transform: translateY(30px);
}

/* Animated state (applied by GSAP) */
[data-scroll-animation].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Utility Animation Classes
   ======================================== */

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

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Hover Animations
   ======================================== */

/* Service Card Hover Effect */
.service-card {
    position: relative;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(193, 42, 29, 0.03) 0%, rgba(26, 58, 92, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 8px;
}

.service-card:hover::after {
    opacity: 1;
}

/* Consultant Card Image Hover */
.consultant-image {
    overflow: hidden;
}

.consultant-placeholder {
    transition: transform 0.3s ease;
}

.consultant-card:hover .consultant-placeholder {
    transform: scale(1.05);
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* ========================================
   Loading States
   ======================================== */

.form-submitting {
    position: relative;
    pointer-events: none;
}

.form-submitting::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Link Underline Animation
   ======================================== */

.nav-links a {
    position: relative;
}

.nav-links a:not(.btn-primary-nav)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-navy);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-links a:not(.btn-primary-nav):hover::after {
    width: 100%;
    left: 0;
}

/* ========================================
   Page Load Animation
   ======================================== */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    animation: slideInDown 0.5s ease forwards;
}

/* ========================================
   Smooth Transitions
   ======================================== */

/* Ensure smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it (accessibility) */
@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;
    }

    [data-scroll-animation] {
        opacity: 1;
        transform: none;
    }
}
