/* ═══════════════════════════════════════════════════════════════════
   BonicBD User Panel — Utility Classes
   Shared helpers that complement Tailwind. Loaded after tokens.css.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 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-width: 0;
}

/* ── Visually Hidden (still focusable) ─────────────────────────────── */
.visually-hidden:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── Text Truncation ───────────────────────────────────────────────── */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* ── Focus Ring Override (brand orange) ────────────────────────────── */
.focus-ring:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Remove default outline for mouse users, keep for keyboard */
.focus-ring:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* ── Skeleton Loading ──────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-input) 25%,
        var(--bg-hover) 50%,
        var(--bg-input) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--r-xs);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-sm);
    border-radius: var(--r-xs);
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-25 { width: 25%; }

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--r-l);
}

/* ── Spinner ───────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* ── Scrollbar Hide (for horizontal scroll containers) ─────────────── */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ── Safe Area Insets (mobile notch support) ───────────────────────── */
.safe-top    { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ── Print Utilities ───────────────────────────────────────────────── */
@media print {
    .no-print { display: none !important; }
}
