/*
 * VidPost Utilities
 * Small single-purpose helpers.
 * ------------------------------ */

/* Thumb-zone helpers */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Visually hidden (accessible) */
.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;
}

/* Text truncation */
.truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Fade in / out */
.fade-in {
    animation: fadeIn 0.2s ease forwards;
}

.fade-out {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Skeleton pulse */
.skeleton {
    background: hsl(var(--muted));
    border-radius: var(--radius);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Icon button base */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transition: background 0.15s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Icon-with-label (action stack items) */
.icon-label-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

.icon-label-btn svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

/* Count badge (for action stack) */
.count-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Token pill */
.token-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 99px;
    background: hsl(var(--vp-token-color) / 0.2);
    border: 1px solid hsl(var(--vp-token-color) / 0.4);
    color: hsl(var(--vp-token-color));
    font-size: 0.75rem;
    font-weight: 600;
}

/* Full-page centered message (empty/error states) */
.state-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    padding: 24px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.state-center h2 {
    color: hsl(var(--foreground));
    font-size: 1.1rem;
}