/* SCROLLBAR FIX - Remove Double Vertical Scrollbar Issue */

/* 1. GLOBAL SCROLL CONTROL - Ensure ONLY html/body handles scrolling */
html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: 100% !important;
}

body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 2. REMOVE NESTED SCROLLING FROM MAIN CONTAINERS */
main {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 !important;
}

.container {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* 3. FULL-HEIGHT SECTIONS - Remove overflow from 100vh sections */
.hero-section,
.about-section,
.services-section,
.testimonials-section {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* 4. REMOVE CUSTOM SCROLLBARS AND INDICATORS */
.table-container,
.dashboard-card,
.glass,
[class*="card"],
[class*="wrapper"] {
    overflow: visible !important;
}

/* 5. SPECIFIC FIXES FOR COMMON PROBLEMATIC CONTAINERS */
.about-visual-wrapper {
    overflow: visible !important;
}

.service-card,
.product-card,
.testimonial-card {
    overflow: visible !important;
}

/* 6. ENSURE NO HORIZONTAL SCROLLING */
* {
    box-sizing: border-box;
}

/* 7. REMOVE ANY REMAINING NESTED SCROLLBARS */
html, body, main, section, div, container, .container {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
main::-webkit-scrollbar,
section::-webkit-scrollbar,
div::-webkit-scrollbar,
.container::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* 8. ONLY ALLOW BROWSER DEFAULT SCROLLBAR ON HTML */
html {
    scrollbar-width: auto; /* Firefox */
    -ms-overflow-style: auto; /* IE/Edge */
}

html::-webkit-scrollbar {
    display: auto; /* Chrome/Safari/Opera */
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5) !important;
    border-radius: 4px !important;
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%) !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563EB 0%, #059669 100%) !important;
}

/* 9. FINAL VALIDATION - Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* 10. ADMIN LAYOUT FIXES (if applicable) */
body.admin-layout {
    overflow: auto !important;
    height: auto !important;
}

.admin-main-wrap,
.admin-main {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* 11. BACK-TO-TOP BUTTON */
.back-to-top {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 48px !important;
    height: 48px !important;
    background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(20px) scale(0.8) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    border: none !important;
    text-decoration: none !important;
    line-height: 1;
}

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

.back-to-top:hover {
    background: linear-gradient(135deg, #2563EB 0%, #059669 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

.back-to-top:active {
    transform: translateY(0) scale(0.95) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

.back-to-top svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #FFFFFF !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    transition: transform 0.2s ease !important;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .back-to-top {
        width: 44px !important;
        height: 44px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .back-to-top svg {
        width: 18px !important;
        height: 18px !important;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px !important;
        height: 40px !important;
        bottom: 16px !important;
        right: 16px !important;
    }
    
    .back-to-top svg {
        width: 16px !important;
        height: 16px !important;
    }
}
