@media screen and (max-width: 1400px) {
  #profile {
    height: 80vh; /* Slightly reduced */
    margin-bottom: 4rem; /* Reduced from 6rem */
  }
  .about-containers {
    flex-wrap: wrap;
    justify-content: center;
  }
  #contact,
  #projects {
    height: fit-content;
  }
  section,
  #education,
  #achievements {
    margin: 0 5rem;
  }
  #about {
    margin-bottom: 3rem; /* Added responsive margin for smaller screens */
  }
  #achievements {
    padding: 3.5rem 0;
    margin: 2rem 5%;
  }
  .details-container.color-container {
    width: calc(50% - 2rem);
    max-width: 400px;
  }
  .color-container {
    width: calc(50% - 2rem);
    min-width: 280px;
    max-width: 400px;
  }
}

@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;
  }
  .section-container {
    margin-top: 2rem; /* Add top margin for container */
  }
  section,
  .section-container {
    height: fit-content;
  }
  section {
    margin: 0 5%;
    padding: 3rem 0; /* Reduced padding */
  }
  .section__pic-container {
    width: 275px;
    height: 275px;
    margin: 0 auto 2rem;
  }
  .section__pic-container::after {
    width: 275px;
    height: 275px;
  }
  .about-containers {
    margin-top: 0;
  }
}

@media screen and (max-width: 900px) {
  #education {
    margin: 0 2rem;
  }
  #experience-skills {
    flex-direction: column;
    gap: 3rem;
  }
  #experience,
  #skills {
    width: 100%;
  }
  .skills-container {
    align-items: center;
  }
  .skill-category {
    text-align: center;
  }
  .small-title {
    text-align: center;
  }
  .small-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
  #achievements {
    padding: 3rem 0;
    margin: 1.5rem 3%;
  }

  .achievements-title {
    font-size: 2.2rem;
    margin-bottom: 2rem;
  }

  .achievement-box {
    max-width: 320px;
  }

  .details-container.color-container {
    width: calc(100% - 2rem);
    max-width: 450px;
  }
  .color-container {
    width: calc(100% - 2rem);
    max-width: 450px;
  }
}

@media screen and (max-width: 600px) {
  #about,
  #profile {
    padding: 1.5rem 1rem; /* Reduced padding */
  }

  #contact,
  footer {
    padding: 1.5rem 1rem; /* Reduced padding */
  }

  #profile {
    height: auto;
    margin-bottom: 2rem;
  }

  .title {
    font-size: 2rem;
  }

  .section__text__p2 {
    font-size: 1.25rem;
  }

  article {
    font-size: 1rem;
  }

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

  .about-containers,
  .contact-info-upper-container,
  .btn-container {
    flex-wrap: wrap;
  }

  .btn {
    padding: 0.8rem 1.5rem;
  }

  .contact-info-container {
    margin: 0.5rem 0;
    width: 100%;
  }

  .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: 200px;
    height: 200px;
    justify-content: center;
  }

  .section__pic-container::after {
    width: 200px;
    height: 200px;
  }

  .text-container {
    text-align: justify;
    padding: 1rem 0.5rem; /* Keep padding even on small screens */
  }

  .achievements-title,
  .main-title {
    font-size: 1.75rem;
  }

  .skill-icons img {
    width: 40px;
    height: 40px;
  }

  .achievement-box {
    max-width: 90%;
  }

  #about {
    margin-bottom: 2rem; /* Smaller margin for mobile screens */
  }

  .tech-tag {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    margin: 0.15rem;
    white-space: nowrap;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .tech-stack {
    gap: 0.35rem;
    margin: 0 0.75rem 0.6rem;
    flex-wrap: wrap;
    padding: 0.25rem;
    justify-content: center;
    width: auto;
  }

  .color-container {
    height: auto;
    min-height: 420px;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .article-container {
    height: 170px;
    margin-bottom: 0;
  }

  .project-img {
    height: 150px;
  }

  .project-title {
    height: auto;
    min-height: auto;
    font-size: 1.2rem;
    margin: 0.4rem 0.75rem;
    padding: 0 0.5rem;
  }

  .btn-container {
    margin-top: auto;
    padding: 0.5rem;
  }

  .btn-container .btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  /* This ensures proper spacing between tech tags and buttons */
  .tech-stack {
    margin-bottom: 0.75rem;
  }
}

/* Added for very small mobile devices */
@media screen and (max-width: 375px) {
  .tech-tag {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    min-width: auto;
    margin: 0.15rem;
  }

  .tech-stack {
    gap: 0.2rem;
    padding: 0.15rem;
    margin: 0 0.5rem 0.5rem;
  }

  .btn-container .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .color-container {
    min-height: 400px;
  }

  .project-title {
    font-size: 1.1rem;
    margin: 0.3rem 0.5rem;
    line-height: 1.3;
  }

  .article-container {
    height: 160px;
  }
}

/* FOR SCREENS MAX WIDTH 1400px */
@media screen and (max-width: 1400px) {
  #education {
    margin: 0 8rem;
  }
  .education-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .education-time {
    text-align: left;
    margin-top: 0.5rem;
  }
}

