/* Back to Top Button - Tek instance güvencesi */
.back-to-top {
    position: fixed !important;
    bottom: 100px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Sadece ilk back-to-top button'u göster */
.back-to-top:not(:first-of-type) {
    display: none !important;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

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

/* Mobile optimization */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 160px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Smooth scroll behavior sadece body için (Safari zıplamasını azaltır) */
html { scroll-behavior: auto; }
body { scroll-behavior: smooth; }

/* Page loading animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Enhanced accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for better accessibility */
.back-to-top:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .loader-spinner {
        animation: none;
    }
}
