/* OS Animation Effects */

/* Window Animations */
.app-window {
    animation: windowOpen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: box-shadow 0.3s, transform 0.2s;
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translate(-50%, -50%);
    }
    to {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%);
    }
}

.window-closing {
    animation: windowClose 0.3s ease forwards;
}

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

/* Desktop Effects */
.desktop-icon {
    animation: iconFadeIn 0.5s ease-out backwards;
}

@keyframes iconFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Setting staggered delays for desktop icons */
.desktop-icon:nth-child(1) { animation-delay: 0.1s; }
.desktop-icon:nth-child(2) { animation-delay: 0.2s; }
.desktop-icon:nth-child(3) { animation-delay: 0.3s; }
.desktop-icon:nth-child(4) { animation-delay: 0.4s; }
.desktop-icon:nth-child(5) { animation-delay: 0.5s; }
.desktop-icon:nth-child(6) { animation-delay: 0.6s; }
.desktop-icon:nth-child(7) { animation-delay: 0.7s; }

/* Dock Animation */
.dock {
    animation: dockSlideUp 0.5s ease-out 0.8s backwards;
}

@keyframes dockSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dock-item {
    animation: dockItemBounce 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) backwards;
}

@keyframes dockItemBounce {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Setting staggered delays for dock items */
.dock-item:nth-child(1) { animation-delay: 0.9s; }
.dock-item:nth-child(2) { animation-delay: 1.0s; }
.dock-item:nth-child(3) { animation-delay: 1.1s; }
.dock-item:nth-child(4) { animation-delay: 1.2s; }
.dock-item:nth-child(5) { animation-delay: 1.3s; }

/* Top Bar Animation */
.top-bar {
    animation: topBarSlideDown 0.5s ease-out;
}

@keyframes topBarSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Animations */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::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%, -50%);
    transform-origin: 50% 50%;
}

button:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Lock Screen Animations */
.lock-screen {
    animation: fadeIn 0.5s ease;
}

.lock-content {
    animation: lockContentAppear 0.5s ease 0.2s backwards;
}

@keyframes lockContentAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Animations */
.context-menu {
    animation: scaleIn 0.2s ease-out;
    transform-origin: top left;
}

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

.context-menu-item {
    animation: slideRight 0.2s ease-out backwards;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Setting staggered delays for menu items */
.context-menu-item:nth-child(1) { animation-delay: 0.05s; }
.context-menu-item:nth-child(2) { animation-delay: 0.1s; }
.context-menu-item:nth-child(3) { animation-delay: 0.15s; }
.context-menu-item:nth-child(4) { animation-delay: 0.2s; }
.context-menu-item:nth-child(5) { animation-delay: 0.25s; }

/* Notification Animations */
.notification {
    animation: slideInRight 0.3s ease-out forwards, 
               slideOutRight 0.3s ease-in 4.7s forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(300px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

/* App Opening Animation */
.app-opening {
    animation: appBounce 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes appBounce {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
} 