/* Mobile-specific overrides and enhancements */
@media only screen and (max-width: 768px) {
  body {
    font-size: 14px;
    line-height: 1.5;
    padding-top: 0;
  }

  /* Ensure proper spacing for fixed navbar */
  .hero {
    padding-top: 120px;
  }

  /* Improve touch targets */
  .btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Better spacing for mobile */
  .section-title {
    margin-bottom: 40px;
  }

  /* Improve readability */
  .about-text p {
    font-size: 1rem;
    line-height: 1.7;
  }

  /* Better project card layout */
  .project-card {
    margin-bottom: 20px;
  }

  .project-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .project-links .btn-validate {
    width: 100%;
    text-align: center;
    padding: 10px 15px;
  }

  /* Improve certification cards */
  .certification-card {
    margin-bottom: 20px;
  }

  /* Better timeline on mobile */
  .timeline-content {
    margin-bottom: 20px;
  }

  /* Improve contact section */
  .contact-item {
    padding: 10px 0;
  }

  .social-links {
    justify-content: center;
    margin-top: 20px;
  }

  /* Better footer */
  .footer-content {
    text-align: center;
  }

  .footer-links ul,
  .footer-contact ul {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media only screen and (max-width: 480px) {
  /* Extra small mobile optimizations */
  .hero {
    padding-top: 100px;
  }

  .navbar {
    padding: 8px 15px;
  }

  .logo {
    font-size: 1.4rem;
  }

  /* Improve text readability */
  .about-text p,
  .project-info p,
  .timeline-content p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* Better button sizing */
  .btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* Improve skill cards */
  .skill-card {
    padding: 12px;
  }

  .skill-card span {
    font-size: 0.8rem;
  }

  /* Better project tech tags */
  .project-techs {
    gap: 5px;
  }

  .project-techs span {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  /* Improve certification layout */
  .certification-info {
    padding: 15px;
  }

  .certification-info h3 {
    font-size: 1rem;
  }

  .certification-info p {
    font-size: 0.8rem;
  }

  /* Better education cards */
  .education-info h3 {
    font-size: 1.1rem;
  }

  .education-info p {
    font-size: 0.9rem;
  }

  /* Improve contact section */
  .contact-info h3 {
    font-size: 1.3rem;
  }

  .contact-item {
    font-size: 0.9rem;
  }

  /* Better social links */
  .social-link {
    width: 35px;
    height: 35px;
  }

  .social-link i {
    font-size: 0.9rem;
  }
}

/* Landscape mobile optimizations */
@media only screen and (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding-top: 80px;
    min-height: auto;
  }

  .section {
    padding: 30px 0;
  }

  .navbar {
    padding: 6px 15px;
  }

  .logo {
    font-size: 1.3rem;
  }
}

/* High DPI displays */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
       only screen and (min-resolution: 192dpi) {
  .hero-image img,
  .profile-img,
  .project-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .nav-link:hover,
  .skill-card:hover,
  .project-card:hover,
  .certification-card:hover,
  .education-card:hover,
  .language-item:hover,
  .soft-skill-item:hover,
  .highlight-card:hover {
    transform: none;
  }

  .btn:active,
  .nav-link:active {
    transform: scale(0.98);
  }

  /* Improve touch targets */
  .btn,
  .nav-link,
  .social-link,
  .back-to-top {
    min-height: 44px;
    min-width: 44px;
  }
}
