/*-------------------------------------------------------+
| Scroll to Top Button - Modern Styles
| For PHP-Fusion 9
+--------------------------------------------------------*/

/* CSS Variables */
:root {
    --scroll-btn-bg: #007bff;
    --scroll-btn-hover: #0056b3;
    --scroll-btn-icon: #ffffff;
    --scroll-btn-size: 50px;
    --scroll-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: var(--scroll-btn-size);
    height: var(--scroll-btn-size);
    background-color: var(--scroll-btn-bg);
    color: var(--scroll-btn-icon);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--scroll-transition);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    outline: none;
}

/* Show state */
.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* Hover effect */
.scroll-to-top-btn:hover {
    background-color: var(--scroll-btn-hover);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Active/Click effect */
.scroll-to-top-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Icon */
.scroll-to-top-btn i {
    color: var(--scroll-btn-icon);
    font-size: 24px;
    transition: var(--scroll-transition);
}

/* Hover icon animation */
.scroll-to-top-btn:hover i {
    transform: translateY(-3px);
}

/* Progress ring (optional) */
.scroll-to-top-btn.with-progress {
    position: relative;
    overflow: visible;
}

.scroll-to-top-btn.with-progress::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--scroll-btn-icon);
    transition: var(--scroll-transition);
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 10px rgba(0, 123, 255, 0);
    }
}

.scroll-to-top-btn.pulse {
    animation: pulse 2s infinite;
}

/* Slide in animation */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.scroll-to-top-btn.animate-slide {
    animation: slideInRight 0.5s ease-out;
}

/* Bounce animation */
@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scroll-to-top-btn.animate-bounce {
    animation: bounceIn 0.5s ease-out;
}

/* Fade animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.scroll-to-top-btn.animate-fade {
    animation: fadeIn 0.3s ease-out;
}

/* Different button shapes */
.scroll-to-top-btn.square {
    border-radius: 8px;
}

.scroll-to-top-btn.rounded {
    border-radius: 15px;
}

/* Gradient variants */
.scroll-to-top-btn.gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.scroll-to-top-btn.gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.scroll-to-top-btn.gradient-orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.scroll-to-top-btn.gradient-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .scroll-to-top-btn {
        background-color: #1a1a1a;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }
    
    .scroll-to-top-btn:hover {
        background-color: #2d2d2d;
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    }
}

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

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

/* Accessibility */
.scroll-to-top-btn:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-to-top-btn,
    .scroll-to-top-btn i,
    .scroll-to-top-btn.with-progress::before {
        transition: none;
        animation: none;
    }
}

/* Print */
@media print {
    .scroll-to-top-btn {
        display: none !important;
    }
}

/* Preview button (for admin panel) */
.preview-btn {
    position: static !important;
    margin: 20px auto;
    opacity: 1 !important;
    visibility: visible !important;
}
