/**
 * Frutiger Aero Animations
 * Smooth entrance animations and micro-interactions
 * @package Frutiger_Aero
 */

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

@keyframes glassShimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

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

@keyframes orbPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(100, 150, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(100, 150, 255, 0.7);
    }
}

/* Base Animation Classes */
.aero-animate {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.aero-animate.animated {
    opacity: 1;
}

/* Entrance Animations */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Delay Classes */
.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;
}

/* Micro-interactions */
.aero-hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.aero-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.aero-hover-glow {
    transition: box-shadow 0.3s ease, filter 0.3s ease;
}

.aero-hover-glow:hover {
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.5);
    filter: brightness(1.1);
}

.aero-hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Glass Shimmer Effect */
.aero-glass-shimmer {
    position: relative;
    overflow: hidden;
}

.aero-glass-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s ease;
}

.aero-glass-shimmer:hover::before {
    left: 100%;
}

/* Loading Animation */
.aero-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.aero-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(100, 150, 255, 0.3);
    border-top-color: rgba(100, 150, 255, 1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Button Press Animation */
.aero-btn,
button {
    transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.aero-btn:active,
button:active {
    transform: translateY(1px) scale(0.98);
}

/* Window Animations */
.aero-window {
    animation: windowOpen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Start Menu Animation */
.aero-start-menu.active {
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

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

/* Start Orb Pulse */
.start-orb {
    animation: orbPulse 3s ease-in-out infinite;
}

/* Widget Entrance Animation */
.widget {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.widget:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.widget:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.widget:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
.widget:nth-child(4) { animation-delay: 0.4s; opacity: 0; }

/* Post Entry Animation */
.post,
.page {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    opacity: 0;
}

article:nth-child(1) .post { animation-delay: 0.1s; }
article:nth-child(2) .post { animation-delay: 0.2s; }
article:nth-child(3) .post { animation-delay: 0.3s; }

/* Navigation Animation */
.main-navigation {
    animation: fadeInDown 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Link Hover Animation */
a {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Image Hover Animation */
img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Focus Animation */
*:focus-visible {
    outline: 2px solid #3c7fb1;
    outline-offset: 2px;
    animation: focusPulse 0.4s ease-out;
}

@keyframes focusPulse {
    0% {
        outline-color: transparent;
        outline-width: 0;
    }
    50% {
        outline-width: 4px;
    }
    100% {
        outline-width: 2px;
    }
}

/* Scroll Progress Indicator */
.aero-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #6496e0, #86c6e8, #b8ddf0);
    z-index: 99999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(100, 150, 255, 0.5);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* 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;
    }
    
    .start-orb {
        animation: none;
    }
    
    .aero-scroll-progress {
        transition: none;
    }
}

/* Page Load Animation */
body {
    animation: pageLoad 0.6s ease-out;
}

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

/* Taskbar Icon Animation */
.aero-taskbar .taskbar-icon {
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.aero-taskbar .taskbar-icon:hover {
    transform: translateY(-3px);
}

/* Comment Animation */
.comment {
    animation: fadeInLeft 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    opacity: 0;
}

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

/* Form Input Focus Animation */
input:focus,
textarea:focus,
select:focus {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Gradient Animation for Backgrounds */
.aero-gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Skeleton Loading for Images */
.aero-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltip Animation */
.aero-tooltip {
    position: relative;
}

.aero-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.aero-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Stagger Animation for Lists */
.aero-stagger > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    opacity: 0;
}

.aero-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.aero-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.aero-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.aero-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.aero-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.aero-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.aero-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.aero-stagger > *:nth-child(8) { animation-delay: 0.4s; }
.aero-stagger > *:nth-child(9) { animation-delay: 0.45s; }
.aero-stagger > *:nth-child(10) { animation-delay: 0.5s; }
