/**
 * AMHBM Animations CSS
 * Inspired by miraclestudio.design animations
 */

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

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

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

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

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

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

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
    opacity: 0;
}

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

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

/* Intersection Observer Animation Support */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.fade-up {
    transform: translateY(30px);
}

.animate-on-scroll.fade-down {
    transform: translateY(-30px);
}

.animate-on-scroll.fade-left {
    transform: translateX(-30px);
}

.animate-on-scroll.fade-right {
    transform: translateX(30px);
}

/* Stagger Animation Delays */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Hero Section Animations */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-title {
    animation: slideInLeft 1s ease-out 0.2s backwards;
}

.hero-subtitle {
    animation: slideInRight 1s ease-out 0.4s backwards;
}

.hero-button {
    animation: scaleIn 0.8s ease-out 0.6s backwards;
}

/* Shape Animations (like miraclestudio.design) */
.shape-1,
.shape-2 {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

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

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::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;
}

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

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

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        width: 0%;
    }
}

.progress-bar {
    animation: progress 2s ease-out forwards;
}

/* Text Reveal Animation */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease-out forwards;
}

/* RTL Support for Animations */
.rtl .animate-slide-left {
    animation: slideInRight 0.8s ease-out forwards;
}

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

/* Service Card Animations */
.service-item-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(127, 176, 105, 0.15);
}

.service-item-card .service-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Featured Service Card Animations */
.featured-service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.featured-service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.featured-service-card:hover::before {
    left: 100%;
}

.featured-service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(127, 176, 105, 0.2);
}

/* Section Title Animations */
.section-title {
    animation: slideInLeft 0.8s ease-out;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #7fb069);
    animation: slideInLeft 0.8s ease-out 0.2s forwards;
}

/* Project Card Animations */
.project-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-image-container {
    overflow: hidden;
    border-radius: 8px;
}

.project-image {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image {
    transform: scale(1.08);
}

/* Stagger Animation for Grid Items */
.services-grid > .animate-on-scroll:nth-child(1) {
    animation-delay: 0.1s;
}

.services-grid > .animate-on-scroll:nth-child(2) {
    animation-delay: 0.2s;
}

.services-grid > .animate-on-scroll:nth-child(3) {
    animation-delay: 0.3s;
}

.services-grid > .animate-on-scroll:nth-child(4) {
    animation-delay: 0.4s;
}

.services-grid > .animate-on-scroll:nth-child(5) {
    animation-delay: 0.5s;
}

.services-grid > .animate-on-scroll:nth-child(6) {
    animation-delay: 0.6s;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
    
    .shape-1,
    .shape-2 {
        display: none;
    }
    
    .service-item-card:hover {
        transform: translateY(-4px);
    }
    
    .featured-service-card:hover {
        transform: translateY(-6px);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

