/**
 * ============================================================
 * COMMISSARYOS — SKELETON CSS PRIMITIVES (css/skeleton.css)
 * ============================================================
 * Universal, DRY, Dynamic & Modular Skeleton Design System across
 * 100% of CommissaryOS Surfaces:
 * - Admin Console & Platform Admin Hub
 * - Production & Timeclock Terminals
 * - Kitchen Line Displays (KDS) & 4K Digital Signage Fleet
 * - Customer Storefront & Multi-Tenant Portals
 *
 * Rules: Strict Theme Token Compliance, Zero Hex Literals,
 * 5-Step Type Scale (11/12.5/15/20/28px), 4/8/12/16/24/32px Spacing.
 */

:root {
    --sk-bg: rgba(var(--rgb-border, 51 65 85), 0.35);
    --sk-shimmer: rgba(255, 255, 255, 0.16);
}

html[data-theme="clean_light"] {
    --sk-bg: rgba(var(--rgb-border, 203 213 225), 0.6);
    --sk-shimmer: rgba(255, 255, 255, 0.7);
}

html[data-theme="high_contrast"] {
    --sk-bg: rgba(255, 255, 255, 0.25);
    --sk-shimmer: rgba(255, 255, 255, 0.6);
}

/* Storefront Design System Override (Rule 14) */
[data-theme-surface="customer"],
.storefront-body,
#storefront-preview {
    --sk-bg: var(--sf-bg-alt, rgba(125, 125, 125, 0.16));
    --sk-shimmer: var(--sf-card-border, rgba(255, 255, 255, 0.16));
}

/* Back of House / KDS High-Contrast TV Displays */
[data-theme-surface="back_of_house"],
.kds-body {
    --sk-bg: rgba(var(--rgb-border, 51 65 85), 0.55);
    --sk-shimmer: rgba(255, 255, 255, 0.2);
}

/* Universal Initial Paint FOUC Prevention */
[hidden],
[data-style*="display:none"],
.is-initially-hidden {
    display: none !important;
}

/* -------------------------------------------------------------
   CORE ANIMATION & BASE PRIMITIVE (GPU Accelerated)
   ------------------------------------------------------------- */
@keyframes sk-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.sk {
    position: relative;
    overflow: hidden;
    background: var(--sk-bg);
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
}

.sk::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--sk-shimmer), transparent);
    animation: sk-shimmer 1.5s ease-in-out infinite;
}

/* Reduced Motion Safety */
@media (prefers-reduced-motion: reduce) {
    .sk::after,
    .cx-sk::after,
    .nod-sk::after,
    .set-sk::after,
    .sf-sk::after {
        animation: none !important;
        display: none !important;
    }
}

/* -------------------------------------------------------------
   BASIC GEOMETRIC SHAPES & BARS
   ------------------------------------------------------------- */
.sk-bar {
    display: block;
    height: 12.5px;
    margin: 4px 0;
    border-radius: 4px;
    width: 100%;
}
.sk-bar.is-short {
    width: 50%;
}

.sk-bar.is-med {
    width: 75%;
}

.sk-bar.is-long {
    width: 90%;
}

.sk-title {
    display: block;
    height: 20px;
    margin: 4px 0;
    border-radius: 4px;
    width: 70%;
}

.sk-sub {
    display: block;
    height: 11px;
    margin: 4px 0;
    border-radius: 4px;
    width: 45%;
}

.sk-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sk-circle.is-md {
    width: 32px;
    height: 32px;
}

.sk-circle.is-lg {
    width: 40px;
    height: 40px;
}

.sk-badge,
.sk-pill {
    height: 20px;
    width: 64px;
    border-radius: 9999px;
    display: inline-block;
}

.sk-btn {
    height: 32px;
    width: 84px;
    border-radius: 6px;
    display: inline-block;
}

.sk-media {
    width: 100%;
    min-height: 120px;
    border-radius: 8px;
    display: block;
}

/* -------------------------------------------------------------
   TABLE ROW SKELETONS (.sk-row)
   ------------------------------------------------------------- */
tr.sk-row td {
    padding: 12px 16px;
    vertical-align: middle;
}

tr.sk-row .sk-bar {
    margin: 0;
}

/* -------------------------------------------------------------
   KPI COUNTER TILES (.sk-kpi)
   ------------------------------------------------------------- */
.sk-kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sk-kpi .sk-sub {
    width: 40%;
    margin: 0;
}

.sk-kpi .sk-title {
    width: 65%;
    height: 28px;
    margin: 0;
}

/* -------------------------------------------------------------
   CARD CONTAINERS (.sk-card)
   ------------------------------------------------------------- */
.sk-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sk-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sk-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sk-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* -------------------------------------------------------------
   FORM FIELDS (.sk-form-group)
   ------------------------------------------------------------- */
.sk-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.sk-form-input {
    height: 38px;
    width: 100%;
    border-radius: 6px;
}

/* -------------------------------------------------------------
   KITCHEN LINE KDS TICKET CARDS (.sk-kds-ticket)
   ------------------------------------------------------------- */
.sk-kds-ticket {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 220px;
}

.sk-kds-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sk-kds-ticket-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* -------------------------------------------------------------
   TV DIGITAL SIGNAGE MENU ITEMS (.sk-signage-item)
   ------------------------------------------------------------- */
.sk-signage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.sk-signage-item-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 70%;
}

/* -------------------------------------------------------------
   TV PAIRING SCREEN SKELETON (.sk-pairing)
   ------------------------------------------------------------- */
.sk-pairing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.sk-pairing-qr {
    width: 180px;
    height: 180px;
    border-radius: 8px;
}

.sk-pairing-digits {
    display: flex;
    gap: 8px;
}

.sk-pairing-digit {
    width: 40px;
    height: 48px;
    border-radius: 6px;
}

/* -------------------------------------------------------------
   BACKWARD COMPATIBILITY ALIASES (Deprecates Duplicate Shimmers)
   ------------------------------------------------------------- */
.cx-sk,
.nod-sk,
.set-sk,
.sf-sk {
    height: 12.5px;
    margin: 4px 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--sk-bg), var(--sk-shimmer), var(--sk-bg));
    background-size: 200% 100%;
    animation: sk-shimmer 1.2s linear infinite;
    pointer-events: none;
    user-select: none;
}

.cx-sk.is-short,
.nod-sk.is-short,
.sf-sk.sf-sk-sm {
    width: 50%;
}

.sk-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.sk-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
