/* FrozeCloud UI Animations and Micro-interactions */

/* Page transition animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -10px, 0);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -5px, 0);
    }

    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Apply animations to page elements */
main {
    animation: fadeIn 0.5s ease-out;
}

.froze-sidebar {
    animation: slideInLeft 0.3s ease-out;
}

.navbar {
    animation: slideInRight 0.3s ease-out;
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Card hover animations */
.froze-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.froze-card:hover {
    transform: translateY(-2px);
}

/* Form focus animations */
.form-control:focus,
.form-select:focus {
    transform: scale(1.02);
}

/* Loading states */
.froze-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.froze-loading-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Error state animations */
.froze-error {
    animation: shake 0.5s ease-in-out;
}

/* Success state animations */
.froze-success {
    animation: bounce 0.6s ease-in-out;
}

/* Staggered animations for lists */
.froze-stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.froze-stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.froze-stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.froze-stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.froze-stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.froze-stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Utility animation classes */
.froze-animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.froze-animate-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.froze-animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.froze-animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

.froze-animate-bounce {
    animation: bounce 0.6s ease-in-out;
}

.froze-animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Hover effects for interactive elements */
.froze-hover-lift {
    transition: transform 0.2s ease;
}

.froze-hover-lift:hover {
    transform: translateY(-2px);
}

.froze-hover-scale {
    transition: transform 0.2s ease;
}

.froze-hover-scale:hover {
    transform: scale(1.05);
}

.froze-hover-glow {
    transition: box-shadow 0.2s ease;
}

.froze-hover-glow:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* Progress indicators */
@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.froze-progress-indeterminate {
    position: relative;
    overflow: hidden;
}

.froze-progress-indeterminate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--froze-primary), transparent);
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

/* Notification animations */
@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

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

.froze-toast-enter {
    animation: toast-slide-in 0.3s ease-out;
}

.froze-toast-exit {
    animation: toast-slide-out 0.3s ease-in;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .froze-card:hover {
        transform: none;
    }

    .froze-hover-lift:hover,
    .froze-hover-scale:hover {
        transform: none;
    }
}