/*
 * Modern Gradient Library
 * Professional gradient utilities for backgrounds, text, buttons
 */

/* ========================================
   BACKGROUND GRADIENTS
   ======================================== */

.bg-gradient-primary {
  background: var(--gradient-primary);
  color: white;
}

.bg-gradient-accent {
  background: var(--gradient-accent);
  color: white;
}

.bg-gradient-hero {
  background: var(--gradient-hero);
  color: white;
  position: relative;
}

.bg-gradient-ocean {
  background: var(--gradient-ocean);
  color: white;
}

.bg-gradient-success {
  background: var(--gradient-success);
  color: white;
}

.bg-gradient-sunset {
  background: var(--gradient-sunset);
  color: white;
}

/* Animated gradient backgrounds */
.bg-gradient-animated {
  background: linear-gradient(
    -45deg,
    var(--color-primary-600),
    var(--color-primary-800),
    var(--color-accent-600),
    var(--color-primary-700)
  );
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

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

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

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

/* Mesh gradient backgrounds */
.bg-gradient-mesh {
  background: var(--color-neutral-900);
  background-image: var(--gradient-mesh-1);
}

.bg-gradient-mesh-light {
  background: var(--color-neutral-50);
  background-image:
    radial-gradient(at 0% 0%, rgb(14 165 233 / 10%) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgb(245 158 11 / 8%) 0, transparent 50%);
}

/* ========================================
   TEXT GRADIENTS
   ======================================== */

.text-gradient {
  background: var(--gradient-primary);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-gradient-accent {
  background: var(--gradient-accent);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-gradient-success {
  background: var(--gradient-success);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-gradient-hero {
  background: linear-gradient(135deg, #ffffff 0%, rgb(255 255 255 / 80%) 100%);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ========================================
   BUTTON GRADIENTS
   ======================================== */

.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-900) 100%);
  opacity: 0%;
  transition: opacity var(--transition-base);
}

.btn-gradient:hover::before {
  opacity: 100%;
}

.btn-gradient > * {
  position: relative;
  z-index: 1;
}

.btn-gradient-accent {
  background: var(--gradient-accent);
  color: white;
}

.btn-gradient-accent:hover {
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

/* ========================================
   BORDER GRADIENTS
   ======================================== */

.border-gradient {
  position: relative;
  background: var(--color-neutral-900);
  border-radius: var(--radius-xl);
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--gradient-primary);
  mask:
    linear-gradient(#ffffff 0 0) content-box,
    linear-gradient(#ffffff 0 0);
  mask-composite: xor;
  mask-composite: exclude;
}

.border-gradient-accent::before {
  background: var(--gradient-accent);
}

.border-gradient-animated::before {
  background: linear-gradient(
    45deg,
    var(--color-primary-500),
    var(--color-accent-500),
    var(--color-success-500),
    var(--color-primary-500)
  );
  background-size: 300% 300%;
  animation: border-gradient-rotate 4s ease infinite;
}

@keyframes border-gradient-rotate {
  0% {
    background-position: 0% 50%;
  }

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

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

/* ========================================
   CARD GRADIENTS
   ======================================== */

.card-gradient-hover {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base);
}

.card-gradient-hover::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgb(14 165 233 / 10%) 0%, transparent 70%);
  opacity: 0%;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card-gradient-hover:hover::before {
  opacity: 100%;
}

.card-gradient-hover:hover {
  transform: translateY(-4px);
}

/* ========================================
   OVERLAY GRADIENTS
   ======================================== */

.overlay-gradient-top {
  position: relative;
}

.overlay-gradient-top::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, rgb(15 23 42 / 90%) 0%, transparent 100%);
  pointer-events: none;
}

.overlay-gradient-bottom {
  position: relative;
}

.overlay-gradient-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, rgb(15 23 42 / 90%) 0%, transparent 100%);
  pointer-events: none;
}

/* ========================================
   UTILITY GRADIENTS
   ======================================== */

/* Radial gradient spotlight effect */
.gradient-spotlight {
  position: relative;
  overflow: hidden;
}

.gradient-spotlight::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgb(14 165 233 / 15%) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Diagonal split gradient */
.gradient-split {
  background: linear-gradient(
    135deg,
    var(--color-primary-900) 0%,
    var(--color-primary-900) 50%,
    var(--color-primary-800) 50%,
    var(--color-primary-800) 100%
  );
}

/* Noise texture overlay */
.gradient-noise {
  position: relative;
}

.gradient-noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 30%;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .bg-gradient-animated {
    animation-duration: 10s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-gradient-animated,
  .border-gradient-animated {
    animation: none;
  }
}
