/* saved-articles-scroll.css - Independent Scroll Button for Saved Articles Page */
/* Matching color scheme with All News scroll button */

/* Saved Articles Page Scroll Button */
.saved-articles-scroll-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.saved-articles-scroll-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.saved-articles-scroll-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.saved-articles-scroll-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* Icon visibility based on direction */
.saved-articles-scroll-btn.up .fa-chevron-down {
    display: none;
}

.saved-articles-scroll-btn.up .fa-chevron-up {
    display: block;
}

.saved-articles-scroll-btn.down .fa-chevron-up {
    display: none;
}

.saved-articles-scroll-btn.down .fa-chevron-down {
    display: block;
}

/* Direction-specific colors - Matching All News button */
.saved-articles-scroll-btn.up {
    background: linear-gradient(135deg, var(--secondary), #c0392b);
}

.saved-articles-scroll-btn.down {
    background: linear-gradient(135deg, var(--accent), #2ecc71);
}

/* Floating animation for attention */
@keyframes saved-articles-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.saved-articles-scroll-btn.pulse {
    animation: saved-articles-float 2s ease-in-out infinite;
}

/* Ensure button is above other elements but not conflicting */
#savedArticlesPage.active ~ .saved-articles-scroll-btn.visible {
    opacity: 1;
    visibility: visible;
    display: flex;
}

/* Ensure other scroll buttons are hidden when Saved Articles page is active */
#savedArticlesPage.active ~ .all-news-scroll-btn.visible,
#savedArticlesPage.active ~ .scroll-top-btn.visible {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .saved-articles-scroll-btn {
        bottom: 90px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .saved-articles-scroll-btn {
        bottom: 80px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Position adjustment when multiple buttons might appear */
.all-news-scroll-btn.visible + .saved-articles-scroll-btn.visible {
    bottom: 160px; /* Stack below all-news-scroll-btn if both visible */
}

/* For dark mode */
@media (prefers-color-scheme: dark) {
    .saved-articles-scroll-btn {
        box-shadow: 0 4px 15px rgba(44, 90, 160, 0.5);
    }
    
    .saved-articles-scroll-btn:hover {
        box-shadow: 0 6px 20px rgba(44, 90, 160, 0.7);
    }
}

/* Ensure proper stacking with existing navigation */
.bottom-nav ~ .saved-articles-scroll-btn {
    z-index: 9998; /* Below bottom nav but above content */
}

/* Ensure podcast cover doesn't hide the button */
body.podcast-cover-active .saved-articles-scroll-btn {
    z-index: 10001; /* Above podcast cover */
}

/* Hide button when not on Saved Articles page */
body:not(.saved-articles-active) .saved-articles-scroll-btn {
    display: none;
}
