/**
 * Capital Business Services - AI Effects & Animations
 * تأثيرات الذكاء الاصطناعي والحركات المتقدمة
 */

/* ============================
   AI Loading Animation
   ============================ */
.ai-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A2540 0%, #00BFA5 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.ai-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.ai-spinner {
    position: relative;
    width: 100px;
    height: 100px;
}

.ai-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FFB300;
    border-radius: 50%;
    animation: aiSpin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.ai-pulse {
    position: absolute;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    background: radial-gradient(circle, rgba(255, 179, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: aiPulse 1.5s ease-in-out infinite;
}

@keyframes aiSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes aiPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.ai-loading-text {
    margin-top: 30px;
    color: white;
    font-size: 18px;
    font-weight: 500;
    animation: aiTextPulse 1.5s ease-in-out infinite;
}

@keyframes aiTextPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================
   Business Professional Patterns
   ============================ */
.business-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

.business-pattern::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(30deg, #0A2540 12%, transparent 12.5%, transparent 87%, #0A2540 87.5%, #0A2540),
        linear-gradient(150deg, #0A2540 12%, transparent 12.5%, transparent 87%, #0A2540 87.5%, #0A2540),
        linear-gradient(30deg, #0A2540 12%, transparent 12.5%, transparent 87%, #0A2540 87.5%, #0A2540),
        linear-gradient(150deg, #0A2540 12%, transparent 12.5%, transparent 87%, #0A2540 87.5%, #0A2540);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

/* ============================
   Subtle Professional Glow
   ============================ */
.ai-glow {
    position: relative;
    overflow: hidden;
}

.ai-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 191, 165, 0.02) 0%, transparent 60%);
    animation: aiGlowMove 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aiGlowMove {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10%, 10%); }
    50% { transform: translate(0, 20%); }
    75% { transform: translate(-10%, 10%); }
}

/* ============================
   AI Hover Effects
   ============================ */
.ai-hover-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.ai-hover-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.1) 0%, rgba(255, 179, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.ai-hover-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.ai-hover-card:hover::after {
    opacity: 1;
}

/* ============================
   AI Text Reveal Animation
   ============================ */
.ai-text-reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: aiTextReveal 0.8s ease forwards;
}

@keyframes aiTextReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-text-reveal-delay-1 { animation-delay: 0.1s; }
.ai-text-reveal-delay-2 { animation-delay: 0.2s; }
.ai-text-reveal-delay-3 { animation-delay: 0.3s; }
.ai-text-reveal-delay-4 { animation-delay: 0.4s; }

/* ============================
   AI Counter Animation - Professional & Beautiful
   ============================ */
.ai-counter {
    font-size: 3rem;
    font-weight: 800;
    color: #FFFFFF !important;
    display: inline-block;
    transition: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0;
    font-family: 'Poppins', sans-serif !important;
    direction: ltr !important;
    unicode-bidi: bidi-override;
}

.ai-counter.counting {
    animation: counterPulse 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes counterPulse {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.15);
        text-shadow: 0 6px 30px rgba(255, 179, 0, 0.6);
    }
    100% { transform: scale(1); }
}

/* Stats Section Enhancement - تعطيل التأثيرات المزعجة */
.stats-section .stat-item {
    transition: none;
    padding: 20px;
    border-radius: 0;
}

.stats-section .stat-item:hover {
    transform: none !important;
    background: transparent !important;
}

.stats-section .stat-item:hover .ai-counter {
    transform: none !important;
    text-shadow: 0 4px 20px rgba(255, 179, 0, 0.4);
}

.stats-section .stat-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 10px;
}

/* ============================
   AI Gradient Border
   ============================ */
.ai-gradient-border {
    position: relative;
    background: white;
    border-radius: 15px;
}

.ai-gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #0A2540, #00BFA5, #FFB300);
    border-radius: 15px;
    z-index: -1;
    animation: aiGradientRotate 3s linear infinite;
}

@keyframes aiGradientRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ============================
   AI Morphing Shapes
   ============================ */
