/* Go to Top Button Styles */
.fdsa-go-to-top {
    position: fixed;
    z-index: 999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    border: none;
    outline: none;
    font-family: 'FontAwesome', sans-serif;
    font-size: 16px;
    font-weight: normal;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: none;
    box-sizing: border-box;
    width: 100px;
    height: 100px;
    min-width: unset;
    min-height: unset;
    max-width: none;
    max-height: none;
}

/* Rotating dotted border */
.fdsa-go-to-top::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px dotted transparent;
    background: conic-gradient(from 0deg, var(--border-color, #007cba), transparent 20%, transparent 80%, var(--border-color, #007cba));
    animation: fdsa-rotate-border 8s linear infinite;
    z-index: -1;
}

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

.fdsa-go-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.fdsa-go-to-top:hover::before {
    animation-duration: 2s; /* Faster rotation on hover */
}

.fdsa-go-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Position variants */
.fdsa-go-to-top.bottom-right {
	bottom: 80px;
	right: 8px;
}
.fdsa-go-to-top.bottom-left {
    bottom: 80px;
    left: 8px;
}

.fdsa-go-to-top.bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
}

.fdsa-go-to-top.bottom-center.show {
    transform: translateX(-50%) translateY(0);
}

.fdsa-go-to-top.bottom-center:hover {
    transform: translateX(-50%) translateY(-3px);
}

.fdsa-go-to-top.bottom-center:active {
    transform: translateX(-50%) translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fdsa-go-to-top.bottom-right,
    .fdsa-go-to-top.bottom-left {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .fdsa-go-to-top.bottom-center {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .fdsa-go-to-top.bottom-right,
    .fdsa-go-to-top.bottom-left {
        bottom: 15px;
        right: 15px;
        left: 15px;
    }
    
    .fdsa-go-to-top.bottom-center {
        bottom: 15px;
    }
}

/* Animation keyframes */
@keyframes fdsa-rotate-border {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fdsa-go-to-top-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.fdsa-go-to-top.bounce {
    animation: fdsa-go-to-top-bounce 1s ease-in-out;
}

/* Pulse animation */
@keyframes fdsa-go-to-top-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 10px rgba(0, 124, 186, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

.fdsa-go-to-top.pulse {
    animation: fdsa-go-to-top-pulse 2s infinite;
}

/* Fade in animation */
@keyframes fdsa-go-to-top-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fdsa-go-to-top.fade-in {
    animation: fdsa-go-to-top-fade-in 0.5s ease-out;
}

/* Scale animation */
@keyframes fdsa-go-to-top-scale {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.fdsa-go-to-top.scale {
    animation: fdsa-go-to-top-scale 0.3s ease-out;
}

/* Accessibility improvements */
.fdsa-go-to-top:focus {
    outline: 2px solid #17981a;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fdsa-go-to-top {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fdsa-go-to-top {
        transition: opacity 0.3s ease;
    }
    
    .fdsa-go-to-top:hover {
        transform: none;
    }
    
    .fdsa-go-to-top::before {
        animation: none;
    }
    
    .fdsa-go-to-top.bounce,
    .fdsa-go-to-top.pulse,
    .fdsa-go-to-top.fade-in,
    .fdsa-go-to-top.scale {
        animation: none;
    }
}
