/* =============================================================================
   bTool — Reusable skeleton primitives (Dashboard, Team, Partners, modules)
   Linear / Stripe / Notion–inspired: soft gray, subtle shimmer, low contrast
   ============================================================================= */

@keyframes btool-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btool-skeleton,
.org-skeleton,
.text-line-skeleton,
.stats-card-skeleton,
.project-card-skeleton,
.table-row-skeleton,
.list-item-skeleton,
.skeleton-pill,
.skeleton-pill-btn,
.skeleton-search {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, #eceef2 0%, #f6f7f9 46%, #eceef2 92%);
    background-size: 200% 100%;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

/* —— Text lines —— */
.text-line-skeleton {
    height: 12px;
    border-radius: 6px;
    width: 100%;
}

.text-line-skeleton--xs {
    width: 42%;
    height: 10px;
}

.text-line-skeleton--sm {
    width: 55%;
    height: 12px;
}

.text-line-skeleton--md {
    width: 68%;
    height: 14px;
}

.text-line-skeleton--lg {
    width: min(180px, 48%);
    height: 22px;
    border-radius: 8px;
}

.text-line-skeleton--value {
    width: 38%;
    height: 26px;
    border-radius: 8px;
    margin: 2px 0;
}

.text-line-skeleton--hint {
    width: 78%;
    height: 11px;
    border-radius: 5px;
    opacity: 0.92;
}

/* —— Stats card —— */
.stats-card-skeleton {
    min-height: 84px;
    padding: 15px 16px;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

.stats-card-skeleton .text-line-skeleton {
    animation: none;
    background: #eceef2;
}

.stats-card-skeleton .text-line-skeleton--value {
    background: linear-gradient(90deg, #e8eaef 0%, #f3f4f6 46%, #e8eaef 92%);
    background-size: 200% 100%;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

/* —— Project card —— */
.project-card-skeleton {
    min-height: 168px;
    padding: 20px 22px;
    border: 1px solid #e8eaef;
    border-radius: 18px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-card-skeleton__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-card-skeleton__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card-skeleton__metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.project-card-skeleton .text-line-skeleton,
.project-card-skeleton .skeleton-pill {
    animation: none;
    background: #eceef2;
}

.project-card-skeleton__head .skeleton-pill {
    width: 72px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, #e8eaef 0%, #f3f4f6 46%, #e8eaef 92%);
    background-size: 200% 100%;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

/* —— Table row —— */
.table-row-skeleton {
    width: 100%;
    height: 52px;
    border-radius: 0;
    margin-bottom: 2px;
}

.table-row-skeleton:first-child {
    border-radius: 10px 10px 0 0;
}

.table-row-skeleton:last-child {
    border-radius: 0 0 10px 10px;
    margin-bottom: 0;
}

/* —— List item —— */
.list-item-skeleton {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #f0f2f6;
    background: transparent;
    animation: none;
}

.list-item-skeleton:first-child {
    border-top: none;
}

.list-item-skeleton .text-line-skeleton {
    flex: 1;
    max-width: 72%;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

.list-item-skeleton .text-line-skeleton--xs {
    flex: 0 0 36px;
    max-width: 36px;
}

/* —— Pills / buttons / search —— */
.skeleton-pill {
    width: 72px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-pill--sm {
    width: 56px;
}

.skeleton-pill-btn {
    width: 132px;
    height: 38px;
    border-radius: 10px;
}

.skeleton-search {
    width: 100%;
    max-width: 360px;
    height: 40px;
    border-radius: 10px;
}

/* —— Panel (sidebar) —— */
.dash-panel-skeleton {
    background: #fff;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-panel-skeleton .text-line-skeleton--xs {
    width: 48%;
    height: 11px;
    letter-spacing: 0.04em;
}

.dash-panel-skeleton__list {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

.dash-panel-skeleton__pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.dash-panel-skeleton__pill {
    height: 52px;
    border-radius: 8px;
    border: 1px solid #e8eaef;
    background: #f4f5f8;
    animation: btool-skeleton-shimmer 1.55s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .btool-skeleton,
    .org-skeleton,
    .text-line-skeleton,
    .stats-card-skeleton,
    .project-card-skeleton,
    .table-row-skeleton,
    .skeleton-pill,
    .skeleton-pill-btn,
    .skeleton-search,
    .dash-panel-skeleton__pill,
    .list-item-skeleton .text-line-skeleton,
    .stats-card-skeleton .text-line-skeleton--value,
    .project-card-skeleton__head .skeleton-pill {
        animation: none;
        background: #eceef2;
    }
}
