/* ═══════════════════════════════════════════════════════════════
   AKIYA CRM — Skeleton Loading System
   Premium shimmer loading states for all dashboard pages
   Inspired by Stripe, HubSpot, Linear, Salesforce
═══════════════════════════════════════════════════════════════ */

/* ── SHIMMER KEYFRAME ── */
@keyframes akiya-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

/* ── BASE SKELETON ELEMENT ── */
.sk {
    background: #e8e8e8;
    background-image: linear-gradient(
        90deg,
        #e8e8e8 0px,
        #f4f4f4 40%,
        #e8e8e8 80%
    );
    background-size: 600px 100%;
    animation: akiya-shimmer 1.6s ease-in-out infinite;
    border-radius: 6px;
    display: block;
    flex-shrink: 0;
}

/* Dark mode skeleton */
[data-theme="dark"] .sk,
body.dark-mode .sk {
    background: #2a2a2a;
    background-image: linear-gradient(
        90deg,
        #2a2a2a 0px,
        #363636 40%,
        #2a2a2a 80%
    );
    background-size: 600px 100%;
}

/* ── SIZE UTILITIES ── */
.sk-circle  { border-radius: 50%; }
.sk-rounded { border-radius: 12px; }
.sk-pill    { border-radius: 100px; }

.sk-h4  { height: 4px; }
.sk-h6  { height: 6px; }
.sk-h8  { height: 8px; }
.sk-h10 { height: 10px; }
.sk-h12 { height: 12px; }
.sk-h14 { height: 14px; }
.sk-h16 { height: 16px; }
.sk-h20 { height: 20px; }
.sk-h24 { height: 24px; }
.sk-h28 { height: 28px; }
.sk-h32 { height: 32px; }
.sk-h36 { height: 36px; }
.sk-h40 { height: 40px; }
.sk-h48 { height: 48px; }
.sk-h56 { height: 56px; }
.sk-h64 { height: 64px; }
.sk-h80 { height: 80px; }
.sk-h100{ height: 100px; }
.sk-h120{ height: 120px; }
.sk-h160{ height: 160px; }
.sk-h200{ height: 200px; }
.sk-h240{ height: 240px; }
.sk-h280{ height: 280px; }
.sk-h300{ height: 300px; }

/* ── KPI CARD SKELETON ── */
.sk-kpi-card {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}
[data-theme="dark"] .sk-kpi-card,
body.dark-mode .sk-kpi-card {
    background: var(--card-bg, #1e1e2e);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.sk-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.sk-kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    flex-shrink: 0;
}
.sk-kpi-value {
    flex: 1;
    margin-left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* ── CHART CARD SKELETON ── */
.sk-chart-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    height: 100%;
}
[data-theme="dark"] .sk-chart-card,
body.dark-mode .sk-chart-card {
    background: var(--card-bg, #1e1e2e);
}

/* ── TABLE CARD SKELETON ── */
.sk-table-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
[data-theme="dark"] .sk-table-card,
body.dark-mode .sk-table-card {
    background: var(--card-bg, #1e1e2e);
}

/* ── LIST ROW SKELETON ── */
.sk-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sk-list-row:last-child { border-bottom: none; }
[data-theme="dark"] .sk-list-row,
body.dark-mode .sk-list-row {
    border-bottom-color: rgba(255,255,255,0.05);
}
.sk-list-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── PROGRESS BAR SKELETON ── */
.sk-progress-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.sk-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sk-progress-bar {
    height: 10px;
    border-radius: 100px;
    width: 100%;
}

/* ── PIPELINE STAGE SKELETON ── */
.sk-pipeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.02);
}
[data-theme="dark"] .sk-pipeline-row,
body.dark-mode .sk-pipeline-row {
    background: rgba(255,255,255,0.03);
}

/* ── STAT CARD SKELETON ── */
.sk-stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
[data-theme="dark"] .sk-stat-card,
body.dark-mode .sk-stat-card {
    background: var(--card-bg, #1e1e2e);
    border-color: rgba(255,255,255,0.06);
}

/* ── NAVBAR SKELETON ── */
.sk-navbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

/* ── HERO SKELETON (landing page) ── */
.sk-hero {
    padding: 80px 0 60px;
}

/* ── FEATURE CARD SKELETON ── */
.sk-feature-card {
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
[data-theme="dark"] .sk-feature-card,
body.dark-mode .sk-feature-card {
    background: var(--card-bg, #1e1e2e);
    border-color: rgba(255,255,255,0.06);
}

/* ── TEAM MEMBER CARD SKELETON ── */
.sk-member-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    border-left: 4px solid #e8e8e8;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
[data-theme="dark"] .sk-member-card,
body.dark-mode .sk-member-card {
    background: var(--card-bg, #1e1e2e);
    border-left-color: #2a2a2a;
}

/* ── REVENUE CARD SKELETON ── */
.sk-revenue-card {
    background: linear-gradient(135deg, #1a3a2a 0%, #1e4a34 100%);
    border-radius: 16px;
    padding: 28px;
    position: relative;
    overflow: hidden;
}
.sk-revenue-card .sk {
    background: rgba(255,255,255,0.08);
    background-image: linear-gradient(
        90deg,
        rgba(255,255,255,0.08) 0px,
        rgba(255,255,255,0.15) 40%,
        rgba(255,255,255,0.08) 80%
    );
    background-size: 600px 100%;
}

/* ── FADE TRANSITIONS ── */
.sk-wrapper {
    transition: opacity 0.35s ease;
}
.sk-wrapper.sk-hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
}
.sk-content {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.sk-content.sk-visible {
    opacity: 1;
}

/* ── STAGGER DELAYS for natural feel ── */
.sk-delay-1 { animation-delay: 0.1s; }
.sk-delay-2 { animation-delay: 0.2s; }
.sk-delay-3 { animation-delay: 0.3s; }
.sk-delay-4 { animation-delay: 0.4s; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sk-kpi-card  { padding: 16px; }
    .sk-chart-card{ padding: 16px; }
    .sk-hero      { padding: 48px 0 36px; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .sk { animation: none; background: #ebebeb; }
    [data-theme="dark"] .sk,
    body.dark-mode .sk { background: #2a2a2a; }
}
