/**
 * BACK TO TOP BUTTON - ALWAYS VISIBLE ICON
 * Ensures the scroll-to-top arrow icon is always visible and properly styled
 */

/* Back to Top Button - Base Styles */
#back-to-top,
.back-to-top,
.scroll-to-top {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 50px !important;
    height: 50px !important;
    background: var(--primary-color, #0d6efd) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    transition: all 0.3s ease !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Show button when active */
#back-to-top.active,
#back-to-top.show,
.back-to-top.active,
.back-to-top.show,
.scroll-to-top.active,
.scroll-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Force display when scrolled */
#back-to-top[style*="display: flex"],
#back-to-top[style*="display:block"],
.back-to-top[style*="display: flex"],
.back-to-top[style*="display:block"],
.scroll-to-top[style*="display: flex"],
.scroll-to-top[style*="display:block"] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Icon Styles - Always Visible */
#back-to-top i,
#back-to-top .fas,
#back-to-top .fa-arrow-up,
.back-to-top i,
.back-to-top .fas,
.back-to-top .fa-arrow-up,
.scroll-to-top i,
.scroll-to-top .fas,
.scroll-to-top .fa-arrow-up {
    color: #ffffff !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Icon inside link */
#back-to-top a i,
.back-to-top a i,
.back-to-top a .fas,
.back-to-top a .fa-arrow-up {
    color: #ffffff !important;
    font-size: 1.25rem !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hover State */
#back-to-top:hover,
.back-to-top:hover,
.scroll-to-top:hover {
    background: var(--primary-color-hover, #0b5ed7) !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
}

#back-to-top:hover i,
#back-to-top:hover .fas,
#back-to-top:hover .fa-arrow-up,
.back-to-top:hover i,
.back-to-top:hover .fas,
.back-to-top:hover .fa-arrow-up,
.scroll-to-top:hover i,
.scroll-to-top:hover .fas,
.scroll-to-top:hover .fa-arrow-up {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Active/Focus State */
#back-to-top:active,
#back-to-top:focus,
.back-to-top:active,
.back-to-top:focus,
.scroll-to-top:active,
.scroll-to-top:focus {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
    background: var(--primary-color-hover, #0b5ed7) !important;
    color: #ffffff !important;
}

#back-to-top:active i,
#back-to-top:focus i,
.back-to-top:active i,
.back-to-top:focus i,
.scroll-to-top:active i,
.scroll-to-top:focus i {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Dark Mode Support */
body.dark-mode #back-to-top,
body.dark-mode .back-to-top,
body.dark-mode .scroll-to-top {
    background: var(--primary-color, #0d6efd) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode #back-to-top i,
body.dark-mode .back-to-top i,
body.dark-mode .scroll-to-top i {
    color: #ffffff !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #back-to-top,
    .back-to-top,
    .scroll-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
    }

    #back-to-top i,
    .back-to-top i,
    .scroll-to-top i {
        font-size: 1.1rem !important;
    }
}

/* Override any conflicting styles */
#back-to-top *,
.back-to-top *,
.scroll-to-top * {
    color: inherit !important;
}

#back-to-top a {
    color: #ffffff !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}
