/* BBCustom Infinite Scroll Styles - Adapted from zoxpress-child */
.bbcustom-infinite-scroll-container {
    position: relative;
}

.bbcustom-infinite-post {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.bbcustom-post-separator {
    margin: 40px 0;
    text-align: center;
    opacity: 0.3;
}

.bbcustom-post-separator hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 0;
}

/* Loading Indicator */
#bbcustom-infinite-loading,
.bbcustom-loading-indicator {
    text-align: center !important;
    padding: 40px 20px !important;
    margin: 20px auto !important;
    background: #f9f9f9 !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100px !important;
    color: #666 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.bbcustom-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

#bbcustom-infinite-loading p,
.bbcustom-loading-indicator p {
    margin: 0 !important;
    color: #666 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* No More Posts Message */
.bbcustom-no-more-posts {
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.bbcustom-no-more-posts p {
    margin: 0;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Loading dots animation */
.bbcustom-loading-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 15px;
}

.bbcustom-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3498db;
    animation: dots 1.4s infinite ease-in-out;
}

.bbcustom-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.bbcustom-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.bbcustom-loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Smooth transitions for all infinite scroll elements */
.bbcustom-infinite-post * {
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #bbcustom-infinite-loading,
    .bbcustom-loading-indicator,
    .bbcustom-no-more-posts {
        padding: 30px 15px;
        margin: 15px 0;
    }
    
    .bbcustom-loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    .bbcustom-post-separator {
        margin: 30px 0;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    #bbcustom-infinite-loading,
    .bbcustom-loading-indicator,
    .bbcustom-no-more-posts {
        background: #2a2a2a;
        border-color: #444;
    }
    
    #bbcustom-infinite-loading p,
    .bbcustom-loading-indicator p {
        color: #ccc;
    }
    
    .bbcustom-no-more-posts p {
        color: #888;
    }
    
    .bbcustom-post-separator hr {
        background: linear-gradient(to right, transparent, #555, transparent);
    }
}

/* Loading state for posts */
.bbcustom-infinite-post.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Error state */
.bbcustom-infinite-post.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: #c53030;
}

/* Success state */
.bbcustom-infinite-post.success {
    border-left: 4px solid #48bb78;
}

/* Hover effects */
.bbcustom-infinite-post:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Focus states for accessibility */
.bbcustom-loading-indicator:focus,
.bbcustom-no-more-posts:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}



/* Error display */
.bbcustom-error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #c53030;
    font-size: 14px;
}

/* Title link styling for infinite scroll posts */
.bbcustom-infinite-post .mvp-post-title a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.bbcustom-infinite-post .mvp-post-title a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Visual indicator for linked titles */
.bbcustom-infinite-post .mvp-post-title a::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.6;
    margin-left: 0.5em;
}

/* Note: Post content styling is handled by the parent theme */