/* 
 * SpendScribe Lively Animations 
 * Sophisticated effects to bring the UI to life
 */

:root {
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

/* Badge Glow */
.glow-primary {
    box-shadow: 0 0 15px rgba(16, 35, 127, 0.2);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(16, 35, 127, 0.1); }
    50% { box-shadow: 0 0 20px rgba(16, 35, 127, 0.3); }
}

/* Page Transitions */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(16, 35, 127, 0.15);
}

.btn-press:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* Floating & Pulse */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse-subtle {
    animation: pulseSubtle 3s ease-in-out infinite;
}

/* Staggered Entry */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulseSubtle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

@keyframes wheelPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-wheel-pop {
    animation: wheelPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Glass Refinements */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 
 * Glowing Effect Styles (Shared Logic)
 */
.glowing-wrapper {
    position: relative;
    border-radius: 1.5rem;
}

.glowing-effect-container {
    --blur: 0px;
    --spread: 40;
    --start: 0;
    --active: 0;
    --glowingeffect-border-width: 3px;
    --repeating-conic-gradient-times: 5;
    --gradient: radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%),
                radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%),
                radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%), 
                radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%),
                repeating-conic-gradient(
                  from 236.84deg at 50% 50%,
                  #dd7bbb 0%,
                  #d79f1e calc(25% / var(--repeating-conic-gradient-times)),
                  #5a922c calc(50% / var(--repeating-conic-gradient-times)), 
                  #4c7894 calc(75% / var(--repeating-conic-gradient-times)),
                  #dd7bbb calc(100% / var(--repeating-conic-gradient-times))
                );
    
    pointer-events: none;
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

/* Standard Glow (Used for Cards) */
.glowing-effect-container::after {
    content: "";
    border-radius: inherit;
    position: absolute;
    inset: calc(-1 * var(--glowingeffect-border-width));
    border: var(--glowingeffect-border-width) solid transparent;
    background: var(--gradient);
    background-attachment: fixed;
    opacity: var(--active);
    transition: opacity 0.3s;
    mask-clip: padding-box, border-box;
    -webkit-mask-clip: padding-box, border-box;
    mask-composite: intersect;
    -webkit-mask-composite: destination-in;
    mask-image: linear-gradient(#0000, #0000), 
                conic-gradient(from calc((var(--start) - var(--spread)) * 1deg), #00000000 0deg, #fff, #00000000 calc(var(--spread) * 2deg));
    -webkit-mask-image: linear-gradient(#0000, #0000), 
                        conic-gradient(from calc((var(--start) - var(--spread)) * 1deg), #00000000 0deg, #fff, #00000000 calc(var(--spread) * 2deg));
}

/* 
 * Button variants
 */
.btn-glow-sophisticated {
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: #10237f !important; /* SpendScribe Primary Navy */
    color: white !important;
    border: none !important;
}

.dark .btn-glow-sophisticated {
    background: #a2db21 !important; /* SpendScribe Accent Lime */
    color: #10237f !important;
}

/* Remove the spinning layer completely from the button variant */
.btn-glow-sophisticated .glowing-effect-container {
    display: none !important;
}

/* Card Accent border */
.card-accent-border {
    position: relative;
    overflow: hidden;
}

.card-accent-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #10237f;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-accent-border:hover::after {
    opacity: 1;
}
