/* =========================================================================
   Skeleton Loader Styles for Progressive Loading
   ========================================================================= */

/* Skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Base skeleton class */
.skeleton {
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 100px;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-line-short {
    width: 60%;
}

.skeleton-line-medium {
    width: 80%;
}

.skeleton-title {
    height: 32px;
    margin-bottom: 16px;
    width: 70%;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeleton-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

.skeleton-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Staff section skeleton */
.skeleton-staff-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 6px;
}

.skeleton-staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.skeleton-staff-info {
    flex-grow: 1;
}

/* News section skeleton */
.skeleton-news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.skeleton-news-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-news-content {
    flex-grow: 1;
}

/* Events section skeleton */
.skeleton-event-row {
    display: flex;
    align-items: center;
    padding: 16px 12px;
    border-bottom: 1px solid #e0e0e0;
    gap: 16px;
}

.skeleton-event-date {
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.skeleton-event-info {
    flex-grow: 1;
}

/* Social media stats skeleton */
.skeleton-stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
}

.skeleton-stat-number {
    height: 36px;
    width: 80%;
    margin: 0 auto 12px;
}

.skeleton-stat-label {
    height: 14px;
    width: 60%;
    margin: 0 auto;
}

/* Container for skeleton sections */
.skeleton-section {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.skeleton-section-title {
    height: 28px;
    width: 200px;
    margin-bottom: 20px;
}

/* Loading overlay for sections */
.section-loading {
    position: relative;
    min-height: 200px;
}

.section-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Fade in animation when content loads */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-loaded {
    animation: fadeIn 0.3s ease-out;
}

/* Hide skeleton when content is loaded */
.section-loaded .skeleton {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .skeleton-event-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .skeleton-event-date {
        width: 100%;
    }
}

/* Pulse animation for critical content */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.skeleton-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Grid skeleton for social stats */
.skeleton-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Table skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table-row {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    gap: 12px;
}

.skeleton-table-cell {
    flex: 1;
}

.skeleton-table-cell-narrow {
    flex: 0 0 100px;
}

/* Biography skeleton */
.skeleton-bio {
    padding: 20px;
}

.skeleton-bio-paragraph {
    margin-bottom: 16px;
}

/* Map skeleton */
.skeleton-map {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%, #e0e0e0);
    background-size: 40px 40px;
    border-radius: 8px;
}

/* Loading spinner alternative */
.spinner-skeleton {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.skeleton-hidden {
    display: none !important;
}

.skeleton-visible {
    display: block !important;
}

/* Specific component skeletons */
.skeleton-contact-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.skeleton-contact-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.skeleton-contact-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Genre/tag skeleton */
.skeleton-tag {
    display: inline-block;
    height: 24px;
    width: 80px;
    margin: 4px;
    border-radius: 12px;
}

/* Image gallery skeleton */
.skeleton-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.skeleton-gallery-item {
    aspect-ratio: 1;
    border-radius: 6px;
}
