/* Responsive Styles */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
  background-color: rgba(18, 18, 18, 0.8);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hamburger-icon {
  display: block;
  width: 30px;
  height: 24px;
  position: relative;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--primary-color, #5d8dee);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 10px;
}

.hamburger-icon span:nth-child(3) {
  top: 20px;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* Adjusted Glitch Effect for Mobile */
@media (max-width: 768px) {
  .glitch {
    text-shadow: none;
    animation: none;
  }

  .glitch:before,
  .glitch:after {
    display: none;
  }

  /* Add a subtle highlight instead */
  .glitch {
    background: linear-gradient(
      90deg,
      var(--primary-color, #5d8dee) 0%,
      var(--secondary-color, #a269ff) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
  }

  /* Simple highlight animation for mobile */
  .glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(93, 141, 238, 0.2) 0%, rgba(162, 105, 255, 0.2) 100%);
    display: block;
    animation: simpleGlitch 3s infinite;
  }

  @keyframes simpleGlitch {
    0%,
    100% {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
  }
}

/* Responsive Layout Adjustments */
@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: block;
  }

  .section-nav {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100vh;
    background-color: rgba(18, 18, 18, 0.95);
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px;
    z-index: 999;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  .section-nav.open {
    right: 0;
  }

  .section-nav .nav-item {
    margin: 10px 0;
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Improve About Section Layout */
  .about-bento {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }

  /* Explicitly reorder items in the grid */
  .portrait {
    grid-row: 1;
    order: 1;
    margin: 20px auto;
    /* max-width: 250px; */
  }

  .bio {
    grid-row: 2;
    order: 2;
  }

  .specialization {
    grid-row: 3;
    order: 3;
  }

  .facts {
    grid-row: 4;
    order: 4;
  }

  /* .contact-info {
    grid-row: 5;
    order: 5;
  } */

  /* Add additional spacing for better visual separation */
  .portrait .portrait-placeholder {
    margin-bottom: 20px;
  }

  /* Ensure the page header buttons appear before portrait */
  .page-header {
    margin-bottom: 30px;
  }

  /* Improve Skills Section Layout */
  .skills-bento {
    grid-template-columns: 1fr;
  }

  .bento-item {
    grid-column: 1 / span 1;
  }

  /* Improve Projects Section Layout */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Improve Contact Section Layout */
  .contact-container {
    flex-direction: column;
  }

  .contact-info,
  .contact-form {
    width: 100%;
  }
}

/* Extra small devices */
@media (max-width: 576px) {
  .about-bento {
    margin-top: 20px;
  }

  .portrait {
    /* max-width: 200px; */
  }
}

/* Additional Small Mobile Adjustments */
@media (max-width: 480px) {
  .page-header h1 {
    font-size: 2.75rem;
  }

  .page-header h2 {
    font-size: 1.2rem;
  }

  .header-buttons {
    flex-direction: column;
  }

  .header-buttons .btn {
    margin: 5px 0;
    width: 100%;
  }

  .section-title {
    font-size: 1.5rem;
  }
}
