/**
 * Animations
 * Modern CSS animations with reduced motion support
 */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse animation for loading or attention */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Apply animations to elements */
.header {
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.links-grid .link-category {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Stagger link categories */
.link-category:nth-child(1) {
    animation-delay: 0.1s;
}

.link-category:nth-child(2) {
    animation-delay: 0.2s;
}

.link-category:nth-child(3) {
    animation-delay: 0.3s;
}

.link-category:nth-child(4) {
    animation-delay: 0.4s;
}

/* Settings panel slide in */
.settings-panel {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shimmer effect for loading placeholder */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(58, 239, 228, 0.05) 0%,
        rgba(58, 239, 228, 0.1) 50%,
        rgba(58, 239, 228, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .header,
    .link-category {
        animation: none !important;
    }
}

/* Reduced motion via user setting */
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

html.reduced-motion .header,
html.reduced-motion .link-category {
    animation: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .link-category {
        border-width: 2px;
    }

    .category-link::before {
        width: 4px;
    }
}

/* Dark mode support (for future enhancement) */
@media (prefers-color-scheme: light) {
    /* This page is designed for dark mode,
       but you could add light mode overrides here if needed */
}
