/* ===================================
   Creative Effects & Advanced Animations
   تأثيرات إبداعية وحركات متقدمة
   =================================== */

/* ===================================
   Gradient Backgrounds - خلفيات متدرجة ديناميكية
   =================================== */

/* Animated Gradient Background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Animated Grid Pattern */
@keyframes gridFlow {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 40px 40px;
  }
}

/* ===================================
   Advanced Button Effects
   =================================== */

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transition: left 0.5s ease;
  z-index: 0;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4),
    0 0 30px rgba(168, 85, 247, 0.2);
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6),
    0 0 40px rgba(168, 85, 247, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-secondary:hover::after {
  width: 300px;
  height: 300px;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3),
    inset 0 0 20px rgba(99, 102, 241, 0.1);
}

/* ===================================
   Glowing Text Effects
   =================================== */

h1,
h2,
h3 {
  position: relative;
}

h1 {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================
   Card Hover Effects - تأثيرات عند التمرير
   =================================== */

.tool-card {
  position: relative;
  transition: all 0.3s ease;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(99, 102, 241, 0.1) 0%,
      rgba(168, 85, 247, 0.1) 50%,
      rgba(20, 184, 166, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: var(--radius-xl);
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-icon {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ===================================
   Animated Badge Pulse
   =================================== */

.tool-card-badge {
  display: inline-block;
  animation: badgePulse 2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.3));
  }

  50% {
    transform: scale(1.1) translateY(-2px);
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.6));
  }
}

/* ===================================
   Glass Card Enhancement
   =================================== */

.glass-card {
  position: relative;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.04));
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 40px rgba(99, 102, 241, 0.15);
}

.glass-card:hover::before {
  opacity: 1;
}

/* ===================================
   Input & Form Effects
   =================================== */

input,
textarea,
select {
  position: relative;
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 0 20px rgba(99, 102, 241, 0.3),
    inset 0 0 10px rgba(99, 102, 241, 0.05);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* ===================================
   Morphing Shapes & Elements
   =================================== */

/* تم إزالة الجزيئات المتحركة لإصلاح الثقل */
.particle {
  display: none;
}

/* ===================================
   Loading & Progress Animation
   =================================== */

.loading-dots span {
  animation:
    dotBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(0) translateY(0);
    opacity: 0.8;
  }

  40% {
    transform: scale(1) translateY(-10px);
    opacity: 1;
  }
}

/* ===================================
   Glow Effects
   =================================== */

.glow-effect {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8));
  }
}

/* ===================================
   Scroll Animation Effects
   =================================== */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===================================
   Animated Gradient Text
   =================================== */

.gradient-text {
  background: linear-gradient(135deg,
      var(--color-primary) 0%,
      var(--color-secondary) 50%,
      var(--color-accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

/* ===================================
   Dynamic Shadow Effects
   =================================== */

.shadow-lg {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(99, 102, 241, 0.1);
  transition: box-shadow 0.4s ease;
}

.shadow-lg:hover {
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(99, 102, 241, 0.2);
}

/* ===================================
   Blur & Backdrop Effects
   =================================== */

.blur-sm {
  backdrop-filter: blur(4px);
}

.blur-md {
  backdrop-filter: blur(12px);
}

.blur-lg {
  backdrop-filter: blur(20px);
}

/* ===================================
   3D Hover Effects
   =================================== */

.card-3d {
  perspective: 1000px;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotateX(5deg) rotateY(-5deg) scale(1.02);
}

/* ===================================
   Animated Border
   =================================== */

@keyframes borderFlow {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.animated-border {
  position: relative;
  background-clip: padding-box;
  border: 2px solid transparent;
}

.animated-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      var(--color-primary),
      var(--color-secondary),
      var(--color-accent));
  background-size: 200% 200%;
  animation: borderFlow 3s ease infinite;
  border-radius: var(--radius-lg);
  z-index: -1;
}

/* ===================================
   Responsive Creative Effects
   =================================== */

@media (max-width: 767px) {
  .tool-card:hover {
    transform: translateY(-4px);
  }

  h1 {
    font-size: 2rem;
  }

  .btn:hover {
    transform: translateY(-2px);
  }
}

/* ===================================
   Dark Mode Creative Enhancements
   =================================== */

[data-theme="dark"] {
  --glow-color: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] {
  --glow-color: rgba(99, 102, 241, 0.2);
}

[data-theme="vibrant"] {
  --glow-color: rgba(255, 0, 110, 0.3);
}

[data-theme="minimal"] {
  --glow-color: rgba(0, 0, 0, 0.1);
}

/* تم إزالة الانتقالات الشاملة لتحسين الأداء */
a,
button,
input,
select,
textarea,
.tool-card,
.glass-card {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
}

/* ===================================
   Hover State Enhancements
   =================================== */

a:hover {
  text-decoration: none;
}

a {
  text-decoration: none;
}

/* ===================================
   Micro Interactions
   =================================== */

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* ===================================
   Backdrop Blur Gradients
   =================================== */

.blur-gradient {
  background: linear-gradient(135deg,
      rgba(99, 102, 241, 0.1) 0%,
      rgba(168, 85, 247, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Spotlight Effect
   =================================== */

@keyframes spotlight {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

.spotlight {
  position: relative;
  background-size: 200% 200%;
  animation: spotlight 8s ease infinite;
}

/* ===================================
   Smooth Scroll Behavior
   =================================== */

html {
  scroll-behavior: smooth;
}

/* ===================================
   Selection Effects
   =================================== */

::selection {
  background: var(--color-primary);
  color: white;
}

::-moz-selection {
  background: var(--color-primary);
  color: white;
}