/* ====================================
   ✨ MICRO-INTERACTIONS & ANIMATIONS
   Phase 3 Enhancement
   ==================================== */

/* Enhanced Button Ripple */
.fi-btn,
.filament-button,
button {
    position: relative;
    overflow: hidden;
}

.fi-btn::before,
.filament-button::before,
button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.3s;
    opacity: 0;
}

.fi-btn:active::before,
.filament-button:active::before,
button[type="submit"]:active::before {
    width: 400px;
    height: 400px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0.3s;
}

/* Click Feedback - Scale */
.fi-btn:active,
.filament-button:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* Card Entrance Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fi-section,
.fi-card,
.fi-wi-stats-overview-stat {
    animation: slideInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.fi-section:nth-child(1) {
    animation-delay: 0.05s;
}

.fi-section:nth-child(2) {
    animation-delay: 0.1s;
}

.fi-section:nth-child(3) {
    animation-delay: 0.15s;
}

.fi-section:nth-child(4) {
    animation-delay: 0.2s;
}

/* Enhanced Hover Effects */
.fi-sidebar-item-button,
.fi-sidebar-nav-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-sidebar-item-button:hover,
.fi-sidebar-nav-item:hover {
    transform: translateX(5px);
    padding-left: 1.25rem;
}

/* Loading States */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.dark .loading-shimmer {
    background: linear-gradient(90deg,
            rgba(0, 229, 255, 0) 0%,
            rgba(0, 229, 255, 0.2) 50%,
            rgba(0, 229, 255, 0) 100%);
}

/* Icon Animations */
.fi-sidebar-item-icon,
.fi-sidebar-nav-icon {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-icon,
.fi-sidebar-nav-item:hover .fi-sidebar-nav-icon {
    transform: scale(1.15) rotate(5deg);
}

/* Notification Toast Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.fi-notification,
.fi-toast {
    animation: slideInRight 0.3s ease-out;
}

.fi-notification.closing,
.fi-toast.closing {
    animation: slideOutRight 0.3s ease-in;
}

/* Progress Bar Animations */
@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.fi-progress-bar {
    transition: width 0.5s ease-out;
    animation: progressPulse 2s infinite;
}

/* Input Focus Animations */
.fi-input,
input,
textarea,
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-input:focus,
input:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
}

/* Badge Pulse */
@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 currentColor;
    }

    50% {
        box-shadow: 0 0 0 4px transparent;
    }
}

.fi-badge {
    animation: badgePulse 2s infinite;
}

/* Smooth Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.2s;
}

/* Glow on Hover for Important Elements */
.fi-btn-primary:hover {
    animation: gentleGlow 1.5s infinite alternate;
}

@keyframes gentleGlow {
    from {
        filter: brightness(1);
    }

    to {
        filter: brightness(1.1);
    }
}

/* Stats Number Count-Up Effect */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fi-wi-stats-overview-stat-value {
    animation: countUp 0.5s ease-out;
}