/* ==========================================================================
   Utilities - Animations, Print Styles, Accessibility
   ========================================================================== */

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Loading shimmer */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

/* Card hover effect */
.hover-lift {
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ---------- Icon Sizes ---------- */
.icon-lg { font-size: var(--text-2xl); }
.icon-xl { font-size: var(--text-3xl); }
.icon-2xl { font-size: var(--text-4xl); }
.icon-3xl { font-size: var(--text-5xl); }
.icon-4xl { font-size: 4rem; }
.icon-5xl { font-size: 5rem; }

/* ---------- Badge Variants ---------- */
.badge-sm {
    font-size: 0.6rem;
    padding: 0.2em 0.5em;
}

/* ---------- Progress Variants ---------- */
.progress-thin {
    height: 4px;
}

.progress-xs {
    height: 2px;
}

/* ---------- Width Constraints ---------- */
.max-w-xs { max-width: 220px; }
.max-w-sm { max-width: 300px; }
.max-w-md { max-width: 400px; }
.max-w-lg { max-width: 500px; }
.max-w-xl { max-width: 600px; }

/* ---------- Dropdown Variants ---------- */
.dropdown-menu-wide {
    min-width: 300px;
}

.dropdown-menu-narrow {
    min-width: 200px;
}

/* ---------- Print Styles ---------- */
@media print {
    #top-navbar,
    #top,
    #scroll-top,
    .cookie-consent,
    footer,
    .btn,
    .notification-actions {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
        padding-top: 0;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-4);
    z-index: 9999;
    transition: top var(--transition-fast);
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: var(--gray-400);
        --border-color-strong: var(--gray-500);
    }

    .btn {
        border-width: 2px;
    }
}

/* ---------- Responsive Utilities ---------- */
@media (max-width: 575px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* Hide on mobile */
@media (max-width: 767px) {
    .d-mobile-none {
        display: none !important;
    }
}

/* Show only on mobile */
@media (min-width: 768px) {
    .d-desktop-none {
        display: none !important;
    }
}
