/* ==============================================================================
   AERO 107 — VISUAL STUDIO CODE IDE & COMPILER COMPONENT
   Professional Visual Studio 2022 / VS Code Inspired Dual-Pane Environment
   Strict Constraints: Zero Emojis, 1px Clean Borders, No Box Shadows
   ============================================================================== */

/* Main Container */
.vs-ide {
  background: #1e1e1e;
  border: 1px solid var(--line-strong, #333333);
  border-radius: 10px;
  overflow: hidden;
  margin: 28px 0 36px;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease;
}

[data-theme="light"] .vs-ide {
  background: #ffffff;
  border-color: #d4d4d8;
}

.vs-ide:focus-within {
  border-color: #007acc;
}

/* ---------------- Topbar & Command Ribbon ---------------- */
.vs-ide-topbar {
  background: #252526;
  border-bottom: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  height: 38px;
  user-select: none;
  gap: 8px;
}

[data-theme="light"] .vs-ide-topbar {
  background: #f3f3f3;
  border-bottom-color: #e5e5e5;
}

.vs-ide-tabs {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
}

.vs-ide-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1e1e1e;
  color: #cccccc;
  font-size: 12px;
  padding: 0 12px;
  height: 100%;
  border-top: 2px solid #007acc;
  border-right: 1px solid #333333;
  border-left: 1px solid #333333;
  font-weight: 500;
  white-space: nowrap;
}

[data-theme="light"] .vs-ide-tab {
  background: #ffffff;
  color: #24292f;
  border-top-color: #007acc;
  border-right-color: #e5e5e5;
  border-left-color: #e5e5e5;
}

.vs-ide-tab-icon {
  font-size: 10.5px;
  font-weight: 700;
  color: #007acc;
  background: rgba(0, 122, 204, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: .02em;
}

.vs-ide-tab-dirty {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2c08d;
  display: none;
}

.vs-ide-tab.is-dirty .vs-ide-tab-dirty {
  display: inline-block;
}

/* Actions Toolbar */
.vs-ide-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vs-ide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

/* Run Button */
.vs-btn-run {
  background: #16825d;
  color: #ffffff;
  border-color: #107c41;
}

.vs-btn-run:hover {
  background: #1da374;
}

.vs-btn-run:active {
  background: #0f6145;
}

/* Secondary Buttons */
.vs-btn-secondary {
  background: transparent;
  color: #cccccc;
  border-color: #3e3e42;
}

[data-theme="light"] .vs-btn-secondary {
  color: #4b5563;
  border-color: #d1d5db;
  background: #ffffff;
}

.vs-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

[data-theme="light"] .vs-btn-secondary:hover {
  background: #f3f4f6;
  color: #111827;
}

.vs-ide-badge {
  font-size: 10px;
  color: #858585;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border: 1px solid #3e3e42;
  border-radius: 3px;
  margin-left: 4px;
  display: none;
}

@media (min-width: 768px) {
  .vs-ide-badge {
    display: inline-block;
  }
}

[data-theme="light"] .vs-ide-badge {
  border-color: #e5e5e5;
  color: #6b7280;
}

/* ---------------- Split View (Editor Left | Output Right) ---------------- */
.vs-ide-split {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 280px;
  background: #1e1e1e;
}

@media (min-width: 900px) {
  .vs-ide-split {
    grid-template-columns: 56% 44%;
  }
}

[data-theme="light"] .vs-ide-split {
  background: #ffffff;
}

/* ---------------- Left Pane: Code Editor ---------------- */
.vs-ide-editor-pane {
  display: flex;
  position: relative;
  background: #1e1e1e;
  border-bottom: 1px solid #333333;
  min-height: 240px;
  max-height: 520px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .vs-ide-editor-pane {
    border-bottom: none;
    border-right: 1px solid #333333;
  }
}

[data-theme="light"] .vs-ide-editor-pane {
  background: #ffffff;
  border-color: #e5e5e5;
}

.vs-ide-gutter {
  width: 44px;
  background: #1e1e1e;
  border-right: 1px solid #2d2d30;
  padding: 14px 6px 14px 0;
  text-align: right;
  font-size: 12px;
  line-height: 21px;
  color: #5a5a5a;
  user-select: none;
  box-sizing: border-box;
  overflow: hidden;
}

[data-theme="light"] .vs-ide-gutter {
  background: #fafafa;
  border-right-color: #e5e5e5;
  color: #9ca3af;
}

.vs-ide-gutter div {
  line-height: 21px;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.vs-ide-editor-wrap {
  flex: 1;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.vs-ide-textarea {
  width: 100%;
  height: 100%;
  min-height: 240px;
  padding: 14px 16px;
  border: none;
  outline: none;
  background: transparent;
  color: #d4d4d4;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12.5px;
  line-height: 21px;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  tab-size: 4;
  -moz-tab-size: 4;
  box-sizing: border-box;
}

[data-theme="light"] .vs-ide-textarea {
  color: #111827;
}

/* ---------------- Right Pane: Output & Diagnostics ---------------- */
.vs-ide-output-pane {
  display: flex;
  flex-direction: column;
  background: #181818;
  min-height: 240px;
  max-height: 520px;
  overflow: hidden;
}

[data-theme="light"] .vs-ide-output-pane {
  background: #f9fafb;
}

/* Output Tabs */
.vs-output-tabs {
  background: #252526;
  border-bottom: 1px solid #333333;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 4px;
  gap: 2px;
  user-select: none;
}

[data-theme="light"] .vs-output-tabs {
  background: #f3f3f3;
  border-bottom-color: #e5e5e5;
}

.vs-out-tab {
  background: transparent;
  border: none;
  outline: none;
  color: #969696;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s ease;
}

[data-theme="light"] .vs-out-tab {
  color: #6b7280;
}

.vs-out-tab:hover {
  color: #ffffff;
}

[data-theme="light"] .vs-out-tab:hover {
  color: #111827;
}

.vs-out-tab.active {
  color: #ffffff;
  border-bottom-color: #007acc;
  font-weight: 600;
}

[data-theme="light"] .vs-out-tab.active {
  color: #007acc;
  border-bottom-color: #007acc;
}

/* Tab Views Container */
.vs-output-views {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.6;
}

.vs-view-tab {
  display: none;
}

.vs-view-tab.active {
  display: block;
}

/* View 1: Console Output */
.vs-console-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
}

.vs-log-line {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
}

.vs-log-line.system {
  color: #6a9955;
}

.vs-log-line.info {
  color: #9cdcfe;
}

.vs-log-line.print {
  color: #ce9178;
}

.vs-log-line.success {
  color: #4ec9b0;
}

.vs-log-line.error {
  color: #f14c4c;
  background: rgba(241, 76, 76, 0.1);
  padding: 2px 6px;
  border-left: 3px solid #f14c4c;
  border-radius: 2px;
}

[data-theme="light"] .vs-log-line.system {
  color: #008000;
}

[data-theme="light"] .vs-log-line.info {
  color: #005a9e;
}

[data-theme="light"] .vs-log-line.print {
  color: #a31515;
}

[data-theme="light"] .vs-log-line.success {
  color: #0f766e;
}

[data-theme="light"] .vs-log-line.error {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* View 2: Watch / Variable Table */
.vs-watch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.vs-watch-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #333333;
  color: #858585;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10.5px;
}

[data-theme="light"] .vs-watch-table th {
  border-bottom-color: #e5e5e5;
  color: #6b7280;
}

.vs-watch-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #d4d4d4;
  vertical-align: top;
}

[data-theme="light"] .vs-watch-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
  color: #1f2937;
}

