/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #00B9AD 0%, #008B82 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(0, 185, 173, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto !important;
    user-select: none;
}

.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #008B82 0%, #00B9AD 100%);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 185, 173, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px) scale(1.05) !important;
}

.back-to-top i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* Animasi pulse untuk menarik perhatian */
.back-to-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: -1;
    opacity: 0.7;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Progress indicator (opsional) */
.back-to-top::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    transform: rotate(var(--scroll-progress, 0deg));
}

/* Responsive Design */
@media (max-width: 768px) {
    .back-to-top {
        position: fixed;
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .back-to-top i {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .back-to-top {
        position: fixed;
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .back-to-top i {
        font-size: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .back-to-top {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Print - sembunyikan saat print */
@media print {
    .back-to-top {
        display: none !important;
    }
}