/**
 * Loading Skeleton Styles
 * Provides placeholder animations while content loads
 */

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

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

/* Skeleton variants */
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

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

.skeleton-text.medium {
    width: 80%;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-thumbnail {
    width: 100%;
    height: 120px;
    border-radius: 8px;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 6px;
}

.skeleton-card {
    padding: 16px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

/* Flight card skeleton */
.skeleton-flight-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 8px;
}

.skeleton-flight-card .skeleton-thumbnail {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
}

.skeleton-flight-card .skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Panel skeleton */
.skeleton-panel {
    background: rgba(20, 25, 40, 0.95);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.skeleton-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.skeleton-panel-header .skeleton-title {
    margin-bottom: 0;
}

/* Stats skeleton */
.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.skeleton-stat {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.skeleton-stat-value {
    height: 28px;
    width: 50%;
    margin: 0 auto 8px;
}

.skeleton-stat-label {
    height: 12px;
    width: 70%;
    margin: 0 auto;
}

/* Viewer loading overlay */
.viewer-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.viewer-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.viewer-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.viewer-loading-text {
    margin-top: 24px;
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    text-align: center;
}

.viewer-loading-subtext {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* Progress bar for loading */
.viewer-loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 24px;
    overflow: hidden;
}

.viewer-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Sidebar loading state */
.sidebar-loading .flight-list {
    opacity: 0.5;
    pointer-events: none;
}

/* Table skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.skeleton-table-cell {
    flex: 1;
}

.skeleton-table-cell.small {
    flex: 0 0 60px;
}

.skeleton-table-cell.medium {
    flex: 0 0 120px;
}

/* Cesium container placeholder */
#cesiumContainer.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    z-index: 1;
}

#cesiumContainer.loading::after {
    content: 'Loading 3D Viewer...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: rgba(255,255,255,0.5);
    z-index: 2;
}

/* Pulse animation for important loading states */
.loading-pulse {
    animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Fade in animation for loaded content */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered fade in for lists */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-fade-in > *:nth-child(10) { animation-delay: 0.5s; }
