/* Responsive Design CSS - Mobile and tablet adaptations for Claude Code Console */

/* Tablet landscape and smaller */
@media (max-width: 1024px) {
  .settings-panel {
    width: 320px;
  }

  .header-right {
    gap: var(--spacing-xs);
  }

  .header-button {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .header-button .icon {
    font-size: 14px;
  }

  .console-output {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .status-left,
  .status-right {
    gap: var(--spacing-sm);
  }
}

/* Tablet portrait and smaller */
@media (max-width: 768px) {
  .console-header {
    padding: var(--spacing-xs) var(--spacing-sm);
    min-height: 48px;
  }

  .console-title {
    font-size: 14px;
  }

  .console-icon {
    font-size: 16px;
  }

  .header-left {
    gap: var(--spacing-md);
  }

  .header-button {
    padding: var(--spacing-xs);
    min-width: 32px;
    justify-content: center;
  }

  .header-button span:not(.icon) {
    display: none;
  }

  .settings-panel {
    width: 100%;
    max-width: 400px;
  }

  .console-output {
    padding: var(--spacing-sm);
    font-size: 13px;
  }

  .ascii-art {
    font-size: 10px;
    overflow-x: auto;
  }

  .console-input-area {
    padding: var(--spacing-sm);
  }

  .status-bar {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 11px;
  }

  .status-left,
  .status-right {
    gap: var(--spacing-xs);
  }

  .status-item {
    display: none;
  }

  .status-item:first-child,
  .status-item:last-child {
    display: block;
  }
}

/* Mobile landscape */
@media (max-width: 640px) and (orientation: landscape) {
  .console-header {
    min-height: 40px;
  }

  .connection-status {
    display: none;
  }

  .status-bar {
    min-height: 28px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  :root {
    --font-size-base: 13px;
    --font-size-small: 11px;
    --spacing-xs: 3px;
    --spacing-sm: 6px;
    --spacing-md: 12px;
    --spacing-lg: 18px;
    --spacing-xl: 24px;
  }

  .console-header {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: var(--spacing-xs);
  }

  .header-left,
  .header-right {
    flex: 1;
    justify-content: space-between;
  }

  .header-left {
    margin-bottom: var(--spacing-xs);
  }

  .console-title {
    font-size: 13px;
  }

  .connection-status {
    font-size: 10px;
  }

  .settings-panel {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    transform: translateY(100%);
  }

  .settings-panel.visible {
    transform: translateY(0);
  }

  .console-output {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 12px;
    line-height: 1.3;
  }

  .welcome-message {
    display: none;
  }

  .output-timestamp {
    display: none;
  }

  .output-line {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .console-input-area {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .prompt-text {
    font-size: 12px;
  }

  .console-input {
    font-size: 13px;
  }

  .status-bar {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: var(--spacing-xs);
  }

  .status-left,
  .status-right {
    justify-content: space-between;
  }

  .status-right {
    margin-top: var(--spacing-xs);
  }
}

/* Small mobile */
@media (max-width: 360px) {
  .console-output {
    font-size: 11px;
  }

  .console-input {
    font-size: 12px;
  }

  .settings-content {
    padding: var(--spacing-sm);
  }

  .setting-item input,
  .setting-item select {
    font-size: 13px;
  }

  .action-button {
    font-size: 12px;
    padding: var(--spacing-xs) var(--spacing-sm);
    min-width: 60px;
  }
}

/* Touch-specific styles */
@media (hover: none) and (pointer: coarse) {
  .header-button,
  .action-button,
  .close-button {
    min-height: 44px;
    min-width: 44px;
  }

  .suggestion-item {
    padding: var(--spacing-md);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .console-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .setting-item input,
  .setting-item select {
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px;
  }

  .checkbox-label {
    min-height: 44px;
    padding: var(--spacing-sm) 0;
  }

  .setting-item input[type='checkbox'] {
    width: 24px;
    height: 24px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .status-indicator {
    width: 10px;
    height: 10px;
  }

  .spinner {
    border-width: 4px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .status-indicator {
    animation: none;
  }

  .spinner {
    animation: none;
  }

  .settings-panel {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --border-primary: #ffffff;
    --border-secondary: #ffffff;
    --text-secondary: #ffffff;
  }

  [data-theme='light'] {
    --border-primary: #000000;
    --border-secondary: #000000;
    --text-secondary: #000000;
  }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Light mode preference */
@media (prefers-color-scheme: light) {
  [data-theme='auto'] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --text-primary: #24292f;
    --text-secondary: #656d76;
    --text-accent: #0969da;
    --text-success: #1a7f37;
    --text-warning: #9a6700;
    --text-error: #d1242f;
    --border-primary: #d0d7de;
    --border-secondary: #eaeef2;
    --console-bg: #ffffff;
    --console-text: #24292f;
    --console-prompt: #0969da;
    --console-cursor: #24292f;
  }
}

/* Print styles */
@media print {
  .console-header,
  .console-input-area,
  .status-bar,
  .settings-panel,
  .loading-overlay {
    display: none !important;
  }

  .console-main {
    height: auto !important;
  }

  .console-container {
    height: auto !important;
  }

  .console-output {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .output-content {
    color: #000000 !important;
  }

  .output-content.error {
    color: #000000 !important;
    font-weight: bold;
  }

  .output-content.success {
    color: #000000 !important;
    font-weight: bold;
  }

  .ascii-art {
    color: #000000 !important;
  }
}

/* Accessibility improvements for screen readers */
@media (prefers-reduced-transparency: reduce) {
  .loading-overlay {
    backdrop-filter: none;
    background-color: rgba(0, 0, 0, 0.9);
  }
}

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .header-button:focus-visible {
    animation: focusPulse 2s infinite;
  }

  @keyframes focusPulse {
    0%,
    100% {
      box-shadow: 0 0 0 2px var(--accent-primary);
    }
    50% {
      box-shadow: 0 0 0 4px var(--accent-primary);
    }
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .welcome-message {
    display: none;
  }

  .console-header {
    min-height: 40px;
  }

  .status-bar {
    min-height: 24px;
  }

  .ascii-art {
    font-size: 10px;
  }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .settings-panel {
    width: 400px;
  }

  .console-container {
    max-width: calc(100% - 400px);
  }
}

/* Loading state optimizations for slow connections */
@media (prefers-reduced-data: reduce) {
  .ascii-art {
    display: none;
  }

  .loading-text {
    font-size: 14px;
  }

  .spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }
}
