/* ==========================================================================
   IntelliCode - Modern Offline IDE & Copilot Styles
   ========================================================================== */

:root {
  --bg-main: #0b0d14;
  --bg-surface: #121520;
  --bg-surface-elevated: #1a1e2e;
  --bg-input: #151824;
  --border-subtle: #232738;
  --border-focus: #3b82f6;
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: "Fira Code", "JetBrains Mono", Consolas, "SF Mono", Menlo, Monaco, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

/* -------------------------------------------------------------
   Header
   ------------------------------------------------------------- */
.app-header {
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  user-select: none;
  z-index: 10;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 20px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 9px;
  color: var(--accent-emerald);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.title-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  width: 200px;
  outline: none;
}

.title-input:focus {
  color: #fff;
}

.save-status {
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 500;
}

.lang-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-label {
  font-size: 12px;
  color: var(--text-muted);
}

.styled-select, .styled-select-small {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.styled-select:focus, .styled-select-small:focus {
  border-color: var(--border-focus);
}

.styled-select-small {
  padding: 3px 6px;
  font-size: 11px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-icon {
  font-size: 12px;
}

.btn-run {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.btn-run:hover {
  background: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.55);
}

.btn-run:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: #23283c;
  color: #ffffff;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-tiny {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon-only {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon-tiny {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

.btn-icon-tiny:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.system-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  cursor: default;
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* -------------------------------------------------------------
   Main Workspace Layout
   ------------------------------------------------------------- */
.ide-workspace {
  display: flex;
  height: calc(100vh - 52px);
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Left Sidebar */
.sidebar-left {
  width: 250px;
  min-width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-main);
}

.side-tab {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.side-tab:hover {
  color: var(--text-main);
}

.side-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: var(--bg-surface);
}

.tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
}

.sidebar-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.snippets-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.snippet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.snippet-item:hover {
  background: #202538;
  border-color: var(--border-subtle);
}

.snippet-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.snippet-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.snippet-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snippet-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.snippet-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0.4;
  transition: all 0.2s;
}

.snippet-item:hover .snippet-del-btn {
  opacity: 1;
}

.snippet-del-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

.loading-state, .empty-docs-msg {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* DevDocs Search */
.docs-search-box {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-search-box input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
}

.docs-search-box input:focus {
  border-color: var(--border-focus);
}

.docs-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-result-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.doc-result-card:hover {
  border-color: var(--accent-cyan);
}

.doc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-title {
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
}

.doc-title:hover {
  text-decoration: underline;
}

.doc-lib-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  font-weight: 500;
}

.doc-snippet {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  max-height: 55px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* -------------------------------------------------------------
   Center Section (Editor + Console)
   ------------------------------------------------------------- */
.editor-console-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.editor-wrapper {
  flex: 1;
  position: relative;
  min-height: 150px;
  background: var(--bg-main);
}

#editor {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
}

/* Resizer Bar */
.horizontal-resizer {
  height: 5px;
  background: var(--border-subtle);
  cursor: row-resize;
  transition: background 0.2s;
  z-index: 5;
}

.horizontal-resizer:hover, .horizontal-resizer:active {
  background: var(--accent-blue);
}

/* Console Wrapper */
.console-wrapper {
  height: 240px;
  min-height: 100px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.console-header {
  height: 36px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  user-select: none;
}

.console-tabs {
  display: flex;
  height: 100%;
}

.console-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.console-tab:hover {
  color: var(--text-main);
}

.console-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: var(--bg-surface);
}

.runtime-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 2px 6px;
  border-radius: 10px;
}

.badge-count {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  padding: 1px 6px;
  border-radius: 10px;
}

.badge-count.hidden {
  display: none;
}

.console-actions {
  display: flex;
  gap: 6px;
}

.console-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.console-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 10px 14px;
}

.console-pane.active {
  display: block;
}

#outputPane {
  padding: 0 !important;
  display: none;
}

#outputPane.active {
  display: flex !important;
  flex-direction: column;
}

.terminal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  overflow: hidden;
}

.terminal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0b0f19;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
}

.terminal-prompt-sym {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

.terminal-input-field {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 10px;
  transition: border-color 0.2s;
}

.terminal-input-field:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.terminal-send-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.terminal-send-btn:hover {
  background: var(--accent-emerald);
  color: #ffffff;
}

.terminal-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: pulse-terminal 1.5s infinite;
}

