/* Mobile Responsiveness Fixes */

/* Ensure proper viewport scaling */
* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
  background-color: #000 !important;
  border: none !important;
  outline: none !important;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
  background-color: #000 !important;
  border: none !important;
  outline: none !important;
  position: relative;
  min-height: 100%;
  height: auto !important;
}

/* Ensure preloader doesn't interfere with scroll calculation */
.preloader {
  pointer-events: none !important;
  position: fixed !important;
  height: 100vh !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Fix container padding on mobile */
@media (max-width: 767px) {
  /* Prevent white scrollbar frame */
  html, body {
    max-width: 100vw !important;
    position: relative;
  }

  body {
    background-color: #000 !important;
  }

  /* Ensure all sections don't overflow */
  section {
    overflow-x: hidden;
  }

  /* Fix home section to flow with page and not cause scroll lock */
  #home {
    min-height: auto !important;
    height: auto !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Fix particles background to stay within home section bounds */
  #particles-js {
    position: absolute !important;
    height: 100% !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }

  /* Ensure content is above particles */
  #home .container {
    position: relative !important;
    z-index: 1 !important;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
    max-width: 100% !important;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Hero Section Fixes */
  .banner_content {
    margin-top: 20px !important;
    padding: 20px 0;
  }

  .banner_content h3 {
    font-size: 16px !important;
    margin-bottom: 5px !important;
  }

  .banner_content h1 {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }

  .banner_content h1 .cd-words-wrapper {
    display: block;
    margin-top: 10px;
  }

  .banner_content p {
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-top: 15px !important;
    margin-bottom: 20px !important;
  }

  /* Banner Image - Removed */
  .banner-images {
    display: none !important;
  }

  /* Make hero section full width since image is removed */
  #home .row.align-items-start {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  #home .col-lg-8,
  #home .col-md-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  #home .col-lg-4,
  #home .col-md-4 {
    display: none !important;
  }

  /* Banner content spacing */
  .banner_content {
    padding: 0 10px !important;
  }

  .banner_content p {
    font-size: 15px !important;
    line-height: 1.7 !important;
    margin-bottom: 20px !important;
    padding-right: 0 !important;
  }

  /* Section Titles */
  .section-title {
    font-size: 28px !important;
    margin-bottom: 30px !important;
    word-wrap: break-word;
  }

  .section-title span {
    display: inline !important;
  }

  /* Tech Stack Section */
  #techstack ul li {
    font-size: 14px !important;
    padding: 10px 0 !important;
  }

  #techstack .col-md-6 {
    margin-bottom: 0 !important;
  }

  #techstack > .container > .row > .col-lg-10 > div {
    padding: 30px 20px !important;
  }

  /* Testimonials Section */
  #testimonials .section-subtitle h3 {
    font-size: 20px !important;
    margin-bottom: 8px !important;
  }

  #testimonials .section-subtitle p {
    font-size: 14px !important;
  }

  #testimonials [style*="padding: 35px 30px"] {
    padding: 25px 20px !important;
  }

  #testimonials p[style*="font-size: 15px"] {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  #testimonials [style*="font-size: 17px"] {
    font-size: 16px !important;
  }

  #testimonials [style*="font-size: 13px"] {
    font-size: 12px !important;
  }

  /* Featured Projects */
  .glass-card {
    margin-bottom: 30px;
  }

  .glass-card .card-title {
    font-size: 20px !important;
    line-height: 1.3 !important;
  }

  .glass-card .card-text {
    font-size: 14px !important;
  }

  .glass-card .project-badge {
    font-size: 12px !important;
  }

  .glass-card .btn {
    font-size: 13px !important;
    padding: 10px 20px !important;
    margin: 5px !important;
  }

  .media-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Blog Section */
  .single_blog {
    margin-bottom: 30px;
  }

  .blog-thumb h4 {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }

  .blog-thumb p {
    font-size: 14px !important;
  }

  /* Contact Section */
  .contact-heading h2 {
    font-size: 28px !important;
    white-space: normal !important;
  }

  .contact-heading p {
    font-size: 14px !important;
  }

  .contact-info-panel {
    margin-bottom: 30px;
  }

  .contact-info-panel h3 {
    font-size: 18px !important;
  }

  .contact-info-panel li {
    font-size: 13px !important;
  }

  .contact-info-panel .social-icons a {
    font-size: 16px !important;
  }

  .form-control {
    font-size: 14px !important;
  }

  .ct_btn {
    width: 100%;
    font-size: 14px !important;
  }

  /* Footer */
  .footer-area {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    outline: none !important;
  }

  .footer-text p {
    font-size: 13px !important;
  }

  /* Navbar - Always visible horizontal menu */
  .navbar,
  .navbar-light,
  .bg-faded {
    padding: 8px 10px !important;
    background-color: #000 !important;
  }

  .navbar.menu-bg,
  .navbar.navbar-fixed,
  .site-navigation,
  .dark_bg_menu {
    background-color: #000 !important;
  }

  /* Override any white/light backgrounds on scroll */
  .fixed-top.menu-bg {
    background-color: #000 !important;
  }

  .navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: transparent !important;
    padding: 0 !important;
  }

  /* Hide hamburger toggle button */
  .navbar-toggler {
    display: none !important;
  }

  /* Always show navigation */
  .navbar-collapse {
    display: flex !important;
    flex-basis: auto !important;
    background-color: #000 !important;
    width: auto !important;
  }

  .navbar-nav {
    background-color: #000 !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 !important;
  }

  .navbar-nav .nav-item {
    padding: 0 !important;
    margin: 0 2px;
  }

  .navbar-nav .nav-link {
    color: #fff !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  .navbar-nav .nav-link:hover {
    color: #ff0 !important;
  }

  /* Active/current section should be yellow */
  .navbar-nav .nav-link.active,
  .navbar-nav .active > .nav-link,
  .navbar-nav .nav-link.current,
  .navbar-nav .current > .nav-link {
    color: #ff0 !important;
  }

  /* Fix any text that breaks layout */
  h1, h2, h3, h4, h5, h6, p, span, a, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Medium-sized phones (iPhone 12 Pro, XR, 14 Pro Max, etc.) */
