/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(5, 5, 16, 0.8);
    /* Semi-transparent dark background */
    border: 2px solid var(--main-color);
    border-radius: 50%;
    color: var(--main-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    /* Ensure it is above other elements */
    box-shadow: 0 0 10px var(--glow);
    backdrop-filter: blur(5px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--main-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--glow), 0 0 40px var(--hover-glow);
    transform: translateY(-5px);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* Ensure accessible focus state */
.back-to-top:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--main-color), 0 0 20px var(--glow);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}