/* ============================================
   HAFIZ DEVELOPERS - Animations
   ============================================ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes sphereRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
    25% { transform: translate(10px, -20px) rotate(90deg); opacity: 0.6; }
    50% { transform: translate(-5px, -40px) rotate(180deg); opacity: 0.3; }
    75% { transform: translate(-15px, -20px) rotate(270deg); opacity: 0.6; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(var(--primary-rgb), 0.2); }
    50% { box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5); }
}

/* AOS-like scroll animations */
[data-aos] {
    opacity: 0;
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), clip-path 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-left"] { transform: translateX(-30px); }
[data-aos="fade-right"] { transform: translateX(30px); }
[data-aos="zoom-in"] { transform: scale(0.9); }
[data-aos="scale-in"] { transform: scale(0.92); }
[data-aos="clip-up"] { clip-path: inset(100% 0 0 0); transform: none; }
[data-aos="flip-left"] { transform: perspective(600px) rotateY(-15deg); }

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1) perspective(600px) rotateY(0);
    clip-path: inset(0 0 0 0);
}

/* Particle styles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat var(--duration, 8s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

/* 3D card tilt effect */
.service-card,
.portfolio-card,
.why-card,
.industry-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Hero 3D sphere animation removed - using phone mockup */

/* Shimmer loading effect */
.shimmer {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* Hover glow effect */
.glow-on-hover {
    transition: box-shadow 0.3s;
}

.glow-on-hover:hover {
    animation: borderGlow 2s ease-in-out infinite;
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: fadeInUp 0.6s ease forwards;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeInUp 0.5s ease;
}

/* Counter animation */
.stat-number.counting {
    transition: none;
}

/* Portfolio card 3D hover */
.portfolio-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
}

.portfolio-card:hover {
    transform: translateY(-8px) rotateX(2deg);
}

/* Process step line animation */
.process-step .step-content {
    transition: transform 0.3s, box-shadow 0.3s;
}

.process-step:hover .step-content {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

/* Navbar link - no extra underline animation */

/* Button ripple effect */
.btn-primary:active {
    transform: scale(0.97);
}

/* Modal entrance */
.modal.active .modal-content {
    animation: zoomIn 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
