/* Background Animations */
@keyframes backgroundPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, -50px) rotate(120deg); }
    66% { transform: translate(30px, 20px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Component Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.1; }
    100% { transform: scale(1); opacity: 0.2; }
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.8s var(--ease-out-expo);
}

.fade-in-left {
    animation: fadeInLeft 0.8s var(--ease-out-expo);
}

.fade-in-right {
    animation: fadeInRight 0.8s var(--ease-out-expo);
}

.fade-in-scale {
    animation: fadeInScale 0.8s var(--ease-out-expo);
}

.slide-down {
    animation: slideDown 0.5s var(--ease-out-expo);
}

/* Stagger Animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Hover Animations */
.hover-lift:hover {
    transform: translateY(-8px);
    transition: transform 0.3s var(--ease-out-expo);
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s var(--ease-out-expo);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
    transition: box-shadow 0.3s var(--ease-out-expo);
}

/* Loading States */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    animation: loadingDots 1.4s infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scroll Triggered Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s var(--ease-out-expo);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Text Animations */
.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    width: 0;
    animation: typing 2s steps(20, end) forwards, blink-caret 0.75s step-end infinite;
    border-left: 3px solid var(--color-primary);
}

.typewriter-text.gradient-text {
    border-left-color: transparent;
    animation: typing-gradient 2s steps(15, end) 2s forwards, blink-caret-gradient 0.75s step-end infinite 2s;
}

@keyframes typing {
    from { 
        width: 0; 
    }
    to { 
        width: 100%; 
    }
}

@keyframes typing-gradient {
    from { 
        width: 0; 
        border-left: 3px solid var(--color-primary);
    }
    to { 
        width: 100%; 
        border-left: 3px solid transparent;
    }
}

@keyframes blink-caret {
    from, to { 
        border-left-color: transparent; 
    }
    50% { 
        border-left-color: var(--color-primary); 
    }
}

@keyframes blink-caret-gradient {
    from, to { 
        border-left-color: transparent; 
    }
    50% { 
        border-left-color: var(--color-primary); 
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Particle Effects */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: var(--radius-full);
    animation: particleFloat 6s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Focus Animations */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.3);
    transition: box-shadow 0.2s var(--ease-out-expo);
}

/* Progress Animations */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transform-origin: left;
    animation: progressFill 2s var(--ease-out-expo);
}

@keyframes progressFill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Notification Animations */
.notification-enter {
    animation: notificationSlideIn 0.3s var(--ease-out-expo);
}

