/* === STAR BORDER EFFECT === */

.star-border-container {
  display: inline-block;
  position: relative;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 2px; /* Padding für den Border-Effekt */
  overflow: hidden;
  
  /* CSS Custom Properties für Konfiguration */
  --star-color: rgb(147 51 234);
  --star-size: 250%;
  --star-thickness: 50%;
  --star-speed: 4s;
  --star-opacity: 0.7;
  --star-blur: 0px;
}

.border-gradient-bottom {
  position: absolute;
  width: var(--star-size);
  height: var(--star-thickness);
  opacity: var(--star-opacity);
  bottom: -12px;
  right: calc(-1 * var(--star-size) + 100%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--star-color), transparent 10%);
  animation: star-movement-bottom var(--star-speed) linear infinite alternate;
  z-index: -1; /* Hinter dem Button */
  filter: blur(var(--star-blur));
  pointer-events: none;
}

.border-gradient-top {
  position: absolute;
  width: var(--star-size);
  height: var(--star-thickness);
  opacity: var(--star-opacity);
  top: -12px;
  left: calc(-1 * var(--star-size) + 100%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--star-color), transparent 10%);
  animation: star-movement-top var(--star-speed) linear infinite alternate;
  z-index: -1; /* Hinter dem Button */
  filter: blur(var(--star-blur));
  pointer-events: none;
}

.inner-content {
  position: relative;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgb(37 99 235);
  color: #fff;
  font-size: 16px;
  text-align: center;
  padding: 12px 24px;
  border-radius: 12px;
  z-index: 1;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inner-content:hover {
  background: rgb(29 78 216);
  color: white;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

/* Special styling for buttons on dark/colored backgrounds */
.star-border-container.on-dark .inner-content {
  background: white;
  color: #2563eb;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.star-border-container.on-dark .inner-content:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

/* Dark mode styles */
.dark .inner-content {
  background: #1f2937;
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.dark .inner-content:hover {
  background: #60a5fa;
  color: #1f2937;
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.dark .border-gradient-bottom {
  background: radial-gradient(circle, #60a5fa, transparent 10%);
}

.dark .border-gradient-top {
  background: radial-gradient(circle, #60a5fa, transparent 10%);
}

/* === ANIMATIONS === */

@keyframes star-movement-bottom {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(-100%, 0%);
    opacity: 0;
  }
}

@keyframes star-movement-top {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(100%, 0%);
    opacity: 0;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .border-gradient-bottom,
  .border-gradient-top {
    animation: none !important;
    opacity: 0.3;
  }
}

/* Size variants */
.star-border-container.star-border-sm .inner-content {
  padding: 8px 16px;
  font-size: 14px;
}

.star-border-container.star-border-lg .inner-content {
  padding: 16px 32px;
  font-size: 18px;
}

.star-border-container.star-border-xl .inner-content {
  padding: 20px 40px;
  font-size: 20px;
}

/* === KONFIGURIERBARE EFFEKT-VARIANTEN === */

/* Geschwindigkeits-Varianten */
.star-border-container.star-speed-slow {
  --star-speed: 8s;
}

.star-border-container.star-speed-fast {
  --star-speed: 3s;
}

.star-border-container.star-speed-ultra-fast {
  --star-speed: 1.5s;
}

/* Dicke-Varianten */
.star-border-container.star-thick {
  --star-thickness: 80%;
  --star-size: 350%;
}

.star-border-container.star-thin {
  --star-thickness: 30%;
  --star-size: 250%;
}

.star-border-container.star-ultra-thick {
  --star-thickness: 100%;
  --star-size: 400%;
}

/* Farb-Varianten */
.star-border-container.star-purple {
  --star-color: #8b5cf6;
}

.star-border-container.star-green {
  --star-color: #10b981;
}

.star-border-container.star-red {
  --star-color: #ef4444;
}

.star-border-container.star-orange {
  --star-color: #f59e0b;
}

.star-border-container.star-pink {
  --star-color: #ec4899;
}

.star-border-container.star-cyan {
  --star-color: #06b6d4;
}

/* Intensitäts-Varianten */
.star-border-container.star-subtle {
  --star-opacity: 0.4;
}

.star-border-container.star-intense {
  --star-opacity: 1;
}

.star-border-container.star-glow {
  --star-blur: 4px;
  --star-opacity: 0.8;
}

.star-border-container.star-sharp {
  --star-blur: 0px;
  --star-opacity: 0.9;
}

/* Kombinierte Effekte */
.star-border-container.star-rainbow {
  --star-speed: 4s;
}

.star-border-container.star-rainbow .border-gradient-bottom {
  background: radial-gradient(circle, 
    #ef4444 0%, 
    #f59e0b 25%, 
    #10b981 50%, 
    #06b6d4 75%, 
    #8b5cf6 100%, 
    transparent 10%);
}

.star-border-container.star-rainbow .border-gradient-top {
  background: radial-gradient(circle, 
    #8b5cf6 0%, 
    #06b6d4 25%, 
    #10b981 50%, 
    #f59e0b 75%, 
    #ef4444 100%, 
    transparent 10%);
}

/* JavaScript enhancement classes */
.star-border-container.enhanced:hover .border-gradient-bottom {
  animation-duration: 3s;
  opacity: 1;
}

.star-border-container.enhanced:hover .border-gradient-top {
  animation-duration: 3s;
  opacity: 1;
}

/* Pulse effect on hover */
.star-border-container.pulse:hover {
  animation: star-pulse 0.6s ease-in-out;
}

@keyframes star-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
