/* ========================================
   MOBILE RESPONSIVE MEDIA QUERIES
   Enhanced for Android App-like Experience
   ======================================== */

@media screen and (max-width: 1400px) {
  #profile {
    height: 85vh;
    margin-bottom: 4rem;
  }

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

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

  .qwitcher-name {
    font-size: 4rem;
  }

  .role-title {
    font-size: 2.2rem;
  }
}

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

  #hamburger-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body {
    padding-top: 80px;
  }

  .hamburger-menu {
    position: relative;
  }

  .hamburger-icon {
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
    /* Better touch target */
    padding: 10px;
    margin: -10px;
  }

  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
  }

  .hamburger-icon.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger-icon.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-icon.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .menu-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    display: flex;
    /* ADD THIS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding: 2rem 1rem;
    /* Better spacing */
  }

  .menu-links.open {
    right: 0;
  }

  .menu-links li {
    list-style: none;
    margin: 1.5rem 0;
    width: 100%;
    /* Full width */
    max-width: 300px;
    /* Constrain max width */
  }

  .menu-links a {
    color: #333;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 1rem 2rem;
    border-radius: 12px;
    display: flex;
    /* Use flex for centering */
    text-align: center;
    /* Better touch target */
    min-height: 56px;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Full width of parent */
  }

  .menu-links a:hover,
  .menu-links a:active {
    background: rgba(0, 0, 0, 0.08);
    color: #000;
  }

  #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%;
    padding: 3rem 0;
  }

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

  .about-containers {
    margin-top: 0;
    gap: 1.5rem;
  }

  .qwitcher-name {
    font-size: 3.5rem;
  }

  .role-title {
    font-size: 2rem;
  }
}

@media screen and (max-width: 768px) {
  #hamburger-nav {
    padding: 1rem 1.5rem;
  }

  .menu-links a {
    font-size: 1.5rem;
    margin: 0.8rem 0;
    padding: 1.2rem 2rem;
    border-radius: 14px;
  }

  #profile {
    height: fit-content;
    padding: 2rem 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
  }

  .section__text {
    padding: 0 1rem;
  }

  .qwitcher-name {
    font-size: 3rem;
    line-height: 1.1;
    margin: 15px 0;
    /* Mobile-friendly interaction */
    -webkit-tap-highlight-color: transparent;
  }

  .role-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .role-description {
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.6;
  }

  .section__text__p1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .chat-button {
    font-size: 1rem;
    padding: 12px 28px;
    /* Touch-friendly */
    min-height: 48px;
    min-width: 120px;
  }

  section {
    margin: 0 3%;
    padding: 2.5rem 0;
  }

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

  .about-containers {
    flex-direction: column;
    gap: 1.5rem;
  }

  .details-container {
    padding: 1.5rem;
    margin: 0.5rem 0;
    /* Better mobile interaction */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .text-container {
    padding: 1.5rem;
    margin-top: 1rem;
  }

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

  .experience-details-container {
    margin-top: 1rem;
  }

  .about-containers .details-container {
    flex: none;
    width: 100%;
  }

  .article-container {
    gap: 1rem;
  }

  article {
    font-size: 0.95rem;
    padding: 0.6rem;
    /* Better touch targets */
    min-height: 44px;
  }

  /* Improved button spacing */
  .btn {
    padding: 12px 24px;
    min-height: 48px;
    font-size: 0.95rem;
  }
}

