@media screen and (max-width: 1400px) {
  #profile {
    height: 83vh;
    margin-bottom: 6rem;
  }
  .about-containers {
    flex-wrap: wrap;
  }
  #contact,
  #projects {
    height: fit-content;
  }
}

@media screen and (max-width: 1200px) {
  #desktop-nav {
    display: none;
  }
  #hamburger-nav {
    display: flex;
  }
  #experience,
  .experience-details-container {
    margin-top: 2rem;
  }
  #profile,
  .section-container {
    display: block;
  }
  .arrow {
    display: none;
  }
  section,
  .section-container {
    height: fit-content;
  }
  section {
    margin: 0 5%;
  }
  .section__pic-container {
    width: 275px;
    height: 275px;
    margin: 0 auto 2rem;
  }
  .section__pic-containers {
    padding-bottom: 20px;
    padding-left: 0;
    justify-content: center;
  }
  .about-containers {
    margin-top: 0;
    margin-bottom: 10px;
  }
  #profile {
    padding: 2rem 5%;
    height: auto;
    gap: 3rem;
    flex-direction: column;
    text-align: center;
  }
  .title {
    font-size: 2.5rem;
  }
  
  /* Fix for profile section layout */
  .section__text {
    width: 100%;
  }
  
  /* Adjust glowing effects for smaller screens */
  .section__pic-container::before {
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    filter: blur(15px);
  }
  
  .btn {
    width: 9rem;
  }
  
  /* Fix for about section */
  .about-details-container {
    flex-direction: column;
  }
  
  .text-container {
    text-align: center;
    margin-top: 2rem;
  }
}

@media screen and (max-width: 900px) {
  #profile {
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 5%;
    height: auto;
  }
  .section__text {
    text-align: center;
  }
  .section__pic-container {
    width: 250px;
    height: 250px;
  }
  .contact-info-upper-container {
    flex-direction: column;
    align-items: center;
  }
  .contact-info-container {
    width: 100%;
    max-width: 400px;
  }
  
  /* Reduce glow intensity for mobile */
  .title {
    animation: none;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  }
  
  .section__pic-container {
    animation: floatImage 5s ease-in-out infinite;
  }
  
  /* Fix for experience section */
  .article-container {
    justify-content: center;
  }
  
  article {
    width: 100%;
    max-width: 300px;
  }
  
  /* Fix for projects section */
  .about-containers {
    flex-direction: column;
    align-items: center;
  }
  
  .details-container.color-container {
    width: 100%;
    max-width: 400px;
  }
}

@media screen and (max-width: 600px) {
  #contact,
  footer {
    height: auto;
    padding: 2rem 1rem;
  }
  #profile {
    height: auto;
    margin-bottom: 0;
    padding: 2rem 1rem;
  }
  article {
    font-size: 1rem;
    width: 100%;
  }
  footer nav {
    height: fit-content;
    margin-bottom: 2rem;
  }
  .about-containers,
  .contact-info-upper-container,
  .btn-container {
    flex-wrap: wrap;
  }
  .contact-info-container {
    margin: 0;
  }
  .contact-info-container p,
  .nav-links li a {
    font-size: 1rem;
  }
  .experience-sub-title {
    font-size: 1.25rem;
  }
  .logo {
    font-size: 1.5rem;
  }
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .section__pic-container {
    width: auto;
    height: 46vw;
    justify-content: center;
    max-width: 250px;
    max-height: 250px;
  }
  .section__text__p2 {
    font-size: 1.25rem;
  }
  .title {
    font-size: 2rem;
  }
  .text-container {
    text-align: justify;
  }
  .details-container {
    padding: 1rem;
  }
  .article-container {
    gap: 1.5rem;
  }
  .contact-form-container {
    padding: 1.5rem;
  }
  .project-img {
    height: 150px;
  }
  .tech-stack {
    justify-content: center;
  }
  
  /* Fix section margins for mobile */
  section {
    margin: 0 1rem;
    padding-top: 2vh;
  }
  
  #profile {
    margin: 0;
  }
  
  /* Further reduce animations for very small screens */
  .section__pic-container {
    animation: floatImage 6s ease-in-out infinite;
  }
  
  .btn:hover,
  .details-container:hover,
  .contact-info-container:hover,
  .color-container:hover {
    transform: none;
  }
  
  .btn:active,
  .details-container:active,
  .contact-info-container:active,
  .color-container:active {
    transform: translateY(-5px);
  }
  
  /* Fix for hamburger menu */
  .hamburger-menu {
    padding: 0.5rem;
  }
  
  .hamburger-icon {
    top: 1rem;
  }
  
  /* Ensure all sections have proper spacing */
  #about, #experience, #projects, #contact {
    padding: 3rem 0;
  }
}

/* Extra small devices */
@media screen and (max-width: 400px) {
  .section__pic-container {
    width: 200px;
    height: 200px;
  }
  
  .title {
    font-size: 1.8rem;
  }
  
  .btn {
    width: 8rem;
    padding: 0.8rem 1rem;
  }
  
  .contact-form-container {
    padding: 1rem;
  }
  
  .details-container {
    padding: 0.8rem;
  }
}