/* Tablet and smaller desktop */
@media screen and (max-width: 1400px) {
  #profile {
    height: 83vh;
    margin-bottom: 6rem;
  }

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

  #contact,
  #projects {
    height: fit-content;
  }

  section {
    margin: 0 5rem;
  }
}

/* Tablet portrait */
@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;
  }

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

/* Mobile landscape and smaller tablets */
@media screen and (max-width: 768px) {
  .title {
    font-size: 2.5rem;
  }

  .section__text__p2 {
    font-size: 1.5rem;
  }

  .about-containers {
    gap: 1.5rem;
  }

  .details-container {
    padding: 1rem;
  }

  .btn {
    width: 7rem;
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  /* Reduce margins for better mobile spacing */
  section {
    margin: 0 3%;
    padding-top: 2vh;
  }
}

/* Mobile portrait - Samsung S23 and similar */
@media screen and (max-width: 600px) {

  #contact,
  footer {
    height: fit-content;
    min-height: 40vh;
  }

  #profile {
    height: fit-content;
    margin-bottom: 2rem;
    padding-top: 8vh;
  }

  article {
    font-size: 0.9rem;
    width: 8rem;
  }

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

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

  .contact-info-container {
    margin: 0.5rem;
    flex-direction: column;
  }

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

  .section__text__p2 {
    font-size: 1.25rem;
  }

  .title {
    font-size: 2rem;
  }

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

  .text-container p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Better spacing for mobile */
  section {
    margin: 0 4%;
    padding-top: 3vh;
  }

  /* Adjust buttons for mobile */
  .btn {
    width: 100%;
    max-width: 200px;
    padding: 0.75rem;
  }

  .btn-container {
    gap: 0.75rem;
    flex-direction: column;
    align-items: center;
  }

  /* Better card spacing on mobile */
  .details-container {
    margin-bottom: 1rem;
    padding: 1.25rem;
  }

  /* Theme toggle button visibility on mobile */
  #theme-toggle {
    padding: 0.4rem;
  }

  #theme-toggle svg {
    width: 18px;
    height: 18px;
  }

  /* Social icons */
  #socials-container {
    gap: 2rem;
    margin-top: 1.5rem;
  }

  .icon {
    height: 1.75rem;
  }

  /* Experience cards for mobile */
  .article-container {
    gap: 1.5rem;
    justify-content: flex-start;
  }

  /* Project images */
  .project-img {
    width: 100%;
    height: auto;
  }

  /* Contact section */
  .contact-info-upper-container {
    padding: 1rem;
    margin: 1rem auto;
  }
}

/* Extra small devices - iPhone SE, small Android phones */
@media screen and (max-width: 400px) {
  .title {
    font-size: 1.75rem;
  }

  .section__text__p2 {
    font-size: 1.1rem;
  }

  .section__pic-container {
    width: 220px;
    height: 220px;
  }

  .logo {
    font-size: 1.25rem;
  }

  article {
    width: 7rem;
    font-size: 0.85rem;
  }

  .btn {
    font-size: 0.85rem;
    padding: 0.65rem;
  }

  section {
    margin: 0 3%;
  }

  .details-container {
    padding: 1rem;
  }

  .experience-sub-title {
    font-size: 1.1rem;
  }
}