/* =========================================================
   143HUB - Load More Component
   Version: 1.0.0
   ========================================================= */

.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    margin-top: 20px;
    position: relative;
}

/* Load More Button */
.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    transition: all 0.3s ease;
    min-width: 200px;
    justify-content: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: inherit;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.load-more-icon {
    display: inline-block;
    font-size: 18px;
    transition: transform 0.5s ease;
}

.btn-load-more:hover .load-more-icon {
    transform: rotate(180deg);
}

/* Loading Spinner */
.load-more-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.load-more-spinner.active {
    display: flex;
}

.spinner-dots {
    display: flex;
    gap: 8px;
}

.spinner-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: lm-bounce 1.4s infinite ease-in-out both;
}

.spinner-dots span:nth-child(1) { animation-delay: -0.32s; }
.spinner-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes lm-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.spinner-text {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

/* No More Items */
.no-more-items {
    text-align: center;
    padding: 40px 30px;
    background: var(--surface-2);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    animation: lm-fadeInUp 0.5s ease;
}

@keyframes lm-fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.no-more-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.no-more-items p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 0 20px 0;
    font-weight: 600;
}

/* New Item Animation */
.new-item-animation {
    animation: lm-slideInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes lm-slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Error State */
.load-more-error {
    text-align: center;
    padding: 30px 20px;
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    border-radius: var(--radius-md);
    max-width: 500px;
    width: 100%;
}

.load-more-error p {
    color: var(--danger);
    margin: 0 0 15px 0;
    font-weight: 600;
}

.load-more-error button {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .load-more-container {
        padding: 30px 15px;
    }
    
    .btn-load-more {
        padding: 12px 26px;
        font-size: 14px;
        min-width: 180px;
    }
    
    .no-more-items {
        padding: 30px 20px;
    }
    
    .no-more-icon {
        font-size: 40px;
    }
}



/* =========================================================
   AUTO-LOAD ON SCROLL
   ========================================================= */

/* Sentinel element for scroll detection (hidden) */
.load-more-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    bottom: 0;
}

/* Hide the Load More button (since auto-load is enabled) */
/* But keep it visible for users who want to click */
.load-more-container.auto-load .btn-load-more {
    display: none;
}

.load-more-container.auto-load .load-more-spinner {
    display: none;
}

.load-more-container.auto-load.loading .load-more-spinner {
    display: flex;
}

/* Progress indicator */
.scroll-progress {
    position: fixed;
    top: 70px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.5);
}

/* Smooth fade in for new items */
.story-card,
.quote-card,
.letter-card,
.confession-card {
    animation: contentFadeIn 0.4s ease forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