/* FOR SCREENS MAX WIDTH 1200px */
@media screen and (max-width: 1200px) {
  #education {
    margin: 0 5rem;
    padding: 2rem;
  }
  .education-title {
    font-size: 1.5rem;
  }
  .education-degree {
    font-size: 1.1rem;
  }
  .education-time {
    font-size: 1.1rem;
  }
  .committee-items {
    flex-direction: column;
    gap: 1rem;
  }
}

/* FOR SCREENS MAX WIDTH 900px */
@media screen and (max-width: 900px) {
  #education {
    margin: 0 3rem;
    padding: 1.5rem;
  }
  .education-item {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
  }
  .education-left {
    margin-bottom: 1.5rem;
  }
  .education-details {
    width: 100%;
    text-align: center;
  }
  .committees-container {
    text-align: center;
  }
  .committee-items {
    justify-content: center;
  }
  .committee-item {
    text-align: center;
  }
}

/* FOR SCREENS MAX WIDTH 600px */
@media screen and (max-width: 600px) {
  #education {
    margin: 0 2rem;
    padding: 1.5rem 1rem;
  }
  .education-item {
    padding: 1.2rem;
    border-radius: 1rem;
    border-left-width: 3px;
  }
  .education-title {
    font-size: 1.25rem;
  }
  .education-degree {
    font-size: 1rem;
  }
  .education-time {
    font-size: 1rem;
  }
  .education-image {
    width: 100px;
    height: 100px;
  }
  .education-description {
    font-size: 0.95rem;
  }
  .committees-title {
    font-size: 1.1rem;
  }
  .committee-name {
    font-size: 1rem;
  }
  .committee-role {
    font-size: 0.85rem;
  }
  .committee-description {
    font-size: 0.9rem;
  }
  .title,
  .subheading {
    font-size: 1.75rem;
  }
}

/* Default Styles for Large Screens (above 1400px) */
#experience-skills {
  display: flex;
  justify-content: space-between;
  margin: 5rem 10rem;
  align-items: flex-start;
}

#experience,
#skills {
  width: 48%;
}

/* Media Queries for Smaller Screens */

/* For Screens up to 1200px */
@media screen and (max-width: 1200px) {
  #experience-skills {
    flex-direction: column;
    margin: 3rem 5rem;
  }

  #experience,
  #skills {
    width: 100%;
  }

  .main-title,
  .sub-title {
    text-align: center;
  }

  .skill-icons {
    justify-content: center;
  }

  .experience-item {
    padding: 1.5rem;
  }

  .experience-title,
  .small-title {
    font-size: 1.6rem;
  }

  .experience-description {
    font-size: 1.1rem;
    line-height: 1.6rem;
  }

  .skill-icons img {
    width: 55px;
    height: 55px;
  }
}

/* For Screens up to 900px */
@media screen and (max-width: 900px) {
  #experience-skills {
    /* margin: 2.5rem 3rem; */
  }

  .experience-item {
    padding: 1.25rem;
  }

  .experience-title,
  .small-title {
    font-size: 1.5rem;
  }

  .experience-description {
    font-size: 1rem;
  }

  .skill-icons img {
    width: 50px;
    height: 50px;
  }
}

/* For Screens up to 600px */
@media screen and (max-width: 600px) {
  #experience-skills {
    margin: 2rem 2rem;
  }

  .main-title,
  .sub-title {
    font-size: 2rem;
  }

  .experience-title,
  .small-title {
    font-size: 1.4rem;
  }

  .experience-description {
    font-size: 0.95rem;
    line-height: 1.5rem;
  }

  .skill-icons img {
    width: 45px;
    height: 45px;
  }
}

/* For Screens up to 480px */
@media screen and (max-width: 480px) {
  #experience-skills {
    margin: 1.5rem 1.5rem;
  }

  .main-title,
  .sub-title {
    font-size: 1.6rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .experience-title,
  .small-title {
    font-size: 1.2rem;
  }

  .experience-description {
    font-size: 0.9rem;
    line-height: 1.4rem;
  }

  .skill-icons img {
    width: 35px;
    height: 35px;
  }

  .skill-icons {
    justify-content: center;
    gap: 0.8rem;
  }

  .contact-content {
    flex-direction: column;
  }

  .contact-info-upper-container {
    padding: 1rem 0.5rem;
  }

  .contact-info-container {
    padding: 0.5rem;
  }

  .nav-links-footer {
    gap: 1rem;
  }

  .btn-container {
    gap: 0.5rem;
  }

  #achievements {
    padding: 2.5rem 0;
    margin: 1rem 2%;
  }

  .achievements-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .achievement-image img {
    height: 140px;
  }

  .achievement-content h3 {
    font-size: 1rem;
  }

  #achievements {
    padding: 2.5rem 0; /* Reduced from 4rem */
  }
}
