/* My Desktop - Animations */

/* Smooth Transitions - More specific selectors to avoid conflicts */
.desktop-icon,
.window-control,
.app-item,
.taskbar-item,
.start-button,
button,
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Window Animations */
.window {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.window.maximized {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Start Menu Animations */
.start-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: bottom left;
}

.start-menu:not([style*="display: none"]) {
    animation: startMenuSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Taskbar Animations */
.taskbar-item {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.taskbar-item:hover {
    transform: scale(1.1) !important;
}

.taskbar-item.active::after {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Desktop Icon Animations */
.desktop-icon {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.desktop-icon:hover {
    transform: scale(1.05) !important;
}

.desktop-icon:active {
    transform: scale(0.95) !important;
}

/* App Item Animations */
.app-item {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.app-item:hover {
    transform: scale(1.05) !important;
}

/* Context Menu Animations */
.context-menu {
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: top left;
}

.context-menu:not([style*="display: none"]) {
    animation: contextMenuFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Window Control Animations */
.window-control {
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.window-control:hover {
    transform: scale(1.1) !important;
}

.window-control.close:hover {
    animation: closeButtonShake 0.3s ease-in-out !important;
}

@keyframes closeButtonShake {
    0%, 100% { transform: scale(1.1); }
    25% { transform: scale(1.1) rotate(-2deg); }
    75% { transform: scale(1.1) rotate(2deg); }
}

/* Button Animations */
button, .btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button:hover, .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

button:active, .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Start Button Animations */
.start-button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.start-button:hover {
    transform: scale(1.05) !important;
    background: var(--taskbar-bg-hover) !important;
}

.start-button:active {
    transform: scale(0.95) !important;
    background: var(--taskbar-bg-active) !important;
}

/* Loading Animations */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* Slide In Animation */
.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

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

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

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

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

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

/* Scale In Animation */
.scale-in {
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 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(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(0, 120, 212, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 120, 212, 0.8);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--win10-accent); }
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-glow {
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.3);
}

/* Focus Animations */
.focus-ring {
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.3);
}

/* Notification Animations */
.notification {
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Progress Bar Animation - More specific to avoid conflicts with loading screen */
.window .progress-bar,
.taskbar .progress-bar,
.start-menu .progress-bar {
    overflow: hidden;
    position: relative;
}

.window .progress-bar::after,
.taskbar .progress-bar::after,
.start-menu .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 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;
    }
    
    .desktop-icon:hover,
    .taskbar-item:hover,
    .app-item:hover {
        transform: none;
    }
    
    .window-control:hover {
        transform: none;
    }
    
    .closeButtonShake {
        animation: none;
    }
} 