.notification-exit {
    animation: notificationSlideOut 0.3s var(--ease-out-expo);
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Modal Animations */
.modal-backdrop {
    animation: fadeIn 0.3s var(--ease-out-expo);
}

.modal-content {
    animation: modalSlideUp 0.4s var(--ease-out-expo);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Smooth transitions for all interactive elements */
.smooth-transition {
    transition: all 0.3s var(--ease-out-expo);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-orb {
        animation: none;
    }
    
    .upload-icon {
        animation: none;
    }
    
    .pulse-dot {
        animation: none;
    }
}

/* Calm Onload Reveal — preserves existing transform */
.onload-reveal {
  opacity: 0;
  translate: 0 16px;          /* بدل transform */
  filter: blur(8px);
  will-change: opacity, filter, transform;
}

.calm-loaded .onload-reveal {
  animation: onloadFadeIn 700ms var(--ease-out-expo) var(--d, 0s) both;
}

@keyframes onloadFadeIn {
  from { opacity: 0; translate: 0 16px; filter: blur(8px); }
  to   { opacity: 1; translate: 0 0;   filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  .onload-reveal { opacity: 1 !important; translate: 0 0 !important; filter: none !important; animation: none !important; }
}

.split-hero-line {
  position: relative;
  min-height: 120px;
  text-align: right;
  margin-bottom: var(--space-8, 2rem);
  line-height: 1.7;
  overflow: hidden;
}

.split-hero-line .segment {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  filter: blur(4px);
  font-size: 1.1rem;
  font-weight: 400;
  transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0.5rem 0;
  /* إزالة جميع الخلفيات والحدود */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  /* إضافة z-index للتحكم في الطبقات */
  z-index: 0;
  /* البدء بحالة مخفية */
  visibility: hidden;
}

/* حالة الظهور - تأثير احترافي وناعم */
.split-hero-line .segment.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
  /* التأكد من عدم وجود أي خلفيات */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  /* ضمان أن العنصر في المقدمة */
  visibility: visible;
  z-index: 1;
}

/* حالة الاختفاء - تأثير هادئ */
.split-hero-line .segment.hide {
  opacity: 0;
  transform: translateY(0) scale(0.98); /* تقليل الحجم قليلاً */
  filter: blur(1px); /* ضبابية خفيفة */
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  visibility: hidden;
  z-index: -1;
}

/* إزالة جميع العناصر الزائدة ::before و ::after */
.split-hero-line .segment::before,
.split-hero-line .segment::after {
  display: none !important;
}

/* إزالة أي تأثيرات hover */
.split-hero-line .segment:hover {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: translateY(0) scale(1) !important;
}

/* ألوان وأوزان مختلفة لكل جملة - بدون خلفيات */
.split-hero-line .segment:nth-child(1) {
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.split-hero-line .segment:nth-child(2) {
  background: linear-gradient(135deg, 
    #1FDCF9 0%, 
    #6DEBFF 50%, 
    #1FC8FF 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.split-hero-line .segment:nth-child(3) {
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.015em;
}

.split-hero-line .segment:nth-child(4) {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* مؤشر التقدم الأنيق - بدون تعقيدات */
.progress-dots {
  position: absolute;
  bottom: -45px;
  right: 50%;
  transform: translateX(50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.progress-dot::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: rgba(31, 220, 249, 0.1);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.progress-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(31, 220, 249, 0.4);
}

.progress-dot.active::before {
  opacity: 1;
  transform: scale(1.2);
}

/* للأجهزة المحمولة */
@media (max-width: 768px) {
  .split-hero-line {
    min-height: 100px;
    line-height: 1.6;
  }
  
  .split-hero-line .segment {
    font-size: 1rem;
    transform: translateY(15px) scale(0.98);
  }
  
  .split-hero-line .segment:nth-child(2) {
    font-size: 1.1rem;
  }
  
  .split-hero-line .segment:nth-child(4) {
    font-size: 0.95rem;
  }
  
  .progress-dots {
    gap: 10px;
    bottom: -35px;
  }
  
  .progress-dot {
    width: 5px;
    height: 5px;
  }
}

@media (max-width: 480px) {
  .split-hero-line {
    min-height: 80px;
  }
  
  .split-hero-line .segment {
    font-size: 0.95rem;
    transform: translateY(12px) scale(0.98);
  }
  
  .split-hero-line .segment:nth-child(2) {
    font-size: 1rem;
  }
  
  .split-hero-line .segment:nth-child(4) {
    font-size: 0.9rem;
  }
}

/* تأثير الانتقالات الناعمة */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(1.02);
    filter: blur(2px);
  }
}

/* إصلاح شامل لضمان عدم ظهور أي مربعات أو خلفيات */
.split-hero-line *,
.split-hero-line *::before,
.split-hero-line *::after {
  background-image: none !important;
  border-image: none !important;
  outline: none !important;
}

/* استثناء للتدرج اللوني في النص الثاني فقط */
.split-hero-line .segment:nth-child(2) {
  background: linear-gradient(135deg, 
    #1FDCF9 0%, 
    #6DEBFF 50%, 
    #1FC8FF 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* التأكد من أن hover لا يُفسد التدرج */
.split-hero-line .segment:nth-child(2):hover,
.split-hero-line .segment:nth-child(2).show:hover {
  background: linear-gradient(135deg, 
    #6DEBFF 0%, 
    #1FDCF9 50%, 
    #66F5FF 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}


.hero-actions {
    margin-top: -20px; /* يرفع الأزرار 20px للأعلى */
}

/* أو إذا كنت تريد رفع الزر فقط */
.hero-actions .btn-primary {
    transform: translateY(-15px); /* يرفع الزر 15px للأعلى */
}

.split-hero-line {
    margin-top: 30px; /* ينزل النصوص 20px للأسفل */
}