/* ===================================
   Remote Console Styles
   =================================== */

/* CSS Variables */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-hover: #252530;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-light: rgba(99, 102, 241, 0.15);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --border: #27272a;
  --border-light: #3f3f46;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --touch-target: 44px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* ===================================
   Login Page
   =================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    var(--bg-primary);
}

.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow:
    0 20px 40px var(--shadow-lg),
    0 0 0 1px var(--shadow);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.terminal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--accent-light);
  border-radius: var(--radius);
  margin: 0 auto 1rem;
  color: var(--accent);
}

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.875rem 3.5rem 0.875rem 3rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--text-secondary);
}

.toggle-password .eye-closed {
  display: none;
}

.toggle-password.password-visible .eye-open {
  display: none;
}

.toggle-password.password-visible .eye-closed {
  display: block;
}

/* Error Message */
.error-message {
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.85rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.error-message.show {
  display: flex;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Login Button */
.login-btn {
  position: relative;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-btn .btn-loader {
  display: none;
}

.login-btn.loading .btn-text {
  display: none;
}

.login-btn.loading .btn-loader {
  display: inline;
}

.login-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login Hint */
.login-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.login-hint svg {
  flex-shrink: 0;
}

/* Login Footer */
.login-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===================================
   Terminal Page
   =================================== */

.terminal-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 48px;
  flex-shrink: 0;
  min-height: 48px;
}

.terminal-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.terminal-header-info {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .terminal-header-info {
    display: flex;
  }
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.75rem;
}

.terminal-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.terminal-status.disconnected::before {
  background: var(--danger);
  animation: none;
}

.terminal-status.disconnected {
  color: var(--text-muted);
}

.terminal-latency {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.terminal-latency svg {
  flex-shrink: 0;
}

.terminal-latency.good {
  color: var(--success);
}

.terminal-latency.medium {
  color: var(--warning);
}

.terminal-latency.bad {
  color: var(--danger);
}

.terminal-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ===================================
   Shortcuts Bar
   =================================== */

.shortcuts-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 40px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.shortcuts-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  height: 100%;
}

.shortcuts-bar::-webkit-scrollbar {
  height: 3px;
}

.shortcuts-bar::-webkit-scrollbar-track {
  background: transparent;
}

.shortcuts-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.shortcut-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.shortcut-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.shortcut-btn:active {
  transform: scale(0.95);
}

.shortcut-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.shortcuts-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* ===================================
   Tabs Bar
   =================================== */

.tabs-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 36px;
  flex-shrink: 0;
}

.tabs-container {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 0.5rem;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.tabs-container::-webkit-scrollbar {
  height: 3px;
}

.tabs-container::-webkit-scrollbar-track {
  background: transparent;
}

.tabs-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tab.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  opacity: 0;
  transition: var(--transition);
}

.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 0.6;
}

.tab-close:hover {
  opacity: 1 !important;
  background: var(--border);
}

/* ===================================
   Terminal Container
   =================================== */

.terminal-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

/* ===================================
   Terminal Panes (Split View)
   =================================== */

.terminal-panes-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.pane-horizontal {
  flex-direction: row;
}

.pane-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  border: 1px solid #1a1a1a;
}

.pane-horizontal > .pane-wrapper {
  border-left: none;
  border-right: none;
}

.pane-wrapper:first-child {
  border-left: none;
}

.pane-wrapper:last-child {
  border-right: none;
}

.pane-resize-handle {
  position: absolute;
  z-index: 10;
  background: transparent;
  transition: background 0.2s;
}

.pane-resize-handle:hover,
.pane-resize-handle.active {
  background: var(--accent);
}

.pane-resize-handle.horizontal {
  width: 100%;
  height: 4px;
  bottom: -2px;
  left: 0;
  cursor: ns-resize;
}

.pane-resize-handle.vertical {
  width: 4px;
  height: 100%;
  right: -2px;
  top: 0;
  cursor: ew-resize;
}

.pane-close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
  z-index: 5;
}

.pane-wrapper:hover .pane-close-btn {
  opacity: 0.6;
}

.pane-close-btn:hover {
  opacity: 1 !important;
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.terminal-container-inner {
  width: 100%;
  height: 100%;
}

/* ===================================
   File Browser
   =================================== */

.file-browser {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
}

.file-browser.hidden {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

.file-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.file-browser-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-browser-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn-small:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn-small:active {
  transform: scale(0.95);
}

.icon-btn-small svg {
  width: 14px;
  height: 14px;
}

.file-browser-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

.path-segment {
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition);
}

.path-segment:hover {
  text-decoration: underline;
}

.path-separator {
  color: var(--text-muted);
}

.file-browser-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.file-browser-list::-webkit-scrollbar {
  width: 6px;
}

.file-browser-list::-webkit-scrollbar-track {
  background: transparent;
}

.file-browser-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.file-browser-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
}

.file-item:hover {
  background: var(--bg-hover);
}

.file-item.selected {
  background: var(--accent-light);
}

.file-item.selected .file-item-name {
  color: var(--accent-hover);
}

.file-item-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.file-item-icon.directory {
  color: var(--accent);
}