@media (min-width: 376px) and (max-width: 430px) {
  /* Profile image adjustments for larger phones */
  .banner-images {
    margin-top: 75px !important;
    justify-content: flex-start !important;
    padding-left: 10px !important;
  }

  .banner-images img {
    max-width: 95px !important;
    width: 95px !important;
    height: 95px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  #home .col-lg-8,
  #home .col-md-8 {
    flex: 0 0 63% !important;
    max-width: 63% !important;
    padding-right: 10px !important;
  }

  #home .col-lg-4,
  #home .col-md-4 {
    flex: 0 0 37% !important;
    max-width: 37% !important;
    padding-left: 5px !important;
    padding-top: 0 !important;
  }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .banner_content h1 {
    font-size: 20px !important;
  }

  .banner_content h3 {
    font-size: 13px !important;
    margin-bottom: 3px !important;
  }

  .banner_content p {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }

  /* Even smaller profile image for tiny screens */
  .banner-images {
    margin-top: 65px !important;
    justify-content: flex-start !important;
    padding-left: 5px !important;
  }

  .banner-images img {
    max-width: 70px !important;
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  #home .col-lg-8,
  #home .col-md-8 {
    flex: 0 0 67% !important;
    max-width: 67% !important;
    padding-right: 8px !important;
  }

  #home .col-lg-4,
  #home .col-md-4 {
    flex: 0 0 33% !important;
    max-width: 33% !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
  }

  .section-title {
    font-size: 24px !important;
  }

  .glass-card .card-title {
    font-size: 18px !important;
  }

  #techstack ul li {
    font-size: 13px !important;
  }

  .glass-card .btn {
    font-size: 12px !important;
    padding: 8px 15px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .banner_content {
    margin-top: 60px !important;
  }

  .banner-images {
    display: none;
  }
}