.vs-var-name {
  color: #9cdcfe;
  font-weight: 500;
}

[data-theme="light"] .vs-var-name {
  color: #005a9e;
}

.vs-var-val {
  color: #b5cea8;
}

[data-theme="light"] .vs-var-val {
  color: #098658;
}

.vs-var-type {
  color: #4ec9b0;
  font-size: 11px;
}

[data-theme="light"] .vs-var-type {
  color: #2b91af;
}

/* View 3: Error List */
.vs-error-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #2d2d30;
  font-size: 11.5px;
}

[data-theme="light"] .vs-error-item {
  border-bottom-color: #e5e5e5;
}

.vs-error-code {
  color: #f14c4c;
  font-weight: 600;
  min-width: 60px;
}

.vs-error-desc {
  flex: 1;
  color: #cccccc;
}

[data-theme="light"] .vs-error-desc {
  color: #374151;
}

.vs-error-line {
  color: #858585;
}

/* ---------------- Bottom Status Bar ---------------- */
.vs-ide-statusbar {
  background: #007acc;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 400;
  user-select: none;
  height: 22px;
  box-sizing: border-box;
}

.vs-status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vs-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.vs-status-dot.running {
  background: #ffd700;
  animation: vsPulse 1s infinite;
}

.vs-status-dot.error {
  background: #ff5555;
}

@keyframes vsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.vs-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.9;
}

/* ---------------- Fullscreen Modal Mode ---------------- */
.vs-ide.is-fullscreen {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.75) !important;
}

.vs-ide.is-fullscreen .vs-ide-split {
  height: calc(100vh - 32px - 38px - 22px);
  max-height: none;
}

.vs-ide.is-fullscreen .vs-ide-editor-pane,
.vs-ide.is-fullscreen .vs-ide-output-pane {
  max-height: none;
  height: 100%;
}

/* ---------------- Interactive MessageBox Simulation ---------------- */
.vs-msgbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-msgbox-card {
  width: 90%;
  max-width: 420px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #999999;
  border-radius: 6px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: none !important;
  animation: vsBoxPop .18s ease-out;
}

[data-theme="dark"] .vs-msgbox-card {
  background: #252526;
  color: #cccccc;
  border-color: #454545;
}

@keyframes vsBoxPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.vs-msgbox-header {
  background: #f0f0f0;
  border-bottom: 1px solid #d9d9d9;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .vs-msgbox-header {
  background: #2d2d30;
  border-bottom-color: #3e3e42;
  color: #ffffff;
}

.vs-msgbox-body {
  padding: 20px 20px 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}

.vs-msgbox-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.vs-msgbox-footer {
  background: #f0f0f0;
  border-top: 1px solid #d9d9d9;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

[data-theme="dark"] .vs-msgbox-footer {
  background: #2d2d30;
  border-top-color: #3e3e42;
}

.vs-msgbox-btn {
  min-width: 72px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  background: #e1e1e1;
  color: #000000;
  border: 1px solid #adadad;
  border-radius: 3px;
  cursor: pointer;
}

[data-theme="dark"] .vs-msgbox-btn {
  background: #3e3e42;
  color: #ffffff;
  border-color: #555555;
}

.vs-msgbox-btn:hover {
  background: #e5f1fb;
  border-color: #0078d7;
}

[data-theme="dark"] .vs-msgbox-btn:hover {
  background: #505054;
  border-color: #007acc;
}
