/* Smooth Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #178d72 0%, #14b8a6 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(23, 141, 114, 0.25);
    overflow: hidden;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.back-to-top-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #14b8a6 0%, #10b981 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.back-to-top-btn:hover::before {
    opacity: 1;
}

.back-to-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.back-to-top-btn:active {
    transform: translateY(-2px) scale(1.05);
    transition: all 0.1s ease;
}

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

.back-to-top-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-top-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .back-to-top-btn {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .back-to-top-btn::before {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.back-to-top-btn.animate-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Accessibility */
.back-to-top-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.back-to-top-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Smooth scroll behavior for html */
html {
    scroll-behavior: smooth;
}