.ai-morph-shape {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.1), rgba(255, 179, 0, 0.1));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: aiMorph 8s ease-in-out infinite;
    filter: blur(40px);
    opacity: 0.5;
}

@keyframes aiMorph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: rotate(270deg) scale(1.05);
    }
}

/* ============================
   AI Parallax Effect
   ============================ */
.ai-parallax {
    transition: transform 0.3s ease-out;
}

/* ============================
   AI Shimmer Effect
   ============================ */
.ai-shimmer {
    position: relative;
    overflow: hidden;
}

.ai-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: aiShimmer 3s infinite;
}

@keyframes aiShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ============================
   AI Typing Effect
   ============================ */
.ai-typing {
    overflow: hidden;
    border-right: 3px solid #00BFA5;
    white-space: nowrap;
    animation: aiTyping 3.5s steps(40) 1s forwards, aiBlinkCursor 0.75s step-end infinite;
    width: 0;
}

@keyframes aiTyping {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes aiBlinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: #00BFA5; }
}

/* ============================
   AI Floating Elements
   ============================ */
.ai-float {
    animation: aiFloatUpDown 3s ease-in-out infinite;
}

@keyframes aiFloatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ============================
   AI Glitch Effect
   ============================ */
.ai-glitch {
    position: relative;
}

.ai-glitch::before,
.ai-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ai-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #00BFA5;
    clip: rect(44px, 450px, 56px, 0);
    animation: aiGlitch 5s infinite linear alternate-reverse;
}

.ai-glitch::after {
    left: -2px;
    text-shadow: -2px 0 #FFB300;
    clip: rect(44px, 450px, 56px, 0);
    animation: aiGlitch 5s infinite linear alternate-reverse;
}

@keyframes aiGlitch {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    5% { clip: rect(70px, 9999px, 71px, 0); }
    10% { clip: rect(30px, 9999px, 25px, 0); }
    15% { clip: rect(90px, 9999px, 85px, 0); }
    20% { clip: rect(10px, 9999px, 40px, 0); }
    25% { clip: rect(50px, 9999px, 20px, 0); }
    30% { clip: rect(80px, 9999px, 60px, 0); }
    100% { clip: rect(70px, 9999px, 80px, 0); }
}

/* ============================
   AI Progress Bar
   ============================ */
.ai-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #0A2540, #00BFA5, #FFB300);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* ============================
   Partner Logo - Clean & Simple
   ============================ */
.partner-clickable {
    cursor: pointer !important;
    transition: all 0.3s ease;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.partner-clickable:hover {
    transform: translateY(-5px);
}

.partner-clickable:focus {
    outline: none !important;
    box-shadow: none !important;
}

.partner-logo-img {
    transition: all 0.3s ease;
}

.partner-clickable:hover .partner-logo-img {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
    transform: scale(1.05);
}

/* Modal Enhancement - NO BACKDROP */
body.modal-open {
    overflow: hidden !important;
}

/* Hide Backdrop Completely */
.modal-backdrop {
    display: none !important;
}

/* Modal - Clean & Simple */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: none !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    outline: 0 !important;
    background: transparent !important;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal Dialog */
.modal-dialog {
    position: relative !important;
    width: 90% !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: 100% !important;
}

/* Modal Content */
.modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 15px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    outline: 0 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.modal-header {
    background: linear-gradient(135deg, #0A2540 0%, #00BFA5 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 20px;
}

.modal-header .modal-title {
    color: white !important;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.modal-body {
    padding: 30px;
    background: white;
    color: #333;
}

.modal-body h6 {
    color: #0A2540;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-body p {
    color: #666;
    line-height: 1.8;
}

.modal-body .btn-primary {
    background: linear-gradient(135deg, #0A2540 0%, #00BFA5 100%);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    transition: transform 0.3s ease;
}

.modal-body .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 191, 165, 0.3);
}

/* ============================
   Responsive Adjustments
   ============================ */
@media (max-width: 768px) {
    .ai-morph-shape {
        width: 200px;
        height: 200px;
    }
    
    .ai-counter {
        font-size: 2.5rem;
    }
    
    .ai-hover-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .partner-clickable::after {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
}

