/**
 * Back to Top Button Styles
 * 
 * The button is positioned in a vertical column with the accessibility button
 * on the right side of the screen with proper spacing to prevent overlap.
 */

.back-to-top {
    position: fixed;
    bottom: 85px; /* Position above the accessibility button with proper spacing */
    right: 20px; /* Same right distance as the accessibility button (20px) */
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 2rem; /* Pill shape for better look */
    padding: 0.5rem 1.2rem;
    height: 2.5rem;
    display: flex;
    flex-direction: row; /* Horizontal layout */
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* Space between icon and text */
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 99990; /* High enough but below accessibility button (99999) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

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

.back-to-top:hover, 
.back-to-top:focus {
    background-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
}

.back-to-top-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 80px; /* Adjust spacing on mobile */
        right: 20px; /* Keep aligned with accessibility button */
        padding: 0.4rem 1rem;
        height: 2.2rem;
    }
    
    .back-to-top-text {
        font-size: 0.75rem;
    }
}

/* Additional mobile adjustment for smaller screens */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 75px; /* Further adjust for small screens */
        right: 20px; /* Keep aligned with accessibility button */
    }
}

/* Accessibility improvements */
.back-to-top:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Animation for better user experience */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.back-to-top.visible {
    animation: pulse 2s infinite;
}

.back-to-top:hover {
    animation: none;
} 