/* CSS for screensize upto 1400px */
@media screen and (max-width: 1400px) {
  #profile {
    height: 83vh;
    margin-bottom: 6rem;
  }

  .about-containers {
    flex-wrap: wrap;
  }
}

/* CSS for screensize 1200px */
@media screen and (max-width: 1200px) {
  #desktop-nav {
    display: none;
  }

  #hamburger-nav {
    display: flex;
  }

  #skills,
  .skills-details-container {
    margin-top: 2rem;
  }

  #profile,
  .section-container {
    display: block;
  }
  
  #profile {
    text-align: center; /* Center text content in profile section */
  }

  .arrow {
    display: none;
  }

  section,
  .section-container {
    height: fit-content;
  }

  section {
    margin: 0 5%;
  }

  .section__pic-container {
    width: 275px; /* Simpler sizing */
    height: 275px;
    margin: 0 auto 2rem;
  }

  .about-containers {
    margin-top: 0;
  }
}

@media screen and (max-width: 600px) {
  #contact,
  footer {
    height: 40vh;
  }

  #profile {
    height: 83vh;
    margin-bottom: 0;
  }

  /* UPDATED: Consistent section padding on mobile */
  section {
    margin: 0;
    padding: 2rem 1.5rem;
    padding-top: 4vh;
  }

  article {
    font-size: 1rem;
  }

  footer nav {
    height: fit-content;
    margin-bottom: 2rem;
  }

  .about-containers,
  .contact-info-upper-container,
  .btn-container {
    flex-wrap: wrap;
  }
  
  .btn-container {
      gap: 0.5rem; /* Reduce gap on mobile */
  }

  .contact-info-container {
    margin: 0;
  }

  .contact-info-container p,
  .nav-links li a {
    font-size: 1rem;
  }
  
  .contact-info-upper-container {
      flex-direction: column;
  }

  .skills-sub-title {
    font-size: 1.25rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* THIS IS THE FIX: Added justify-content and align-items */
  .section__pic-container {
    width: 70vw; 
    height: 70vw; 
    margin: 0 auto 2rem;
    display: flex;
    justify-content: center; /* This centers the image horizontally */
    align-items: center; /* This centers the image vertically */
  }
  
  /* Ensure profile and about images scale properly within the container */
  .section__pic-container img {
      width: 100%;
      height: 100%;
      object-fit: cover; /* Ensures image covers the container without distortion */
  }

  .section__text__p2 {
    font-size: 1.25rem;
  }

  .title {
    font-size: 2rem;
  }

  .text-container {
    text-align: justify;
  }
}

/* No major changes needed in this block due to Grid implementation */
@media screen and (min-width: 1400px) {
  #skills {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  #skills .skills-details-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  #skills .about-containers {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 3rem;
  }

  #skills .details-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
  }
}