/* ================================================
   LOADING STATES & PERFORMANCE IMPROVEMENTS
   Add this to your existing styles.css
   ================================================ */

/* Loading State Styles */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    min-height: 300px;
}

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

.loading-state p {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

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

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state p {
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Skeleton Loading (Optional Enhancement) */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

.skeleton-card {
    width: 100%;
    height: 400px;
    margin-bottom: 2rem;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
    width: 80%;
}

.skeleton-title {
    height: 30px;
    margin-bottom: 15px;
    width: 60%;
}

/* Progressive Enhancement - Fade In Animation */
.artist-card,
.event-card,
.news-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Lazy Loading - Image placeholder */
img[loading="lazy"] {
    background: rgba(255, 255, 255, 0.05);
    min-height: 200px;
}

/* Exception: news-link-icon images should not have min-height */
.news-link-icon img[loading="lazy"] {
    min-height: unset;
    background: transparent;
}

/* Performance: GPU acceleration for animations */
.artist-card,
.event-card,
.news-card,
.spinner {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .skeleton,
    .artist-card,
    .event-card,
    .news-card {
        animation: none !important;
    }
    
    * {
        transition: none !important;
    }
}

/* Offline indicator (optional) */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
