/* =================================
   ANIMATIONS - GLOBAL ANIMATION STYLES
   ================================= */

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

@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); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Delays */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1s; }

/* Section Animations */
.section-header {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out 0.3s forwards;
}

/* Card Hover Effects */
.service-card,
.testimonial-card,
.portfolio-card,
.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover,
.testimonial-card:hover,
.portfolio-card:hover,
.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
}

/* Navbar Animation */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent, #f4c10f);
    transition: width 0.3s ease;
}

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

/* =================================
   HERO SECTION ANIMATIONS
   ================================= */

/* Dynamic Gradient Background */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #1a1a1a; /* Dark text for better contrast */
}

/* Hero Content Container */
.hero-content {
    position: relative;
    z-index: 2;
}

/* Text Typing Animation */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #f4c10f;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #f4c10f; }
}

/* Split Text Reveal */
.split-text {
    display: inline-block;
    overflow: hidden;
}

.split-text span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Image Reveal */
.hero-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transform: scale(0.9);
    opacity: 0;
    animation: zoomIn 1s 0.8s forwards;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes zoomIn {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Staggered Text Animation */
.hero-title {
    overflow: hidden;
    color: #497EE6 !important; /* Changed to match the brand blue */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* Ensure the word class maintains the blue color */
.hero-title .word {
    color: #497EE6 !important;
}

.hero-subtitle {
    color: #2d3748;
    max-width: 600px;
    margin: 1.5rem auto 2rem;
    line-height: 1.7;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.hero-title .line {
    display: inline-block;
    overflow: hidden;
}

.hero-title .word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: slideUpWord 0.8s forwards;
}

@keyframes slideUpWord {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Button Styles */
.hero-buttons .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-buttons .btn.btn-accent {
    background-color: #1e3f66;
    color: #ffffff;
    border: 2px solid #1e3f66;
}

.hero-buttons .btn.btn-outline {
    background-color: transparent;
    color: #1e3f66;
    border: 2px solid #1e3f66;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hero-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(30, 63, 102, 0.1);
    transition: all 0.5s ease;
    z-index: -1;
}

.hero-buttons .btn:hover::before {
    left: 0;
}

/* Subtle overlay for depth */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.7) 0%, rgba(233, 236, 239, 0.7) 100%);
    z-index: 1;
}

.hero > .container {
    position: relative;
    z-index: 2;
}

/* Service Icons */
.service-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Testimonial Cards */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Portfolio Items */
.portfolio-card {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.portfolio-card.visible {
    opacity: 1;
    transform: scale(1);
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--color-accent, #f4c10f);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title {
        animation: fadeIn 0.8s ease-out forwards;
    }
    
    .animate-slide-left,
    .animate-slide-right {
        animation: fadeIn 0.8s ease-out forwards;
    }
}
