/**
 * Animations for Fruit Inventory Manager
 */

/* Fade In */
@keyframes fim-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fim-animate-fadeIn {
    animation: fim-fadeIn 0.5s ease forwards;
}

/* Slide Up */
@keyframes fim-slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fim-animate-slideUp {
    animation: fim-slideUp 0.5s ease forwards;
}

/* Slide Down */
@keyframes fim-slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fim-animate-slideDown {
    animation: fim-slideDown 0.5s ease forwards;
}

/* Slide In Bottom */
@keyframes fim-slideInBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fim-slide-in-bottom {
    animation: fim-slideInBottom 0.5s ease forwards;
}

/* Slide In Left */
@keyframes fim-slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fim-slide-in-left {
    animation: fim-slideInLeft 0.5s ease forwards;
}

/* Slide In Right */
@keyframes fim-slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fim-slide-in-right {
    animation: fim-slideInRight 0.5s ease forwards;
}

/* Scale In */
@keyframes fim-scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.fim-scale-in {
    animation: fim-scaleIn 0.5s ease forwards;
}

/* Staggered List Animation */
.fim-staggered-list > tr:nth-child(1),
.fim-staggered-list > li:nth-child(1) {
    animation-delay: 0.05s;
}

.fim-staggered-list > tr:nth-child(2),
.fim-staggered-list > li:nth-child(2) {
    animation-delay: 0.1s;
}

.fim-staggered-list > tr:nth-child(3),
.fim-staggered-list > li:nth-child(3) {
    animation-delay: 0.15s;
}

.fim-staggered-list > tr:nth-child(4),
.fim-staggered-list > li:nth-child(4) {
    animation-delay: 0.2s;
}

.fim-staggered-list > tr:nth-child(5),
.fim-staggered-list > li:nth-child(5) {
    animation-delay: 0.25s;
}

.fim-staggered-list > tr:nth-child(6),
.fim-staggered-list > li:nth-child(6) {
    animation-delay: 0.3s;
}

.fim-staggered-list > tr:nth-child(7),
.fim-staggered-list > li:nth-child(7) {
    animation-delay: 0.35s;
}

.fim-staggered-list > tr:nth-child(8),
.fim-staggered-list > li:nth-child(8) {
    animation-delay: 0.4s;
}

.fim-staggered-list > tr:nth-child(9),
.fim-staggered-list > li:nth-child(9) {
    animation-delay: 0.45s;
}

.fim-staggered-list > tr:nth-child(10),
.fim-staggered-list > li:nth-child(10) {
    animation-delay: 0.5s;
}

/* Button Animations */
.fim-btn {
    position: relative;
    overflow: hidden;
}

.fim-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.fim-btn:hover::after {
    animation: fim-ripple 1s ease-out;
}

@keyframes fim-ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Pulse Animation */
@keyframes fim-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fim-pulse {
    animation: fim-pulse 1.5s infinite;
}

/* Highlight Animation */
@keyframes fim-highlight {
    0% {
        background-color: transparent;
    }
    30% {
        background-color: rgba(255, 0, 0, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

.fim-highlight {
    animation: fim-highlight 0.8s ease;
}

/* Shake Animation */
@keyframes fim-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.fim-shake {
    animation: fim-shake 0.8s ease;
}

/* Float Animation */
@keyframes fim-float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.fim-float {
    animation: fim-float 2s infinite ease-in-out;
}

/* Hover Effects for Elements */
.fim-hover-float:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.fim-hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.fim-hover-shadow:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

/* Transition Base */
.fim-transition {
    transition: all 0.3s ease;
}

/* Modal Animations */
@keyframes fim-modalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fim-modalOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.fim-modal {
    animation: fim-modalIn 0.3s ease forwards;
}

.fim-modal.fim-modal-out {
    animation: fim-modalOut 0.3s ease forwards;
}

/* Fade In Up */
@keyframes fim-fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fim-fadeInUp {
    animation: fim-fadeInUp 0.5s ease forwards;
}

/* Fade In Down */
@keyframes fim-fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fim-fadeInDown {
    animation: fim-fadeInDown 0.5s ease forwards;
}

/* Fade In Left */
@keyframes fim-fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-20px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fim-fadeInLeft {
    animation: fim-fadeInLeft 0.5s ease forwards;
}

/* Fade In Right */
@keyframes fim-fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(20px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fim-fadeInRight {
    animation: fim-fadeInRight 0.5s ease forwards;
}

/* Button Loading Animation */
@keyframes fim-buttonLoading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.fim-btn-loading:after {
    animation: fim-buttonLoading 1s linear infinite;
}

/* Fade In with Scale */
@keyframes fim-fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fim-fadeInScale {
    animation: fim-fadeInScale 0.5s ease forwards;
}

/* Row Hover Effect */
.fim-table tr {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.fim-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Form Field Focus Effect */
.fim-form-control, 
.fim-filter-control,
.fim-table input {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.fim-form-control:focus, 
.fim-filter-control:focus,
.fim-table input:focus {
    transform: translateY(-2px);
}

/* Section Hover Animation */
.fim-section {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fim-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}