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

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

.skeleton-detail-container {
    min-height: 600px;
}

.skeleton-banner {
    width: 100%;
    height: 200px;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.skeleton-cover {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

.skeleton-title {
    width: 70%;
    height: 2rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-subtitle {
    width: 50%;
    height: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-table-row {
    width: 100%;
    height: 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-description {
    width: 100%;
    height: 150px;
    margin-top: 1rem;
    border-radius: 4px;
}



.skeleton-comment {
    width: 100%;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 8px;
}

/* Dark mode skeleton */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* CLS Prevention - Fixed Heights */
#detail-container {
    min-height: 600px;
}

#comments-section {
    min-height: 400px;
}

#user-interaction-section {
    min-height: 250px;
}

/* Grid sayfaları için minimum yükseklikler - Footer'ın yukarı gelmesini önler */
#movies-grid,
#trend-grid,
#top-100-grid,
#trending-anime-grid,
#top-anime-grid,
#movies-anime-grid,
#current-year-anime-grid,
#category-grid,
#year-anime-grid,
#search-results-grid {
    min-height: 800px;
}

/* Ana sayfa section'ları için minimum yükseklikler */
#trending-anime,
#top-anime,
#movies-anime,
#current-year-anime {
    min-height: 600px;
}

/* Prevent layout shift during image loading */
.anime-card img {
    aspect-ratio: 3/4;
    object-fit: cover;
}

.card-img-top {
    aspect-ratio: 3/4;
    object-fit: cover;
}

/* Smooth transitions */
.skeleton {
    transition: opacity 0.3s ease;
}

.skeleton.fade-out {
    opacity: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .skeleton-detail-container {
        min-height: 800px;
    }
    
    .skeleton-cover {
        height: 300px;
    }
    
    /* Banner skeleton'ını mobilde gizle */
    .skeleton-banner {
        display: none;
    }
    
    /* Mobilde grid'ler için daha küçük minimum yükseklik */
    #movies-grid,
    #trend-grid,
    #top-100-grid,
    #trending-anime-grid,
    #top-anime-grid,
    #movies-anime-grid,
    #current-year-anime-grid,
    #category-grid,
    #year-anime-grid,
    #search-results-grid {
        min-height: 600px;
    }
    
    /* Ana sayfa section'ları mobilde daha küçük */
    #trending-anime,
    #top-anime,
    #movies-anime,
    #current-year-anime {
        min-height: 400px;
    }
}