/* ===== KEYFRAME ANIMATIONS ===== */

/* Logo Animation */
@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.logo-icon {
    animation: logoFadeIn 0.6s ease-out;
}

.logo-circle {
    animation: logoPulse 3s ease-in-out infinite;
    transform-origin: center;
}

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== APPLY ANIMATIONS TO ELEMENTS ===== */

/* Hero Section Animations */
.hero-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-slider {
    animation: fadeInRight 0.8s ease-out 0.6s both;
}

/* Section Animations (triggered by scroll) */
.section-header {
    opacity: 0;
    animation: fadeInDown 0.6s ease-out forwards;
}

.about-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.about-card:nth-child(1) {
    animation-delay: 0.1s;
}

.about-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card {
    opacity: 0;
    animation: scaleIn 0.5s ease-out forwards;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.service-card:nth-child(4) {
    animation-delay: 0.4s;
}

.service-card:nth-child(5) {
    animation-delay: 0.5s;
}

.service-card:nth-child(6) {
    animation-delay: 0.6s;
}

.project-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Hover Animations */
.about-card:hover {
    animation: bounce 0.5s ease;
}

.service-card:hover .service-icon {
    animation: bounce 0.6s ease;
}

.project-card:hover .project-icon {
    animation: rotate 0.6s ease;
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Language Switcher Animation */
.lang-btn {
    position: relative;
    overflow: hidden;
}

.lang-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.lang-btn:hover::after {
    opacity: 1;
}

/* Navigation Link Hover */
.nav-link {
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10px;
    width: 4px;
    height: 0;
    background: var(--primary);
    transform: translateY(-50%);
    transition: height 0.3s;
}

.nav-link:hover::before {
    height: 100%;
}

/* Form Input Focus Animation */
.form-group input:focus,
.form-group textarea:focus {
    animation: scaleIn 0.3s ease-out;
}

/* Slider Transition */
.slide {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.slide:not(.active) {
    transform: scale(0.95);
}

/* Loading Animation (for future use) */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Scroll Reveal Animation Class */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Gradient Animation for Backgrounds */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Mobile Menu Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Card Shine Effect on Hover */
@keyframes cardShine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.service-card::before,
.project-card::before,
.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.service-card:hover::before,
.project-card:hover::before,
.about-card:hover::before {
    left: 100%;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}