/* Minimal Scroll Enhancements CSS */

/* Basic scroll behavior */
html {
    scroll-behavior: smooth;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overscroll-behavior: none !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
    -webkit-transform-style: preserve-3d !important; /* Fix for iOS */
    -webkit-transform: translate3d(0,0,0) !important; /* Alternative hardware acceleration for iOS */
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto !important; /* Changed from visible to auto for fixed header */
    max-width: 100% !important;
    box-sizing: border-box !important;
    overscroll-behavior: none !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
    -webkit-transform-style: preserve-3d !important; /* Fix for iOS */
    -webkit-transform: translate3d(0,0,0) !important; /* Alternative hardware acceleration for iOS */
}

/* Prevent nested scrollbars */
.container, section, .mx-auto, .grid, [class*="grid-"], footer, .service-card, .activity-card {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
    -webkit-transform-style: preserve-3d !important; /* Fix for iOS */
    -webkit-transform: translate3d(0,0,0) !important; /* Alternative hardware acceleration for iOS */
}

/* Hide scrollbars for all common containers */
.container::-webkit-scrollbar, section::-webkit-scrollbar, .mx-auto::-webkit-scrollbar, 
.grid::-webkit-scrollbar, [class*="grid-"]::-webkit-scrollbar, footer::-webkit-scrollbar,
.service-card::-webkit-scrollbar, .activity-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Ensure content area has proper overflow settings */
.content-area, #profil, #berita {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE and Edge */
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
    -webkit-transform-style: preserve-3d !important; /* Fix for iOS */
    -webkit-transform: translate3d(0,0,0) !important; /* Alternative hardware acceleration for iOS */
}

/* Fix for elements causing temporary scrollbars - EXCLUDE news cards */
#profil, #berita, #profil *, #berita *:not(.news-item):not(.news-item *) {
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE and Edge */
    /* Prevent scrolling system completely */
    overflow-scrolling: none !important;
    -webkit-overflow-scrolling: none !important;
    pointer-events: auto !important;
    overscroll-behavior: none !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
    -webkit-transform-style: preserve-3d !important; /* Fix for iOS */
    -webkit-transform: translate3d(0,0,0) !important; /* Alternative hardware acceleration for iOS */
}

/* Hide scrollbars for #profil, and #berita */
#profil::-webkit-scrollbar, #berita::-webkit-scrollbar,
#profil *::-webkit-scrollbar, #berita *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Prevent scrolling on all children - EXCLUDE news cards */
#profil *, #berita *:not(.news-item):not(.news-item *) {
    overflow: inherit !important;
    overflow-x: inherit !important;
    overflow-y: inherit !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    overscroll-behavior: none !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
    will-change: transform !important; /* Hint for browser optimization */
    touch-action: pan-y !important; /* Allow only vertical scrolling on touch devices */
    -webkit-backface-visibility: hidden !important; /* Fix for iOS rendering */
    backface-visibility: hidden !important; /* Fix for mobile rendering */
    perspective: 1000 !important; /* Fix for 3D rendering issues */
}

#profil *::-webkit-scrollbar, #berita *:not(.news-item):not(.news-item *)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Simple scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}