/* Content Prefetching Visual Enhancements */

/* Smooth transitions for cached content */
.cached-content {
    transition: all 0.2s ease;
}

.cached-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Loading states for lazy images */
.lazy-load {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.lazy-load:not(.loaded) {
    opacity: 0.7;
    filter: blur(2px);
}

.lazy-load.loaded {
    opacity: 1;
    filter: none;
}

/* Prefetch indicators (subtle) */
.prefetched-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    border-radius: 50%;
    opacity: 0.7;
    animation: prefetch-pulse 2s infinite;
    z-index: 10;
}

@keyframes prefetch-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Fast loading animation */
.fast-load {
    animation: fast-load 0.4s ease-out;
}

@keyframes fast-load {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading for cards */
.skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Hover effects for better UX */
.article-card {
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.article-card:hover::before {
    left: 100%;
}

/* Performance indicator badge */
.perf-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.perf-badge.show {
    display: block;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive optimizations */
@media (max-width: 768px) {
    .prefetched-indicator {
        width: 6px;
        height: 6px;
        top: 6px;
        right: 6px;
    }
    
    .cached-content:hover {
        transform: none;
        box-shadow: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .lazy-load:not(.loaded) {
        filter: none;
        opacity: 0.9;
    }
    
    .skeleton-card {
        background: #ccc;
        animation: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .lazy-load,
    .cached-content,
    .article-card,
    .prefetched-indicator {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles - hide prefetch indicators */
@media print {
    .prefetched-indicator,
    .perf-badge {
        display: none !important;
    }
}