@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* Universal no-scroll fixes for all devices */
html, body {
  margin: 0;
  padding: 0;
  width: 100vw; /* Use viewport width instead of % */
  height: 100vh; /* Use viewport height instead of % */
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden !important; /* Force overflow hidden with !important */
  position: fixed;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overscroll-behavior: none; /* Prevent bounce effect on some browsers */
  -webkit-overflow-scrolling: none;
}

/* Comprehensive scrollbar hiding for all browsers */
html {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  overscroll-behavior-y: none; /* Chrome, Firefox */
  overscroll-behavior-x: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* Mobile-specific fixes */
body {
  touch-action: none !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  /* Disable pull-to-refresh and other gestures */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Ensure all content stays in viewport */
#particle-slider, .social-icons {
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden !important;
}
*, *::before, *::after {
  box-sizing: inherit;
}

/* Page background */
body {
  background-color: #F5F5F3;
  position: relative;
  background-image: url('https://ik.imagekit.io/dilanka/dilanka.png');
  background-size: auto 97%;  /* Adjusted to appropriate size */
  background-position: center bottom;  /* Anchor to bottom */
  background-repeat: no-repeat;
  background-attachment: fixed;  /* Keep fixed during scroll */
}



/* ParticleSlider container and canvas */
.slides {
  display: none; /* Hidden by default */
}
.slide {
  display: none;
}
canvas.draw {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
  display: none; /* Hidden by default */
}

/* Social icons (top-right corner) */
.social-icons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 9999;
  background-color: rgba(245, 245, 243, 0.5); /* Semi-transparent background */
  padding: 5px;
  border-radius: 5px;
}
.social-icons a {
  color: #000;
  font-size: 28px;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;  /* Increased from 42px to 55px */
  height: 42px;  /* Increased to maintain square aspect ratio */
}

.social-icons a:hover {
  color: #333;
  transform: translateY(-2px);
}

/* Responsive background image styling */
#particle-slider {
  height: 100%; /* Use height instead of min-height */
  width: 100%;
}

/* Show animation at 1700px width or higher */
@media screen and (min-width: 1700px) {
  .slides {
    display: block;
  }
  canvas.draw {
    display: block;
    transform: none;
  }
}

/* Screen size adjustments - refined to maintain portrait size with minimal buffer */
@media screen and (max-width: 1400px) {
  body {
    background-size: auto 95%;  /* Adjusted to appropriate size */
  }
}

@media screen and (max-width: 1200px) {
  body {
    background-size: auto 93%;  /* Adjusted to appropriate size */
  }
}

@media screen and (max-width: 1000px) {
  body {
    background-size: auto 91%;  /* Adjusted to appropriate size */
  }
}

@media screen and (max-width: 900px) {
  body {
    background-size: auto 89%;  /* Adjusted to appropriate size */
  }
}

@media screen and (max-width: 768px) {
  body {
    background-size: auto 87%;  /* Adjusted to appropriate size */
  }
  
  .social-icons {
    padding: 4px;
  }
  
  .social-icons a {
    width: 50px;  /* Slightly smaller on tablets */
    height: 50px;
  }
}

/* Additional breakpoint for small tablets and larger phones */
@media screen and (max-width: 600px) {
  body {
    background-size: auto 85%;  /* Adjusted to appropriate size */
  }
  
  .social-icons a {
    width: 45px;  /* Further reduced on small tablets */
    height: 45px;
  }
}

/* Specific adjustment for problematic resolution around 620px width */
@media screen and (max-width: 650px) and (max-height: 700px) {
  body {
    background-size: auto 83%;  /* Adjusted to appropriate size */
  }
  
  .social-icons {
    top: 15px;
    right: 15px;
    gap: 8px;
  }
}

/* Mobile and small screen adjustments */
@media screen and (max-width: 480px) {
  body {
    background-size: auto 81%;  /* Adjusted to appropriate size */
  }
  
  .social-icons {
    /* Keep icons at top right */
    position: fixed;
    top: 10px;
    right: 10px;
    gap: 6px;
    padding: 4px;
  }
  
  .social-icons a {
    font-size: 20px;
    width: 40px;  /* Increased from 32px but still smaller than desktop */
    height: 40px;
  }
}

/* Extra small screens like iPhone SE or smaller devices */
@media screen and (max-width: 375px) {
  body {
    background-size: auto 79%;  /* Adjusted to appropriate size */
  }
  
  .social-icons a {
    font-size: 18px;
    width: 38px;  /* Increased from 28px but still smaller than larger phones */
    height: 38px;
  }
}