@media screen and (max-width: 600px) {
  #hamburger-nav {
    padding: 0.9rem 1.2rem;
  }

  body {
    padding-top: 70px;
  }

  .hamburger-icon {
    width: 28px;
    height: 22px;
  }

  .menu-links a {
    font-size: 1.3rem;
    padding: 1rem 1.8rem;
  }

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

  #profile {
    padding: 1.5rem 0;
    min-height: 75vh;
  }

  .section__text {
    padding: 0 1rem;
  }

  .qwitcher-name {
    font-size: 2.5rem;
    margin: 12px 0;
  }

  .role-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .role-description {
    font-size: 1rem;
    margin-bottom: 18px;
  }

  .section__text__p1 {
    font-size: 1.3rem;
  }

  .chat-button {
    font-size: 0.95rem;
    padding: 10px 24px;
    min-height: 44px;
  }

  section {
    margin: 0 4%;
    padding: 2rem 0;
  }

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

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

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

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

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

  .logo {
    font-size: 1.3rem;
  }

  .section__pic-container {
    width: auto;
    height: 46vw;
    justify-content: center;
  }

  .section__text__p2 {
    font-size: 1.1rem;
  }

  .text-container {
    text-align: justify;
    padding: 1.2rem;
  }

  .text-container p {
    font-size: 0.85rem;
  }

  .contact-form {
    padding: 1.2rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.95rem;
    padding: 12px;
    min-height: 48px;
    /* Prevent zoom on iOS */
    font-size: 16px;
  }

  .contact-form h2 {
    font-size: 1.5rem;
  }

  .btn {
    font-size: 0.95rem;
    padding: 12px 20px;
    min-height: 48px;
  }

  footer {
    padding: 2rem 1.2rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-left,
  .footer-right {
    width: 100%;
  }

  .footer-right .social-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .social-button {
    font-size: 0.75rem;
    padding: 8px 12px;
    min-height: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .book-call-btn {
    width: 100%;
    max-width: 300px;
    min-height: 48px;
  }
}

@media screen and (max-width: 480px) {
  .qwitcher-name {
    font-size: 2.2rem;
  }

  .role-title {
    font-size: 1.3rem;
  }

  .role-description {
    font-size: 0.95rem;
  }

  .section__text__p1 {
    font-size: 1.2rem;
  }

  .title {
    font-size: 1.5rem;
  }

  .menu-links a {
    font-size: 1.2rem;
    padding: 0.9rem 1.5rem;
  }

  section {
    margin: 0 3%;
    padding: 1.5rem 0;
  }

  .details-container {
    padding: 1.2rem;
  }

  .text-container {
    padding: 1rem;
  }

  .contact-form {
    padding: 1rem;
  }
}

/* Landscape Mode Optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
  #profile {
    height: fit-content;
    min-height: 95vh;
    padding: 1rem 0;
  }

  .qwitcher-name {
    font-size: 2.8rem;
  }

  .role-title {
    font-size: 1.6rem;
  }

  .menu-links {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 2rem;
    justify-content: center;
  }

  .menu-links li {
    margin: 0.5rem 1rem;
  }

  .menu-links a {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
  }

  body {
    padding-top: 60px;
  }

  #hamburger-nav {
    padding: 0.7rem 1.5rem;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Tablet Specific (iPad, Android Tablets) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  section {
    margin: 0 4%;
  }

  .about-containers {
    gap: 2rem;
  }

  .details-container {
    padding: 1.8rem;
  }
}

/* Android-specific improvements */
@media (pointer: coarse) {

  /* Improved touch targets for all interactive elements */
  a,
  button,
  .btn,
  .nav-link,
  .hamburger-icon {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better tap highlighting */
  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
  }

  input,
  textarea,
  select {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Large Phones (e.g., Android Pixel 7 Pro, Samsung S23+) */
@media screen and (min-width: 390px) and (max-width: 480px) {
  .qwitcher-name {
    font-size: 2.4rem;
  }

  .role-title {
    font-size: 1.4rem;
  }

  .chat-button {
    font-size: 1rem;
    padding: 11px 26px;
  }
}

/* Extra Small Devices (e.g., older Android phones) */
@media screen and (max-width: 360px) {
  .qwitcher-name {
    font-size: 2rem;
  }

  .role-title {
    font-size: 1.2rem;
  }

  .section__text__p1 {
    font-size: 1.1rem;
  }

  .title {
    font-size: 1.4rem;
  }

  section {
    margin: 0 2%;
  }

  .chat-button {
    font-size: 0.9rem;
    padding: 9px 20px;
  }
}

/* Print Styles */
@media print {

  #desktop-nav,
  #hamburger-nav,
  .fab-contact,
  .bottom-nav,
  .scroll-to-top {
    display: none !important;
  }

  body {
    padding-top: 0;
    padding-bottom: 0;
  }
}