/* =============================================
   AL SAJAA - Premium Animation System
   ============================================= */

/* ---- Scroll Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children>* {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible>*:nth-child(1) {
    transition-delay: 0.05s;
}

.stagger-children.visible>*:nth-child(2) {
    transition-delay: 0.1s;
}

.stagger-children.visible>*:nth-child(3) {
    transition-delay: 0.15s;
}

.stagger-children.visible>*:nth-child(4) {
    transition-delay: 0.2s;
}

.stagger-children.visible>*:nth-child(5) {
    transition-delay: 0.25s;
}

.stagger-children.visible>*:nth-child(6) {
    transition-delay: 0.3s;
}

.stagger-children.visible>*:nth-child(7) {
    transition-delay: 0.35s;
}

.stagger-children.visible>*:nth-child(8) {
    transition-delay: 0.4s;
}

.stagger-children.visible>*:nth-child(9) {
    transition-delay: 0.45s;
}

.stagger-children.visible>* {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Hero Animations ---- */
@keyframes heroTextReveal {
    0% {
        opacity: 0;
        transform: translateY(50px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes heroBadgeFade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroStatsFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    animation: heroBadgeFade 0.8s 0.2s both;
}

.hero h1 {
    animation: heroTextReveal 1s 0.4s both;
}

.hero-subtitle {
    animation: heroTextReveal 1s 0.6s both;
}

.hero-buttons {
    animation: heroTextReveal 1s 0.8s both;
}

.hero-stats {
    animation: heroStatsFade 1s 1.2s both;
}

/* Parallax background */
@keyframes parallaxFloat {

    0%,
    100% {
        transform: scale(1.1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-10px);
    }
}

.hero-bg img {
    animation: parallaxFloat 15s ease-in-out infinite;
}

/* Hero floating contacts */
@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-float-contact a:nth-child(1) {
    animation: floatIn 0.6s 1.5s both;
}

.hero-float-contact a:nth-child(2) {
    animation: floatIn 0.6s 1.7s both;
}

/* ---- CTA Glow Pulse ---- */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 106, 0, 0.3);
    }

    50% {
        box-shadow: 0 4px 40px rgba(255, 106, 0, 0.6);
    }
}

.btn-primary {
    animation: glowPulse 3s ease-in-out infinite;
}

.btn-primary:hover {
    animation: none;
}

/* ---- Diagram Animation ---- */
@keyframes diagramGrow {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes diagramFloorSlide {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

.diagram-warehouse.animated .diagram-column {
    transform-origin: bottom;
    animation: diagramGrow 0.8s both;
}

.diagram-warehouse.animated .diagram-column:nth-child(4) {
    animation-delay: 0.1s;
}

.diagram-warehouse.animated .diagram-column:nth-child(5) {
    animation-delay: 0.2s;
}

.diagram-warehouse.animated .diagram-column:nth-child(6) {
    animation-delay: 0.3s;
}

.diagram-warehouse.animated .diagram-column:nth-child(7) {
    animation-delay: 0.4s;
}

.diagram-warehouse.animated .diagram-support {
    transform-origin: bottom;
    animation: diagramGrow 0.8s 0.5s both;
}

.diagram-warehouse.animated .diagram-floor {
    transform-origin: left;
    animation: diagramFloorSlide 0.6s 0.8s both;
}

.diagram-warehouse.animated .diagram-label {
    animation: heroBadgeFade 0.5s 1.2s both;
}

/* ---- Counter Animation ---- */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-animated {
    animation: countUp 0.6s both;
}

/* ---- Floating Buttons ---- */
@keyframes floatBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.float-btn {
    animation: floatBounce 3s ease-in-out infinite;
}

.float-btn:nth-child(2) {
    animation-delay: 0.5s;
}

/* ---- Shimmer Effect ---- */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.shimmer-text {
    background: linear-gradient(90deg, var(--white) 0%, var(--accent) 50%, var(--white) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}

/* ---- Gradient Border Glow ---- */
@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(0, 87, 255, 0.1);
    }

    50% {
        border-color: rgba(0, 87, 255, 0.4);
    }
}

/* ---- Loading Animation ---- */
@keyframes fadeInPage {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

body {
    animation: fadeInPage 0.6s both;
}

/* ---- 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;
    }

    .hero-bg img {
        animation: none;
        transform: scale(1.05);
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }

    .stagger-children>* {
        opacity: 1;
        transform: none;
    }
}