/* ========================================
   SCROLL TO TOP BUTTON
   Fixed button with fade in/out
======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.scroll-to-top:hover {
    background: rgba(241, 168, 23, 0.9);
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(241, 168, 23, 0.4);
}

.scroll-to-top i {
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
}

.scroll-to-top:hover i {
    color: #000000;
}

/* Theme Yellow Overrides */
.theme-yellow .scroll-to-top {
    /* Keep original dark glass background from .scroll-to-top */
    border-color: rgba(255, 255, 255, 0.2);
}

.theme-yellow .scroll-to-top i {
    color: #ffffff;
}

.theme-yellow .scroll-to-top:hover {
    background: #000000;
    border-color: #000000;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.theme-yellow .scroll-to-top:hover i {
    color: var(--accent-color);
}

.scroll-to-top.scrolling {
    animation: waterDropInverted 0.6s ease-out;
}

@keyframes waterDropInverted {
    0% {
        transform: translateY(0) scaleY(1);
        border-radius: 50%;
    }
    30% {
        transform: translateY(0) scaleY(1.08) scaleX(0.97);
        border-radius: 50% 50% 47% 47% / 45% 45% 55% 55%;
        transform-origin: top center;
    }
    50% {
        transform: translateY(0) scaleY(1.12) scaleX(0.96);
        border-radius: 50% 50% 46% 46% / 44% 44% 56% 56%;
        transform-origin: top center;
    }
    70% {
        transform: translateY(0) scaleY(1.06) scaleX(0.98);
        border-radius: 50% 50% 48% 48% / 46% 46% 54% 54%;
        transform-origin: top center;
    }
    100% {
        transform: translateY(0) scaleY(1) scaleX(1);
        border-radius: 50%;
        transform-origin: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .scroll-to-top i {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    .scroll-to-top i {
        font-size: 1.3rem;
    }
}
