/*=======================
  Responsive Styles
========================*/

/* Large Screens (1200px and up) */
@media screen and (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Medium Laptops (992px and up) */
@media screen and (min-width: 992px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text h2 {
    font-size: 1.75rem;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

/* Tablets (768px and up) */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .container {
    max-width: 720px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    margin-bottom: 2rem;
  }

  .hero-cta {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .about-content {
    flex-direction: column;
    gap: 3rem;
  }

  .about-info {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievement-item {
    flex-direction: row;
  }

  .stats-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-content {
    flex-direction: column;
    gap: 3rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    justify-content: space-between;
    width: 100%;
  }
}

/* Large Mobile (576px and up) */
@media screen and (min-width: 576px) and (max-width: 767px) {
  .container {
    max-width: 540px;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .mobile-menu-header {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 80%;
    background-color: var(--dark-bg-color);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
    padding-left: 0;
    gap: 0;
    transition: right 0.3s ease;
    z-index: 90;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .nav-links .nav-link {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text-color);
  }

  .nav-links .nav-link:hover, .nav-links .nav-link.active {
    color: var(--primary-color);
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-nav-toggle {
    display: block;
    z-index: 100;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-text {
    margin-bottom: 1rem;
    position: relative;
  }
  
  /* Mobile profile image - will show between name and title */
  .hero-text .mobile-profile-img {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 1rem auto;
    border: 3px solid var(--primary-color);
    overflow: hidden;
  }
  
  /* Hide the desktop profile image on mobile */
  .hero-image {
    display: none;
    max-width: 300px;
    margin: 0 auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .about-content {
    flex-direction: column;
    gap: 3rem;
  }

  .about-info {
    grid-template-columns: 1fr;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .publication-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .publication-year {
    min-width: initial;
  }

  .contact-content {
    flex-direction: column;
    gap: 3rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }

  body.dark-mode .nav-links {
    background-color: var(--dark-bg-color);
  }
}

/* Small Mobile (575px and down) */
@media screen and (max-width: 575px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .mobile-menu-header {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    background-color: var(--dark-bg-color);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
    padding-left: 0;
    gap: 0;
    transition: right 0.3s ease;
    z-index: 90;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .nav-links .nav-link {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text-color);
  }

  .nav-links .nav-link:hover, .nav-links .nav-link.active {
    color: var(--primary-color);
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-nav-toggle {
    display: block;
    z-index: 100;
  }
  
  #header .container {
    padding: 0 0.5rem;
  }
  
  .logo span {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 1.25rem;
  }
  
  .theme-toggle {
    width: 32px;
    height: 32px;
    margin-left: 8px;
  }

  .hero {
    padding: 150px 0 100px 0;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }
  
  /* Mobile profile image - will show between name and title */
  .hero-text .mobile-profile-img {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 1rem auto;
    border: 3px solid var(--primary-color);
    overflow: hidden;
  }
  
  /* Hide the desktop profile image on mobile */
  .hero-image {
    display: none;
  }

  .hero-text h2 {
    font-size: 1.25rem;
  }

  .hero-text p {
    font-size: 0.9rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }

  .social-links {
    justify-content: center;
  }

  .section {
    padding: 2rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .about-content {
    flex-direction: column;
    gap: 2rem;
  }

  .about-info {
    grid-template-columns: 1fr;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .projects-filter {
    gap: 1rem;
  }

  .filter-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .publication-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .publication-year {
    min-width: initial;
  }

  .contact-content {
    flex-direction: column;
    gap: 2rem;
  }

  .contact-items {
    gap: 1rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  body.dark-mode .nav-links {
    background-color: var(--dark-bg-color);
  }
}
