/**
 * MuleCube Skeleton Loaders Styles
 * CSS-only shimmer animations for loading states
 */

/* ============================================
   Base Skeleton Element
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

[data-theme="light"] .skeleton,
[data-display-mode="day"] .skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.06) 100%
    );
    background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Skeleton Card (Service Card)
   ============================================ */

.skeleton-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

[data-theme="light"] .skeleton-card,
[data-display-mode="day"] .skeleton-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-title {
    height: 16px;
    width: 60%;
    border-radius: 4px;
}

.skeleton-text {
    height: 12px;
    width: 80%;
    border-radius: 4px;
}

.skeleton-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   Skeleton Grid
   ============================================ */

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
}

/* Staggered animation */
.skeleton-grid .skeleton-card:nth-child(1) { animation-delay: 0s; }
.skeleton-grid .skeleton-card:nth-child(2) { animation-delay: 0.1s; }
.skeleton-grid .skeleton-card:nth-child(3) { animation-delay: 0.2s; }
.skeleton-grid .skeleton-card:nth-child(4) { animation-delay: 0.3s; }
.skeleton-grid .skeleton-card:nth-child(5) { animation-delay: 0.4s; }
.skeleton-grid .skeleton-card:nth-child(6) { animation-delay: 0.5s; }

/* ============================================
   Skeleton Stats
   ============================================ */

.skeleton-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.skeleton-stat-value {
    height: 32px;
    width: 80px;
    border-radius: 4px;
}

.skeleton-stat-label {
    height: 12px;
    width: 60px;
    border-radius: 4px;
}

/* ============================================
   Skeleton Table
   ============================================ */

.skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-table-header,
.skeleton-table-row {
    display: flex;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
}

.skeleton-table-header {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .skeleton-table-header,
[data-display-mode="day"] .skeleton-table-header {
    background: rgba(0, 0, 0, 0.03);
}

.skeleton-table-row {
    background: rgba(255, 255, 255, 0.01);
}

[data-theme="light"] .skeleton-table-row,
[data-display-mode="day"] .skeleton-table-row {
    background: rgba(0, 0, 0, 0.01);
}

.skeleton-cell {
    height: 16px;
    border-radius: 4px;
}

/* ============================================
   Skeleton Text Block
   ============================================ */

.skeleton-text-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    width: 100%;
    border-radius: 4px;
}

.skeleton-line-short {
    width: 60%;
}

/* ============================================
   Skeleton Chart
   ============================================ */

.skeleton-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.skeleton-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
}

.skeleton-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
}

.skeleton-chart-axis {
    height: 2px;
    width: 100%;
}

/* ============================================
   Inline Skeleton
   ============================================ */

.skeleton-inline {
    display: inline-block;
    vertical-align: middle;
}

.skeleton-inline.skeleton-text {
    height: 1em;
    width: 8em;
}

.skeleton-inline.skeleton-circle {
    border-radius: 50%;
}

.skeleton-inline.skeleton-rect {
    border-radius: 4px;
}

/* ============================================
   Loading Container State
   ============================================ */

.skeleton-loading {
    position: relative;
    min-height: 100px;
}

/* ============================================
   Screen Reader Only (for announcements)
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: rgba(255, 255, 255, 0.08);
    }
    
    [data-theme="light"] .skeleton,
    [data-display-mode="day"] .skeleton {
        background: rgba(0, 0, 0, 0.08);
    }
}
