/* =====================================================
   PROFESSIONAL BACKGROUND EFFECTS
   ===================================================== */

:root {
  /* Professional Background Colors */
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --bg-accent-blue: rgba(37, 99, 235, 0.05);
  --bg-accent-orange: rgba(234, 88, 12, 0.05);
  --bg-pattern-color: rgba(255, 255, 255, 0.02);

  /* Animation Timing */
  --bg-animation-slow: 20s;
  --bg-animation-medium: 15s;
  --bg-animation-fast: 10s;
}

/* Professional Animations */
@keyframes subtleFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes gentleRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes slidePattern {
  0% {
    transform: translateX(-50px);
  }
  100% {
    transform: translateX(50px);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.05);
  }
}

/* Main Background Container */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* Gradient Overlay */
.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 80%, var(--bg-accent-blue) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--bg-accent-orange) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  animation: fadeInOut var(--bg-animation-slow) infinite;
}

/* Professional Geometric Patterns */
.curves {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.curves defs linearGradient stop:nth-child(1) {
  stop-color: rgba(37, 99, 235, 0.1);
}

.curves defs linearGradient stop:nth-child(2) {
  stop-color: rgba(37, 99, 235, 0.05);
}

.curves defs linearGradient stop:nth-child(3) {
  stop-color: rgba(37, 99, 235, 0.02);
}

.curves path:nth-child(1) {
  animation: subtleFloat var(--bg-animation-slow) infinite ease-in-out;
}

.curves path:nth-child(2) {
  animation: subtleFloat var(--bg-animation-medium) infinite ease-in-out reverse;
}

.animate-float {
  animation: subtleFloat var(--bg-animation-slow) infinite ease-in-out;
}

.animate-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3s ease-in-out infinite;
}

@keyframes drawLine {
  0% {
    stroke-dashoffset: 1000;
    opacity: 0;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: -1000;
    opacity: 0;
  }
}

/* Subtle Particle System */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.particles::before,
.particles::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  animation: floatParticle var(--bg-animation-slow) infinite linear;
}

.particles::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particles::after {
  top: 60%;
  right: 15%;
  background: rgba(234, 88, 12, 0.3);
  animation-delay: -10s;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0px) translateX(0px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0;
  }
}

/* Professional Grid Overlay */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: slidePattern var(--bg-animation-slow) infinite linear;
  opacity: 0.5;
}

/* Subtle Geometric Shapes */
.geometric-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.geometric-shapes::before {
  content: "";
  position: absolute;
  top: 10%;
  right: 10%;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  animation: gentleRotate var(--bg-animation-medium) infinite linear;
}

.geometric-shapes::after {
  content: "";
  position: absolute;
  bottom: 20%;
  left: 15%;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(234, 88, 12, 0.1);
  border-radius: 50%;
  animation: pulseGlow var(--bg-animation-fast) infinite ease-in-out;
}

/* Professional Data Flow Lines */
.data-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.data-flow::before {
  content: "";
  position: absolute;
  top: 30%;
  left: -100px;
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.3), transparent);
  animation: dataFlowHorizontal var(--bg-animation-medium) infinite linear;
}

.data-flow::after {
  content: "";
  position: absolute;
  top: -100px;
  right: 20%;
  width: 1px;
  height: 200px;
  background: linear-gradient(0deg, transparent, rgba(234, 88, 12, 0.3), transparent);
  animation: dataFlowVertical var(--bg-animation-fast) infinite linear;
  animation-delay: -5s;
}

@keyframes dataFlowHorizontal {
  0% {
    left: -200px;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes dataFlowVertical {
  0% {
    top: -200px;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Responsive Background Adjustments */
@media (max-width: 768px) {
  .animated-background {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  }

  .gradient-overlay {
    background: radial-gradient(circle at 50% 50%, var(--bg-accent-blue) 0%, transparent 70%);
  }

  .particles::before,
  .particles::after {
    display: none;
  }

  .geometric-shapes::before,
  .geometric-shapes::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .grid-overlay {
    background-size: 30px 30px;
  }

  .data-flow::before,
  .data-flow::after {
    display: none;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animated-background *,
  .animated-background::before,
  .animated-background::after {
    animation: none !important;
  }

  .gradient-overlay {
    opacity: 0.3;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .animated-background {
    background: #000000;
  }

  .gradient-overlay,
  .particles,
  .geometric-shapes,
  .data-flow {
    display: none;
  }
}

/* Professional Accent Elements */
.accent-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulseGlow var(--bg-animation-slow) infinite ease-in-out;
  pointer-events: none;
}

/* Subtle Corner Accents */
.corner-accent {
  position: absolute;
  width: 100px;
  height: 100px;
  pointer-events: none;
}

.corner-accent.top-left {
  top: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
  border-radius: 0 0 100px 0;
}

.corner-accent.bottom-right {
  bottom: 0;
  right: 0;
  background: linear-gradient(315deg, rgba(234, 88, 12, 0.1) 0%, transparent 50%);
  border-radius: 100px 0 0 0;
}

/* Professional Loading Background */
.loading-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, rgba(37, 99, 235, 0.05) 50%, transparent 70%);
  animation: loadingShimmer 2s infinite;
  opacity: 0;
  pointer-events: none;
}

.loading-background.active {
  opacity: 1;
}

@keyframes loadingShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
