/* utilities.css - Animations, Accessibility, Glassmorphism FX */

/* ============================================================
   8. ANIMATIONS
   ============================================================ */

.animate-fade-in {
    animation: fadeSlideIn var(--t-spring) both;
}

.delay-1 {
    animation-delay: 0.03s;
}

.delay-2 {
    animation-delay: 0.06s;
}

.delay-3 {
    animation-delay: 0.09s;
}

.delay-4 {
    animation-delay: 0.12s;
}

.delay-5 {
    animation-delay: 0.15s;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   13. UTILITIES & ACCESSIBILITY
   ============================================================ */

.text-center {
    text-align: center;
}

.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Hidden attribute support for tab panels */
[hidden] {
    display: none !important;
}

/* ── Skip Navigation Link (Accessibility) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grad-brand);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--r-full);
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

/* ── Focus-visible for keyboard accessibility ── */
*:focus-visible {
    outline: 2px solid var(--c-pink);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── iOS focus-zoom guard: inputs under 16px auto-zoom on focus. !important so
   this wins regardless of feature-CSS load order. ── */
@media (max-width: 600px) {
    .mixer-input,
    .mixer-select,
    .gid__input,
    .gid__select,
    .sl__search,
    .rc-newcol__input,
    .rc-col__name-input,
    #nick-input,
    #nick-platform,
    #bio-textarea,
    #bio-font-select {
        font-size: 16px !important;
    }
}

/* ── Back to Top Button ── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); /* notch / home-indicator */
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--grad-brand);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 6px 28px rgba(168, 85, 247, 0.5);
    transform: translateY(-3px);
}

@media (max-width: 600px) {
    .back-to-top {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* ── Reduced Motion (Accessibility) ── */
@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;
    }
}