/**
 * Boneyard.css — Zero-Layout-Shift Skeleton Loading Framework for Wavvy
 * High-performance, hardware-accelerated shimmering skeleton loaders
 */

:root {
    --boneyard-bg: #f1f5f9;
    --boneyard-highlight: #ffffff;
    --boneyard-bone: #e2e8f0;
    --boneyard-bone-dark: #cbd5e1;
    --boneyard-radius: 8px;
    --boneyard-speed: 1.6s;
}

[data-theme="dark"],
.dark-theme,
body.dark {
    --boneyard-bg: #1e293b;
    --boneyard-highlight: #334155;
    --boneyard-bone: #334155;
    --boneyard-bone-dark: #475569;
}

/* ===== ANIMATIONS ===== */
@keyframes boneyard-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes boneyard-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

/* ===== ATOMIC SHIMMER PRIMITIVES ===== */
.boneyard,
.boneyard-shimmer,
.boneyard-bone {
    background: linear-gradient(
        90deg,
        var(--boneyard-bone) 0%,
        var(--boneyard-highlight) 50%,
        var(--boneyard-bone) 100%
    );
    background-size: 200% 100%;
    animation: boneyard-shimmer var(--boneyard-speed) infinite ease-in-out;
    border-radius: var(--boneyard-radius);
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

.boneyard-pulse {
    background-color: var(--boneyard-bone);
    animation: boneyard-pulse 1.8s infinite ease-in-out;
}

/* Specific bone shapes */
.boneyard-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.boneyard-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.boneyard-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.boneyard-title {
    height: 18px;
    width: 65%;
    margin-bottom: 8px;
    border-radius: 6px;
}

.boneyard-sub {
    height: 12px;
    width: 45%;
    border-radius: 4px;
    opacity: 0.8;
}

.boneyard-text {
    height: 13px;
    width: 100%;
    margin-bottom: 6px;
    border-radius: 4px;
}

.boneyard-pill {
    height: 24px;
    width: 76px;
    border-radius: 9999px !important;
}

.boneyard-badge {
    height: 20px;
    width: 60px;
    border-radius: 6px;
}

.boneyard-btn {
    height: 34px;
    width: 34px;
    border-radius: 8px;
}

.boneyard-btn-pill {
    height: 36px;
    width: 100px;
    border-radius: 9999px;
}

/* ===== TABLE SKELETONS ===== */
tr.boneyard-tr {
    background: transparent !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
}

tr.boneyard-tr td {
    padding: 1rem 1.25rem !important;
    vertical-align: middle !important;
    border-top: none !important;
}

.boneyard-cell-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.boneyard-cell-text-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* ===== COMPOSITE: SESSION CARD (MOBILE & TABLE) ===== */
.boneyard-session-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.boneyard-session-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.boneyard-session-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.boneyard-session-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px dashed #f1f5f9;
}

/* ===== COMPOSITE: TEMPLATE CARD ===== */
.boneyard-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.boneyard-template-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 240px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.boneyard-template-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.boneyard-template-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.boneyard-template-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* ===== COMPOSITE: FILE MANAGER GRID ===== */
.boneyard-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

@media (min-width: 768px) {
    .boneyard-file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
}

.boneyard-file-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.boneyard-file-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 10px;
}

.boneyard-file-name {
    width: 80%;
    height: 12px;
    margin-bottom: 6px;
}

.boneyard-file-size {
    width: 50%;
    height: 10px;
    opacity: 0.7;
}

/* ===== COMPOSITE: CONTACT CARD ===== */
.boneyard-contact-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* ===== COMPOSITE: NOTIFICATION ITEM ===== */
.boneyard-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.boneyard-notification-item:last-child {
    border-bottom: none;
}

/* ===== COMPOSITE: CHART PLACEHOLDER ===== */
.boneyard-chart-box {
    width: 100%;
    min-height: 220px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.boneyard-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 10px;
    padding: 10px 0;
}

.boneyard-chart-col {
    flex: 1;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(
        180deg,
        var(--boneyard-highlight) 0%,
        var(--boneyard-bone) 100%
    );
    animation: boneyard-shimmer var(--boneyard-speed) infinite ease-in-out;
}

/* ===== COMPOSITE: STAT CARD ===== */
.boneyard-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
