/* ===================================================================
   SKELETON LOADING STATES - Phase 4 Pattern 1
   Provides shimmer loading animations for async content
   =================================================================== */

/* ===== BASE SKELETON STYLES ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* ===== SKELETON CARD (Employee Card) ===== */
.skeleton-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    animation: skeleton-fade-in 0.3s ease-out;
}

.skeleton-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skeleton-card-title {
    height: 24px;
    width: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-card-badge {
    height: 28px;
    width: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 14px;
}

.skeleton-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-card-line.medium {
    width: 80%;
}

.skeleton-card-line.long {
    width: 100%;
}

.skeleton-card-progress {
    height: 8px;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-top: 8px;
}

/* ===== SKELETON TABLE ROW ===== */
.skeleton-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr 2fr 1fr;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.skeleton-table-cell {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-table-cell.small {
    height: 16px;
    width: 60%;
}

/* ===== SKELETON STATS CARD ===== */
.skeleton-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.skeleton-stat-value {
    height: 48px;
    width: 80px;
    margin: 0 auto 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-stat-label {
    height: 16px;
    width: 120px;
    margin: 0 auto;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ===== SKELETON HEADER (Employee Detail) ===== */
.skeleton-header {
    margin-bottom: 24px;
}

.skeleton-header-title {
    height: 32px;
    width: 250px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-header-subtitle {
    height: 18px;
    width: 350px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ===== SKELETON TIMELINE (Trip History) ===== */
.skeleton-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.skeleton-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    flex-shrink: 0;
    margin-top: 4px;
}

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

/* ===== SKELETON IMPORT PROGRESS ===== */
.skeleton-import-progress {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.skeleton-import-title {
    height: 24px;
    width: 200px;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-import-bar {
    height: 12px;
    width: 100%;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-import-status {
    height: 16px;
    width: 150px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ===== FADE-IN ANIMATION ===== */
@keyframes skeleton-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== SKELETON GRID (Dashboard) ===== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* Staggered animation delays for natural feel */
.skeleton-card:nth-child(1) { animation-delay: 0ms; }
.skeleton-card:nth-child(2) { animation-delay: 50ms; }
.skeleton-card:nth-child(3) { animation-delay: 100ms; }
.skeleton-card:nth-child(4) { animation-delay: 150ms; }
.skeleton-card:nth-child(5) { animation-delay: 200ms; }
.skeleton-card:nth-child(6) { animation-delay: 250ms; }

@keyframes skeleton-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CONTENT TRANSITION (Skeleton -> Real Content) ===== */
.content-loading {
    opacity: 0;
    animation: content-fade-in 0.2s ease-out forwards;
}

@keyframes content-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hide skeleton when content is loaded */
.skeleton-hidden {
    display: none;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .skeleton-table-row {
        display: none; /* Hide table skeletons on mobile */
    }

    .skeleton-header-title {
        width: 200px;
    }

    .skeleton-header-subtitle {
        width: 250px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme="dark"] .skeleton,
[data-theme="dark"] .skeleton-card-title,
[data-theme="dark"] .skeleton-card-badge,
[data-theme="dark"] .skeleton-card-line,
[data-theme="dark"] .skeleton-card-progress,
[data-theme="dark"] .skeleton-table-cell,
[data-theme="dark"] .skeleton-stat-value,
[data-theme="dark"] .skeleton-stat-label,
[data-theme="dark"] .skeleton-header-title,
[data-theme="dark"] .skeleton-header-subtitle,
[data-theme="dark"] .skeleton-timeline-dot,
[data-theme="dark"] .skeleton-import-title,
[data-theme="dark"] .skeleton-import-bar,
[data-theme="dark"] .skeleton-import-status {
    background: linear-gradient(90deg, #2d3748 25%, #1a202c 50%, #2d3748 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .skeleton-card,
[data-theme="dark"] .skeleton-stat-card,
[data-theme="dark"] .skeleton-timeline-item,
[data-theme="dark"] .skeleton-import-progress {
    background: #1a202c;
    border-color: #2d3748;
}

/* ===== ACCESSIBILITY ===== */
.skeleton-container[aria-busy="true"] {
    pointer-events: none;
}

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