/* Global responsive styles */

/* Handle printing - hide unnecessary elements when printing */
@media print {
  .site-header, 
  .terminal-status-bar,
  .footer,
  .menu-toggle,
  .terminal-scanline,
  .crt-effect,
  .terminal-buttons {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .content {
    margin: 0 !important;
    padding: 10px !important;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  
  img {
    max-width: 100% !important;
  }
}

/* Medium screen adjustments */
@media (max-width: 992px) {
  .project_list, .feat-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .header-container {
    padding: 12px 20px;
  }
  
  .logo__text {
    font-size: 0.95rem;
  }
  
  .nav-link {
    padding: 6px 10px;
    font-size: 0.95rem;
  }
  
  .content-container {
    padding: 20px;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

/* Handle orientation changes */
@media screen and (orientation: portrait) {
  .project_list, .feat-list {
    grid-template-columns: 1fr !important;
  }
}

/* Small screen / mobile responsive styles */
@media (max-width: 768px) {
  #terminal-container {
    font-size: 14px;
    height: calc(100vh - 180px) !important;
  }
  
  .terminal-input {
    font-size: 14px;
    padding: 8px;
  }
  
  .terminal-output {
    padding: 8px;
  }
  
  .terminal-prompt {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #terminal-container {
    font-size: 12px;
    height: calc(100vh - 160px) !important;
  }
  
  .terminal-input {
    font-size: 12px;
    padding: 6px;
  }
  
  .terminal-output {
    padding: 6px;
  }
  
  .terminal-prompt {
    font-size: 12px;
  }
}

/* Make inputs and interactive elements more touch-friendly on small screens */
@media (max-width: 480px) {
  input, 
  button, 
  select, 
  textarea,
  .tag, 
  .chip, 
  .badge,
  .nav-link,
  .source-link,
  .terminal-btn-action,
  .cta-button {
    min-height: 44px; /* Increased from 40px for better touch targets */
    min-width: 44px;
    padding: 10px 14px; /* Increased padding */
    touch-action: manipulation;
  }
  
  /* Add active state for touch devices */
  a:active, button:active, .nav-link:active, .cta-button:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }
  
  /* Increase spacing between touchable elements */
  .nav-menu,
  .skill-grid,
  .timeline-container,
  .cta-buttons {
    gap: 16px !important;
  }
  
  /* About page responsive improvements */
  .profile-card {
    flex-direction: column !important;
    padding: 15px !important; 
  }
  
  .profile-image {
    margin: 0 auto 20px !important;
    width: 150px !important;
    height: 150px !important;
  }
  
  .timeline-item {
    padding: 15px !important;
  }
  
  .timeline-date {
    position: static !important;
    margin-bottom: 10px !important;
    display: block !important;
  }
  
  .skill-category {
    padding: 15px !important;
  }
  
  .nav-menu {
    gap: 8px;
  }
  
  /* Increase font size of small text */
  small, .text-small {
    font-size: 0.85rem;
  }
}

/* Add support for dark mode */
@media (prefers-color-scheme: dark) {
  body:not(.terminal-theme) {
    background-color: #121212;
    color: #e0e0e0;
  }
  
  body:not(.terminal-theme) a {
    color: #90caf9;
  }
  
  body:not(.terminal-theme) h1, 
  body:not(.terminal-theme) h2, 
  body:not(.terminal-theme) h3, 
  body:not(.terminal-theme) h4, 
  body:not(.terminal-theme) h5, 
  body:not(.terminal-theme) h6 {
    color: #f5f5f5;
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .terminal-prompt,
  .terminal-cursor {
    forced-color-adjust: none;
  }
    button,
  input,
  a {
    forced-color-adjust: none;
  }
}

/* Mobile fine-tunes — component padding/sizing lives in projects.css */
@media (max-width: 480px) {
  .project_list .project .project_image {
    height: 160px;
  }
}

/* Fix for overflowing code blocks and pre elements */
pre, code {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-x: auto !important;
}

/* Better form elements on mobile */
@media (max-width: 480px) {
  input, textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .light-theme {
    /* Override light theme colors in dark mode preference */
    --bg-color: var(--terminal-bg, #0d1117) !important;
    --text-color: var(--terminal-text, #4AF626) !important;
  }
}
