/* Animation Styles */

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide Animations */
.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in-out;
}

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

.slide-out-left {
    animation: slideOutLeft 0.3s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Scale Animations */
.scale-in {
    animation: scaleIn 0.3s ease-in-out;
}

.scale-out {
    animation: scaleOut 0.3s ease-in-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Rotation Animations */
.rotate-in {
    animation: rotateIn 0.5s ease-in-out;
}

.rotate-out {
    animation: rotateOut 0.5s ease-in-out;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

@keyframes rotateOut {
    from {
        transform: rotate(0);
        opacity: 1;
    }
    to {
        transform: rotate(180deg);
        opacity: 0;
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 1.5s infinite;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Transition Utilities */
.transition-all {
    transition: all 0.3s ease;
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

.transition-transform {
    transition: transform 0.3s ease;
}

.transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Delay Utilities */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Animation Durations */
.duration-100 {
    animation-duration: 0.1s;
}

.duration-200 {
    animation-duration: 0.2s;
}

.duration-300 {
    animation-duration: 0.3s;
}

.duration-400 {
    animation-duration: 0.4s;
}

.duration-500 {
    animation-duration: 0.5s;
}

/* Menu Animation */
@media (min-width: 992px) {
    html[data-toggled="close"] .main-menu-content span,
    html[data-toggled="close"] .main-menu-content .side-menu__angle {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    html[data-toggled="open"] .main-menu-content span,
    html[data-toggled="open"] .main-menu-content .side-menu__angle {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease 0.1s, visibility 0.3s ease 0.1s;
    }
    
    .app-sidebar {
        transition: width 0.3s ease, min-width 0.3s ease;
    }
    
    .app-content {
        transition: margin-left 0.3s ease;
    }
    
    .main-sidebar {
        transition: padding 0.3s ease;
    }
}

/* Loader Animation */
.loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    border-top-color: var(--theme-primary);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button Wave Animation */
.btn-wave::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-wave:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Custom loader animation */
.custom-loader {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 40px;
}

.custom-loader div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--theme-primary);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.custom-loader div:nth-child(1) {
    left: 8px;
    animation: custom-loader1 0.6s infinite;
}

.custom-loader div:nth-child(2) {
    left: 8px;
    animation: custom-loader2 0.6s infinite;
}

.custom-loader div:nth-child(3) {
    left: 32px;
    animation: custom-loader2 0.6s infinite;
}

.custom-loader div:nth-child(4) {
    left: 56px;
    animation: custom-loader3 0.6s infinite;
}

@keyframes custom-loader1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes custom-loader3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes custom-loader2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/* Progress animation */
.progress-bar {
    transition: width 0.5s ease;
} 