@media (max-width: 768px) {
  #main-container {
    padding: 20px 20px 40px 20px; /* Increased bottom padding */
    gap: 16px;
  }
  
  #shell-container {
    width: 95vw;
    height: 85vh;
    border-radius: 16px;
    margin-bottom: 20px; /* Added bottom margin */
  }
  
  #shell-header {
    padding: 16px 24px;
  }
  
  #shell-output, #shell-input-area {
    padding: 24px;
  }
  
  /* Mobile command buttons - floating row remains scrollable */
  .command-buttons {
    top: -60px; /* Slightly more space above on mobile */
    padding: 12px 24px;
    gap: 10px;
    justify-content: center;
  }
  
  .command-button {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px; /* Larger touch targets */
    flex: 0 0 auto; /* Keep pill width; allow horizontal scroll */
    min-width: 80px;
  }
  
  /* Ensure output text doesn't sit under floating buttons */
  #shell-output {
    padding-bottom: 88px;
  }

  /* Mobile shell input area */
  .shell-input-container {
    padding: 16px 24px;
    gap: 12px;
  }
  
  #shell-prompt {
    font-size: 16px; /* Slightly larger on mobile */
  }
  
  #shell-input {
    font-size: 16px; /* Slightly larger on mobile */
    padding: 10px 0;
  }

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

  .modal {
    width: 95vw;
    max-height: 85vh;
  }

  .modal-header, .modal-content {
    padding: 20px;
  }
  
  /* Mobile project modal improvements */
  .modal-overlay.active .modal {
    width: 95vw;
    max-width: 95vw;
    height: auto;
    max-height: 90vh;
    border-radius: 16px;
    margin: 20px;
  }
  
  .modal-overlay.active .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .modal-overlay.active .modal-content {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
  }
  
  .project-modal-content h3 {
    font-size: 16px;
    margin: 20px 0 12px 0;
  }
  
  .project-modal-content p {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .project-modal-content .tech-stack {
    margin: 20px 0;
  }
  
  .project-modal-content .tech-tag {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .project-modal-content .project-links {
    margin-top: 24px;
  }
  
  .project-modal-content .project-link {
    display: block;
    text-align: center;
    margin: 8px 0;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* Mobile profile preview */
  .profile-preview {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw;
    max-width: 350px;
    margin: 0;
  }
  
  .profile-preview.active {
    transform: translate(-50%, -50%) !important;
  }
  
  /* Mobile contact links */
  .contact-link {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .contact-link:hover {
    transform: none; /* Disable hover transform on mobile */
  }

  .project-window.active {
    width: 100%;
    max-width: 800px;
    min-width: 300px;
    height: auto;
    max-height: 60vh;
    margin-bottom: 20px; /* Added bottom margin for project window */
  }
  
  #main-container.project-active #shell-container {
    transform: none;
  }

  .window-header {
    padding: 12px 16px; /* slightly shorter header on mobile */
  }
}

@media (max-width: 480px) {
  #main-container {
    padding: 16px 16px 50px 16px; /* Even more bottom padding for smaller screens */
    gap: 12px;
  }
  
  #shell-container {
    width: 98vw;
    height: 90vh;
    border-radius: 12px;
    margin-bottom: 30px; /* More bottom margin for smaller screens */
  }
  
  #shell-header {
    padding: 12px 16px;
  }
  
  #shell-title {
    font-size: 14px;
  }
  
  #shell-output, #shell-input-area {
    padding: 16px;
  }
  
  /* Smaller screen command buttons - floating row remains scrollable */
  .command-buttons {
    top: -55px;
    padding: 12px 16px;
    gap: 8px;
    justify-content: center;
  }
  
  .command-button {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
    flex: 0 0 auto; /* Keep pill width; allow horizontal scroll */
    min-width: 70px;
  }
  
  /* Ensure output text doesn't sit under floating buttons */
  #shell-output {
    padding-bottom: 96px;
  }

  /* Smaller screen shell input area */
  .shell-input-container {
    padding: 12px 16px;
    gap: 10px;
  }
  
  #shell-prompt {
    font-size: 15px;
  }
  
  #shell-input {
    font-size: 15px;
    padding: 8px 0;
  }
  
  .modal {
    width: 98vw;
    border-radius: 12px;
  }
  
  .modal-header, .modal-content {
    padding: 16px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  /* Additional bottom buffer for very small screens */
  body {
    padding-bottom: 20px;
  }
  
  /* Mobile-specific minimized terminal positioning */
  #shell-container.minimized {
    bottom: 40px; /* More space from bottom on mobile */
    right: 20px;
    width: 280px; /* Slightly smaller on mobile */
  }
  
  #main-container.terminal-minimized #shell-container {
    bottom: 40px;
    right: 20px;
  }

  .window-header {
    padding: 10px 14px; /* even more compact on very small screens */
  }
} 