/* ===========================
   Advanced Animations & Effects
   =========================== */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

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

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Slide In */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Apply Animations to Elements */
.animate-fade-up {
    animation: fadeInUp 1s ease-out;
}

.animate-fade-left {
    animation: fadeInLeft 1s ease-out;
}

.animate-fade-right {
    animation: fadeInRight 1s ease-out;
}

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

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

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

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Enhanced Hero Section with Animation */
.hero {
    background: linear-gradient(135deg, rgba(0, 43, 91, 0.9), rgba(0, 25, 54, 0.85)),
        url('../images/hero-bg.jpg') center/cover no-repeat;
    background-size: 100%;
    animation: gradientShift 15s ease infinite;
    background-size: 200% 200%;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(253, 183, 20, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

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

.hero-content h1 {
    animation: fadeInUp 1s ease-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.hero-content p {
    animation: fadeInUp 1.2s ease-out;
}

.hero-content .btn-primary {
    animation: fadeInUp 1.4s ease-out;
    position: relative;
    overflow: hidden;
}

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

.hero-content .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Animated Service Cards */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(253, 183, 20, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.service-card:hover::before {
    animation: shimmer 1.5s;
}

/* Project Card Hover Effects */
.project-card {
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.project-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

/* Blog Card Animations */
.blog-card {
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
    transform: translateY(-12px) scale(1.02);
}

.blog-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(253, 183, 20, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

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

/* Stat Counter Animation */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.1);
}

.stat-card h3 {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Hover Effects */
.btn-primary,
.btn-secondary,
.btn-quote {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.btn-primary::after,
.btn-secondary::after,
.btn-quote::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    z-index: -1;
    transition: transform 0.3s ease;
    transform: scaleX(0);
    transform-origin: left;
}

.btn-primary:hover::after,
.btn-secondary:hover::after,
.btn-quote:hover::after {
    transform: scaleX(1);
}

/* Icon Spin on Hover */
.service-icon,
.choose-icon,
.contact-info-icon,
.client-icon {
    transition: all 0.5s ease;
}

.service-card:hover .service-icon,
.choose-card:hover .choose-icon,
.contact-info-card:hover .contact-info-icon,
.client-detail-card:hover .client-icon {
    transform: rotateY(360deg) scale(1.1);
}

/* Image Zoom Effect */
.image-card img,
.project-card img,
.blog-image img {
    transition: transform 0.6s ease;
}

.image-card:hover img,
.project-card:hover img,
.blog-card:hover .blog-image img {
    transform: scale(1.15);
}

/* Text Reveal Animation */
.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s ease;
}

.section-header:hover h2::after {
    width: 100%;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(253, 183, 20, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: rotate 1s linear infinite;
}

/* Parallax Effect Preparation */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Navbar Animation on Scroll */
.header.scroll-down {
    transform: translateY(-100%);
}

.header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Social Links Hover */
.social-links a {
    position: relative;
    transition: all 0.3s ease;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(253, 183, 20, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.social-links a:hover::before {
    width: 120%;
    height: 120%;
}

/* Form Input Focus Animation */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(253, 183, 20, 0.2);
}

/* Footer Animation */
.footer-col ul li a {
    position: relative;
    transition: all 0.3s ease;
}

.footer-col ul li a::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-col ul li a:hover::before {
    left: -15px;
    opacity: 1;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s;
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

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

/* Logo Animation */
.logo h2 {
    transition: all 0.3s ease;
    position: relative;
}

.logo h2::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    overflow: hidden;
    color: var(--primary-color);
    transition: width 0.6s ease;
}

.logo:hover h2::before {
    width: 100%;
}

/* Card Flip Effect */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Glowing Border Effect */
.glow-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typewriter 4s steps(40) infinite;
}

/* Smooth Page Transition */
body.loaded {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

body {
    opacity: 0;
}

/* Skeleton Loading for Images */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}