/* Infinite Scroll Loading Indicator */
.infinite-scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 40px;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.infinite-scroll-loader.silent {
    padding: 0.5rem;
    min-height: 20px;
}

.loader-spinner,
.infinite-scroll-loader .loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-top-color: var(--gray-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0.6;
}

.infinite-scroll-loader.silent .silent-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-top-color: var(--gray-400);
    opacity: 0.5;
}

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

.loader-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

.loader-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.loader-end svg {
    color: var(--gray-400);
}

.loader-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--red-600);
    font-size: 0.875rem;
}

.loader-error svg {
    color: var(--red-500);
}

.btn-retry {
    padding: 0.5rem 1rem;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 0.5rem;
}

.btn-retry:hover {
    background: var(--primary-600);
}

/* Skeleton Loading (for better UX) */
.post-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.skeleton-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
}

.skeleton-text {
    flex: 1;
    height: 16px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-content {
    height: 80px;
    background: var(--gray-200);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.skeleton-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.skeleton-action {
    width: 60px;
    height: 32px;
    background: var(--gray-200);
    border-radius: 6px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading overlay for page transitions */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.page-loading-overlay .loader-content {
    text-align: center;
}

.page-loading-overlay .loader-spinner {
    width: 50px;
    height: 50px;
    border-width: 5px;
    margin: 0 auto 1rem;
}

.page-loading-overlay .loader-text {
    font-size: 1rem;
    color: var(--gray-700);
    font-weight: 500;
}

