/* ============================================================
   Raiq - Animations & Visual Effects
   ============================================================ */

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Fade in up stagger for grids */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hero animations */
.hero-content {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-badge {
    animation: slideInRight 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero h1 {
    animation: fadeInUp 0.8s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero p {
    animation: fadeInUp 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-buttons {
    animation: fadeInUp 0.8s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Floating orbs background */
.hero-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}
.orb-1 {
    width: 400px; height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -10%; right: -5%;
    animation-delay: 0s;
}
.orb-2 {
    width: 300px; height: 300px;
    background: rgba(139, 92, 246, 0.25);
    bottom: -5%; left: -5%;
    animation-delay: -3s;
}
.orb-3 {
    width: 200px; height: 200px;
    background: rgba(6, 182, 212, 0.2);
    top: 40%; left: 30%;
    animation-delay: -5s;
}

/* Grid pattern overlay */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Enhanced card hover */
.feature-card,
.pricing-card,
.review-card,
.stat-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
}
.pricing-card:hover {
    transform: translateY(-6px);
}
.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    z-index: 2;
}
.review-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Button shine effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    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.5s ease;
}
.btn-primary:hover::after {
    left: 100%;
}

/* Logo hover — انحناء خفيف */
.logo-mark {
    display: inline-flex;
    transform-origin: center center;
    transition: transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.logo:hover .logo-mark {
    transform: rotate(-6deg) skewX(-3deg) scale(1.05);
}
.logo:hover .logo-img {
    filter: drop-shadow(0 6px 12px rgba(34, 211, 238, 0.28));
}

/* Stat counter animation */
.stat-value {
    transition: transform 0.3s ease;
}
.stat-card:hover .stat-value {
    transform: scale(1.08);
}

/* Navbar slide down */
.navbar {
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Section title underline */
.section-header h2 {
    position: relative;
    display: inline-block;
}
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
    animation: expandWidth 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes expandWidth {
    from { width: 0; }
    to { width: 60px; }
}

/* FAQ smooth open */
.faq-item {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.faq-item.active {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.faq-question span {
    transition: transform 0.3s ease;
    display: inline-block;
}
.faq-item.active .faq-question span {
    transform: rotate(45deg);
}

/* Gradient text animated */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* Glass morphism cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Auth page entrance */
.auth-card {
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dashboard stat cards */
.dash-stat {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dash-stat:nth-child(1) { animation-delay: 0.05s; }
.dash-stat:nth-child(2) { animation-delay: 0.1s; }
.dash-stat:nth-child(3) { animation-delay: 0.15s; }
.dash-stat:nth-child(4) { animation-delay: 0.2s; }

.dash-stat:hover {
    transform: translateY(-4px);
}

/* Project item hover */
.project-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.project-item:hover {
    transform: translateX(-4px);
}

/* Chat message appear */
.chat-message {
    animation: slideInRight 0.3s ease;
}

/* Loading skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Particle dots */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
