/* تحسينات الأنيميشن والحركات البصرية - AL-AHMADY EXPRESS */

/* ========== Loading Animation ========== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #2360a5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.page-loader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Fallback - hide after animation if JS fails */
@keyframes loaderFadeOut {
    0% { opacity: 1; visibility: visible; }
    90% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; display: none; }
}

/* Apply animation after page load */
body.loaded .page-loader {
    animation: loaderFadeOut 0.5s ease 2.5s forwards;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Back to Top Button ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6b35 0%, #2360a5 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(35, 107, 165, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 20px rgba(35, 107, 165, 0.6);
}

/* ========== Progress Bar on Scroll ========== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35 0%, #2360a5 100%);
    z-index: 9998;
    transition: width 0.1s ease;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.5);
}

/* ========== Enhanced Fade In Animations ========== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========== Stagger Animation (for lists) ========== */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Image Hover Effects ========== */
.image-zoom {
    overflow: hidden;
    position: relative;
}

.image-zoom img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* ========== Card Floating Effect ========== */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ========== Pulse Animation ========== */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ========== Shake Animation ========== */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========== Gradient Text Animation ========== */
.gradient-text {
    background: linear-gradient(90deg, #ff6b35, #2360a5, #ff6b35);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s linear infinite;
}

@keyframes gradient {
    to { background-position: 200% center; }
}

/* ========== Typing Animation ========== */
.typing-text {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typing 3s steps(40) infinite, blink 0.75s step-end infinite;
}

@keyframes typing {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: currentColor; }
}

/* ========== Ripple Effect ========== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ========== Glow Effect ========== */
.glow {
    transition: all 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

/* ========== Parallax Effect ========== */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* ========== Smooth Scroll ========== */
html {
    scroll-behavior: smooth;
}

/* ========== Button Hover Effects ========== */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::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-animated:hover::before {
    width: 300px;
    height: 300px;
}

/* ========== Navbar Scroll Effect ========== */
.navbar-scrolled {
    background: rgba(26, 43, 60, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* ========== Hero Image Parallax ========== */
.hero-image-parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* ========== Section Reveal Animation ========== */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Counter Number Animation ========== */
.counter-animate {
    animation: countUp 2s ease-out;
}

/* ========== Image Lazy Load Fade ========== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ========== Floating Particles Background ========== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        left: 20px;
        font-size: 1.2rem;
    }
}

