/* Mobile-First Responsive Enhancements */

/* Base mobile styles */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  /* Navigation mobile improvements */
  nav ul {
    flex-wrap: wrap;
    gap: 0.5rem !important;
    justify-content: center;
    padding: 0.5rem 1rem;
  }
  
  nav ul li a {
    font-size: 0.875rem !important;
    padding: 0.5rem;
    white-space: nowrap;
  }
  
  nav ul li a i {
    width: 1rem !important;
    height: 1rem !important;
  }
  
  /* Hide text on mobile for nav items, keep only icons */
  nav ul li a span.nav-text {
    display: none;
  }
  
  /* Main content mobile adjustments */
  .glass {
    margin: 0.5rem !important;
    padding: 1rem !important;
    max-width: calc(100vw - 1rem) !important;
  }
  
  /* Typography mobile scaling */
  h1.neon {
    font-size: 2rem !important;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  /* Button mobile sizing */
  #enterBtn {
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem !important;
  }
  
  /* Grid mobile adjustments */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Project cards mobile */
  .project-card {
    padding: 1rem !important;
    margin-bottom: 1rem;
  }
  
  /* Logo mobile sizing */
  .logo-mobile {
    width: 3rem !important;
    height: 3rem !important;
  }
  
  /* Forms mobile */
  .terminal {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  input, textarea, select {
    font-size: 1rem !important;
  }
  
  /* Spacing adjustments */
  .mt-28 {
    margin-top: 4rem !important;
  }
  
  .py-16 {
    padding: 2rem 0 !important;
  }
  
  .px-8 {
    padding: 0 1rem !important;
  }
  
  /* Flex adjustments */
  .flex-col {
    align-items: stretch !important;
  }
  
  .flex-col > * {
    text-align: center;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  /* Even more compact navigation */
  nav ul {
    gap: 0.25rem !important;
  }
  
  nav ul li a {
    padding: 0.25rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Typography extra small */
  h1.neon {
    font-size: 1.75rem !important;
  }
  
  .glass {
    margin: 0.25rem !important;
    padding: 0.75rem !important;
    border-radius: 0.75rem !important;
  }
  
  /* Scanlines adjustment for small screens */
  .scanlines {
    opacity: 0.3 !important;
  }
  
  /* HUD background mobile */
  .hud-bg {
    opacity: 0.2 !important;
  }
}

/* Very small screens - enhanced touch targets */
@media (max-width: 320px) {
  .glass {
    margin: 0.125rem !important;
    padding: 0.5rem !important;
  }
  
  h1.neon {
    font-size: 1.5rem !important;
    line-height: 1.1;
  }
  
  nav ul li a {
    padding: 0.125rem !important;
    font-size: 0.625rem !important;
  }
  
  .mobile-menu ul li a {
    padding: 0.75rem !important;
    font-size: 1rem !important;
  }
  
  .cmd-window {
    padding: 0.5rem !important;
    font-size: 0.625rem !important;
    min-height: 200px !important;
  }
}

/* Mobile hamburger menu styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: 1px solid #00fff7;
    color: #00fff7;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
  }
  
  .mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid #00fff7;
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 2rem 1rem;
  }
  
  .mobile-menu.active {
    left: 0;
  }
  
  .mobile-menu ul {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }
  
  .mobile-menu ul li a {
    font-size: 1.1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  }
  
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }
  
  .mobile-menu-overlay.active {
    display: block;
  }
  
  .desktop-nav {
    display: none;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .mobile-menu {
    display: none;
  }
  
  .desktop-nav {
    display: flex;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .glass {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  h1.neon {
    font-size: 1.5rem !important;
  }
  
  nav {
    padding: 0.25rem 0 !important;
  }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
  .project-card:hover {
    transform: none;
    box-shadow: 0 0 16px #00fff7aa;
  }
  
  .project-card:active {
    transform: translateY(-4px) scale(1.02);
  }
  
  button, a {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
  /* Ensure text is readable */
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  /* Improve focus visibility */
  button:focus, a:focus, input:focus, textarea:focus {
    outline: 2px solid #00fff7;
    outline-offset: 2px;
  }
  
  /* Better spacing for touch targets */
  .glass > * + * {
    margin-top: 1rem;
  }
}

/* CMD Terminal mobile optimizations */
@media (max-width: 768px) {
  .cmd-window {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    min-height: 300px !important;
  }
  
  .cmd-input {
    font-size: 0.875rem !important;
  }
  
  .cmd-output {
    font-size: 0.875rem !important;
    line-height: 1.4;
  }
  
  .cmd-tag {
    font-size: 0.625rem !important;
    padding: 0.1em 0.5em !important;
  }
}

/* Contribution cards mobile optimizations */
@media (max-width: 768px) {
  .contrib-card {
    margin-bottom: 1rem !important;
    padding: 1rem !important;
  }
  
  .contrib-card:hover {
    transform: translateY(-4px) scale(1.02) !important;
  }
}

/* Access page mobile optimizations */
@media (max-width: 768px) {
  .fade-in {
    animation-duration: 0.8s !important;
  }
}

/* Extra small screens - enhanced */
@media (max-width: 480px) {
  .cmd-window {
    padding: 0.75rem !important;
    font-size: 0.75rem !important;
    min-height: 250px !important;
    border-radius: 0.75rem !important;
  }
  
  .cmd-input, .cmd-output {
    font-size: 0.75rem !important;
  }
}

/* Enhanced accessibility for all screen sizes */
@media (max-width: 768px) {
  /* Better contrast for mobile */
  .glass {
    border-width: 2px !important;
    border-color: rgba(0, 255, 255, 0.3) !important;
  }
  
  /* Ensure touch targets are at least 44px */
  .mobile-menu ul li a {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  .mobile-menu-toggle {
    min-height: 44px !important;
    min-width: 44px !important;
  }
  
  /* Better spacing for readability */
  p {
    line-height: 1.6 !important;
  }
  
  /* Ensure form elements are touch-friendly */
  input, textarea, select, button {
    min-height: 44px !important;
    border-radius: 0.5rem !important;
  }
}