.file-item-icon.executable {
  color: var(--success);
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.file-item-actions {
  display: none;
  gap: 0.25rem;
}

.file-item:hover .file-item-actions {
  display: flex;
}

.file-browser-loading,
.file-browser-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.context-menu.show {
  display: block;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}

.context-menu-item:hover {
  background: var(--bg-hover);
}

.context-menu-item.danger {
  color: var(--danger);
}

.context-menu-item svg {
  width: 14px;
  height: 14px;
}

.context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* ===================================
   Modal
   =================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-large {
  max-width: 900px;
  width: 95%;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}

.modal-body-scroll {
  overflow-y: auto;
}

.modal-body textarea {
  width: 100%;
  min-height: 300px;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-primary,
.btn-secondary {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* ===================================
   Audit Log Styles
   =================================== */

.audit-log-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.audit-log-filters select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
}

.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audit-log-loading,
.audit-log-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.audit-log-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.audit-log-entry:hover {
  background: var(--bg-hover);
}

.audit-log-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  min-width: 140px;
}

.audit-log-action {
  font-weight: 500;
  min-width: 80px;
}

.audit-log-action.login { color: var(--success); }
.audit-log-action.file_read { color: var(--accent); }
.audit-log-action.file_write { color: var(--warning); }
.audit-log-action.file_delete { color: var(--danger); }
.audit-log-action.file_upload { color: #f97316; }
.audit-log-action.tab_create { color: #06b6d4; }
.audit-log-action.tab_close { color: #8b5cf6; }

.audit-log-details {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-log-ip {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ===================================
   Drag & Drop Overlay
   =================================== */

.drag-drop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(99, 102, 241, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.drag-drop-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drag-drop-content {
  text-align: center;
  color: white;
}

.drag-drop-content svg {
  margin-bottom: 1rem;
}

.drag-drop-content p {
  font-size: 1.2rem;
  font-weight: 500;
}

.drag-drop-path {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===================================
   Mobile Menu
   =================================== */

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1001;
  display: none;
  align-items: flex-end;
}

.mobile-menu-overlay.show {
  display: flex;
}

.mobile-menu-content {
  width: 100%;
  max-height: 70vh;
  background: var(--bg-secondary);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  animation: slideUpMobile 0.3s ease;
  overflow: hidden;
}

@keyframes slideUpMobile {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.mobile-menu-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(70vh - 60px);
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.mobile-menu-item:hover {
  background: var(--bg-tertiary);
}

.mobile-menu-item:active {
  background: var(--bg-hover);
}

.mobile-menu-item svg {
  flex-shrink: 0;
}

/* ===================================
   xterm.js Overrides
   =================================== */

.xterm {
  width: 100%;
  height: 100%;
  padding: 0.5rem;
}

.xterm-screen {
  height: 100%;
}

.xterm-viewport {
  height: 100% !important;
}

.xterm .xterm-viewport {
  overflow-y: auto;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
  .file-browser {
    position: fixed;
    left: 0;
    top: 124px;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .file-browser.show {
    transform: translateX(0);
  }

  .file-browser.hidden {
    margin-left: 0;
  }

  .terminal-panes-container {
    width: 100%;
  }

  .pane-horizontal {
    flex-direction: column;
  }

  .pane-resize-handle.vertical {
    width: 100%;
    height: 4px;
    top: auto;
    bottom: -2px;
    left: 0;
    right: 0;
    cursor: ns-resize;
  }
}

@media (max-width: 768px) {
  .terminal-header {
    padding: 0.5rem;
  }

  .terminal-actions .icon-btn {
    width: var(--touch-target);
    height: var(--touch-target);
  }

  .tabs-container {
    padding: 0 0.25rem;
  }

  .tab {
    padding: 0 0.5rem;
    font-size: 0.75rem;
  }

  .shortcuts-bar {
    height: 36px;
  }

  .shortcut-btn {
    padding: 0 0.5rem;
    height: 26px;
    font-size: 0.7rem;
  }

  .shortcut-btn span {
    display: none;
  }

  .shortcut-btn svg {
    width: 16px;
  }

  .modal-content {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
  }

  .modal {
    align-items: flex-end;
  }

  .modal-large {
    max-height: 90vh;
  }

  .modal-header {
    padding: 0.75rem 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-body textarea {
    min-height: 200px;
    font-size: 0.8rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .terminal-header-left .terminal-title span {
    display: none;
  }

  .terminal-header-right .terminal-actions {
    gap: 0;
  }

  .terminal-actions .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }

  .terminal-actions .icon-btn:nth-child(n+4) {
    display: none;
  }

  .tabs-bar {
    height: 32px;
  }

  .tab {
    height: 24px;
    padding: 0 0.5rem;
  }

  .file-browser {
    top: 120px;
    width: 100%;
  }

  .mobile-menu-content {
    max-height: 80vh;
  }
}

/* Touch-specific optimizations */
@media (hover: none) and (pointer: coarse) {
  .icon-btn:hover,
  .shortcut-btn:hover,
  .tab:hover,
  .icon-btn-small:hover {
    background: initial;
    color: initial;
  }

  .icon-btn:active,
  .shortcut-btn:active,
  .tab:active,
  .icon-btn-small:active {
    background: var(--bg-hover);
  }

  .pane-close-btn {
    opacity: 0.6;
  }

  .file-item-actions {
    display: flex;
  }
}

/* Dark mode scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
