/* Animated Gradient Border Component */

.gradient-border-card {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.08) 0%,
        rgba(147, 51, 234, 0.05) 100%);
    backdrop-filter: blur(20px) saturate(140%);
    border-radius: 20px;
    overflow: hidden;
}

/* Animated gradient border using pseudo-element */
.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(
        45deg,
        rgba(168, 85, 247, 0.8) 0%,
        rgba(244, 114, 182, 0.8) 25%,
        rgba(96, 165, 250, 0.8) 50%,
        rgba(168, 85, 247, 0.8) 75%,
        rgba(244, 114, 182, 0.8) 100%
    );
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Content must be positioned above pseudo-element */
.gradient-border-card > * {
    position: relative;
    z-index: 1;
}

/* Variant: Shimmer sweep effect */
.gradient-border-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(168, 85, 247, 0.8),
        rgba(244, 114, 182, 1),
        rgba(168, 85, 247, 0.8),
        transparent);
    animation: shimmerSweep 3s infinite;
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

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

/* Variant: Slower animations */
.gradient-border-slow::before {
    animation-duration: 6s;
}

.gradient-border-shimmer.gradient-border-slow::after {
    animation-duration: 5s;
}

/* Variant: Faster animations */
.gradient-border-fast::before {
    animation-duration: 2s;
}

.gradient-border-shimmer.gradient-border-fast::after {
    animation-duration: 2s;
}

/* Variant: Pulsing border (fade in/out) */
.gradient-border-pulse::before {
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Variant: Thicker border */
.gradient-border-thick::before {
    padding: 3px;
}

/* Variant: Thinner border */
.gradient-border-thin::before {
    padding: 1px;
}

/* Variant: Flowing gradient (horizontal movement) */
.gradient-border-flow::before {
    background: linear-gradient(
        90deg,
        rgba(168, 85, 247, 0.8),
        rgba(244, 114, 182, 0.8),
        rgba(96, 165, 250, 0.8),
        rgba(168, 85, 247, 0.8)
    );
    background-size: 300% 100%;
    animation: gradientFlow 4s linear infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

/* Variant: Slower flow */
.gradient-border-flow.gradient-border-slow::before {
    animation-duration: 6s;
}

/* Variant: Faster flow */
.gradient-border-flow.gradient-border-fast::before {
    animation-duration: 2s;
}

/* Variant: Glow effect with border */
.gradient-border-glow {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
    transition: box-shadow 0.3s ease;
}

.gradient-border-glow:hover {
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.4),
                0 0 80px rgba(244, 114, 182, 0.2);
}

/* Button variant */
.gradient-border-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.15) 0%,
        rgba(147, 51, 234, 0.1) 100%);
    backdrop-filter: blur(20px) saturate(140%);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.gradient-border-button::before {
    border-radius: 12px;
    padding: 2px;
}

.gradient-border-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.2) 0%,
        rgba(147, 51, 234, 0.15) 100%);
}

/* Input variant */
.gradient-border-input {
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    border: none;
    outline: none;
    width: 100%;
}

.gradient-border-input::before {
    border-radius: 12px;
    padding: 1.5px;
}

.gradient-border-input:focus::before {
    padding: 2px;
    animation-duration: 2s;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gradient-border-card {
        padding: 1.5rem;
    }

    .gradient-border-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}
