/* ==================== SCROLL TO TOP BUTTON ==================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* DARK MODE STYLING (Default) */
.scroll-to-top {
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    color: white;
    box-shadow: 
        0 8px 24px rgba(168, 85, 247, 0.4),
        0 4px 12px rgba(236, 72, 153, 0.3);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(168, 85, 247, 0.5),
        0 6px 16px rgba(236, 72, 153, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(1);
}

/* LIGHT MODE STYLING */
[data-theme="light"] .scroll-to-top {
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    color: white;
    box-shadow: 
        0 8px 24px rgba(168, 85, 247, 0.3),
        0 4px 12px rgba(236, 72, 153, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .scroll-to-top:hover {
    box-shadow: 
        0 12px 32px rgba(168, 85, 247, 0.4),
        0 6px 16px rgba(236, 72, 153, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Visible State */
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Icon Animation */
.scroll-to-top i {
    transition: transform 0.3s ease;
}

.scroll-to-top:hover i {
    transform: translateY(-3px);
}

/* Pulsing Animation (subtle) */
.scroll-to-top.visible {
    animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(168, 85, 247, 0.4),
            0 4px 12px rgba(236, 72, 153, 0.3);
    }
    50% {
        box-shadow: 
            0 8px 28px rgba(168, 85, 247, 0.5),
            0 4px 14px rgba(236, 72, 153, 0.4);
    }
}

[data-theme="light"] .scroll-to-top.visible {
    animation: subtlePulseLight 3s ease-in-out infinite;
}

@keyframes subtlePulseLight {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(168, 85, 247, 0.3),
            0 4px 12px rgba(236, 72, 153, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 
            0 8px 28px rgba(168, 85, 247, 0.4),
            0 4px 14px rgba(236, 72, 153, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.6);
    }
}

/* Ripple effect on click */
.scroll-to-top::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s ease;
}

.scroll-to-top:active::before {
    opacity: 1;
    transform: scale(1);
    transition: all 0s;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 42px;
        height: 42px;
        font-size: 16px;
        border-radius: 8px;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-to-top,
    .scroll-to-top i,
    .scroll-to-top::before {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