@keyframes pulse-terminal {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.btn-stop {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  cursor: pointer;
}

.btn-stop:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.terminal-user-input {
  color: #34d399;
  font-weight: 600;
}

.code-terminal {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f1f5f9;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-dim {
  color: var(--text-dim);
  font-style: italic;
}

.terminal-success {
  color: var(--accent-emerald);
  font-weight: 600;
}

.terminal-error {
  color: var(--accent-rose);
}

.stdin-input {
  width: 100%;
  height: calc(100% - 24px);
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px;
  resize: none;
  outline: none;
}

.stdin-input:focus {
  border-color: var(--border-focus);
}

.stdin-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

#previewIframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* -------------------------------------------------------------
   Right Sidebar (AI Copilot)
   ------------------------------------------------------------- */
.sidebar-right {
  width: 380px;
  min-width: 320px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.copilot-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copilot-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copilot-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.copilot-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.chat-applied-banner {
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #34d399;
}

.chat-banner-btns {
  display: flex;
  gap: 6px;
}

.chat-accept-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chat-accept-btn:hover {
  background: #059669;
}

.chat-discard-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chat-discard-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.copilot-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.ai-action-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.ai-action-btn:hover {
  background: var(--border-subtle);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.copilot-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  user-select: text;
}

.ai-msg, .user-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.user-msg {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  align-self: flex-end;
  max-width: 90%;
}

.ai-msg {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  align-self: flex-start;
  width: 100%;
}

.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.msg-time {
  font-size: 10px;
  color: var(--text-dim);
}

.msg-content {
  color: var(--text-main);
  word-break: break-word;
}

.msg-content p {
  margin-bottom: 8px;
}

.msg-content p:last-child {
  margin-bottom: 0;
}

.msg-content ul, .msg-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.msg-content code:not(pre code) {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
}

/* AI Code Blocks with Action Bar */
.ai-code-block-wrapper {
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: #06080e;
  overflow: hidden;
}

.ai-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f131e;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-code-lang {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 600;
}

.ai-code-actions {
  display: flex;
  gap: 4px;
}

.ai-code-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-code-btn:hover {
  background: var(--bg-surface-elevated);
  color: #ffffff;
  border-color: var(--accent-cyan);
}

.ai-code-btn.btn-replace:hover {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.ai-code-block-wrapper pre {
  margin: 0;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Sources Strip */
.sources-strip {
  padding: 6px 12px;
  background: rgba(139, 92, 246, 0.08);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.sources-strip.hidden {
  display: none;
}

.sources-label {
  font-size: 10px;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 4px;
  display: block;
}

.sources-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.source-chip {
  font-size: 10px;
  background: rgba(139, 92, 246, 0.2);
  color: #ddd6fe;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.source-chip:hover {
  text-decoration: underline;
  background: rgba(139, 92, 246, 0.35);
}

/* Chat Input Area */
.copilot-input-area {
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px;
  resize: none;
  outline: none;
}

.ai-input:focus {
  border-color: var(--border-focus);
}

.copilot-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.hidden {
  display: none !important;
}

/* Cursor animation for streaming */
.streaming-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent-cyan);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 0.8s infinite;
}

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

/* -------------------------------------------------------------
   Responsive Mobile Adjustments
   ------------------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar-left {
    position: absolute;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 20;
    transition: left 0.3s ease;
  }
  .sidebar-left.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6);
  }
  .sidebar-right {
    position: absolute;
    right: -390px;
    top: 0;
    bottom: 0;
    z-index: 20;
    transition: right 0.3s ease;
  }
  .sidebar-right.open {
    right: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.6);
  }
  .title-input {
    width: 120px;
  }
  .system-indicators {
    display: none;
  }
}

/* -------------------------------------------------------------
   VS Code Style Floating Inline AI Edit Bar & Review Bar
   ------------------------------------------------------------- */
.inline-edit-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 640px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.inline-edit-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.inline-edit-sparkle {
  color: #38bdf8;
  font-size: 13px;
}

.inline-edit-title {
  color: #f1f5f9;
}

.inline-edit-shortcut {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #64748b;
  font-family: var(--font-mono);
}

.inline-edit-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-edit-input-row input {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.inline-edit-input-row input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.inline-edit-status {
  font-size: 11.5px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
}

.inline-edit-spinner {
  animation: spin-pulse 1.2s infinite;
}

@keyframes spin-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Review Bar for Accept / Discard */
.edit-review-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 7px 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeInDown 0.2s ease-out;
}

.review-status {
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 5px;
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-accept {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 600;
  border: none !important;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-accept:hover {
  background: #059669 !important;
}

.btn-discard {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  font-weight: 600;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-discard:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}
