/* Discovery Optimization Styles */

/* Lazy Discovery Section */
.lazy-section {
    opacity: 0;
    animation: fadeInSection 0.3s ease-in-out forwards;
}

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

.lazy-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin: 16px 0;
}

.skeleton-loader {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Load More Section */
.load-more-section {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-top: 16px;
}

.load-more-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.load-more-trigger {
    width: 100%;
    background: transparent;
}

/* Optimized Discovery Page */
.discover-optimized {
    position: relative;
}

.tab-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-scroll::-webkit-scrollbar {
    display: none;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
    background: rgba(29, 185, 84, 0.2);
    border-color: rgba(29, 185, 84, 0.4);
    color: rgb(29, 185, 84);
}

.refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

.tab-container {
    padding: 0 20px 20px;
}

.tab-content {
    animation: fadeInTab 0.3s ease-in-out;
}

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

.tab-header {
    padding: 24px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.tab-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
}

.tab-header p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.tab-empty h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.tab-empty p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.5;
}

/* Virtualized Discovery Grid */
.virtualized-discovery-grid {
    width: 100%;
    overflow: hidden;
}

.virtualized-grid-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

/* Performance Optimizations */
.section {
    contain: layout style;
    will-change: transform;
}

.media-item {
    contain: layout style;
}

/* Smooth transitions for better UX */
.section-header {
    transition: opacity 0.2s ease;
}

.media-list {
    transition: opacity 0.3s ease;
}

/* Loading states */
.tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.tab-loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.tab-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 16px;
}

.tab-error h3 {
    margin: 0;
    color: rgba(255, 100, 100, 0.9);
    font-size: 18px;
}

.tab-error p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.retry-btn {
    background: rgba(29, 185, 84, 0.2);
    border: 1px solid rgba(29, 185, 84, 0.4);
    color: rgb(29, 185, 84);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: rgba(29, 185, 84, 0.3);
    border-color: rgba(29, 185, 84, 0.6);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .tab-navigation {
        padding: 12px 16px;
    }
    
    .tab-container {
        padding: 0 16px 16px;
    }
    
    .tab-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .tab-button span {
        display: none;
    }
    
    .tab-header {
        padding: 20px 0 12px;
    }
    
    .tab-header h2 {
        font-size: 20px;
    }
}
