/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    overflow: hidden;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(0.98);
}

.scroll-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-to-top:hover::before {
    opacity: 1;
}

.scroll-to-top i {
    font-size: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
}

.scroll-to-top:hover i {
    transform: translateY(-4px);
}

/* Ripple effect */
.scroll-to-top::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.6s ease;
}

.scroll-to-top:active::after {
    transform: scale(2);
    opacity: 1;
    transition: transform 0.3s, opacity 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 48px;
        height: 48px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .scroll-to-top i {
        font-size: 1.3rem;
    }
}

/* Smooth scrolling is handled in style.css */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #1a1a2e;
}

/* Page load transition */
body.preload * {
    transition: none !important;
    animation: none !important;
}

/* Focus styles for accessibility */
.scroll-to-top:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 4px;
}

/* Print styles */
@media print {
    .scroll-to-top {
        display: none !important;
    }
    
    html, body {
        overflow: visible !important;
    }
    
    ::-webkit-scrollbar {
        display: none;
    }
}
