/* ==========================================================================
   WARP-SURGEON: PRO TACTICAL STUDIO DESIGN SYSTEM
   Prefix: ws-* (Strictly Scoped Zero Collision)
   ========================================================================== */

.ws-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 9, 11, 0.88);
  backdrop-filter: blur(10px);
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-overlay.ws-active {
  opacity: 1;
  pointer-events: auto;
}

.ws-overlay.ws-embedded {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  background: transparent;
  backdrop-filter: none;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.ws-modal-card {
  width: 98vw;
  height: 96vh;
  max-width: 1720px;
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  position: relative;
}

.ws-modal-card.ws-card-embedded {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 8px;
  box-shadow: none;
}

/* ==========================================================================
   HEADER CONTROL BAR
   ========================================================================== */
.ws-header {
  height: 44px;
  padding: 0 16px;
  background: #0e0e0e;
  border-bottom: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
  flex-shrink: 0;
}

.ws-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ws-brand-pill {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #f5f5f5;
  background: #141414;
  border: 1px solid #282828;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.ws-filepath-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: #e3e5eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-filepath-breadcrumb .ws-dir {
  color: #6c7284;
  font-weight: 400;
}

.ws-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   MAIN SURGICAL VIEWPORT
   ========================================================================== */
.ws-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  background: #000000;
  overflow: hidden;
}

.ws-editor-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.ws-gutter {
  width: 48px;
  min-width: 40px;
  background: #0a0a0a;
  border-right: 1px solid #1a1a1a;
  color: #6b7280;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 22px;
  padding: 12px 8px 12px 0;
  text-align: right;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
  white-space: pre;
}

.ws-gutter-line {
  display: block;
  height: 22px;
  line-height: 22px;
}

.ws-code-textarea {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 14px;
  color: #f3f4f6;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 22px;
  tab-size: 2;
  resize: none;
  white-space: pre;
  overflow: auto;
}

@media (max-width: 768px) {
  .ws-code-textarea {
    font-size: 16px;
  }
}

/* ==========================================================================
   FLOATING CMD+F SEARCH/REPLACE OVERLAY
   ========================================================================== */
.ws-floating-search {
  position: absolute;
  top: 10px;
  right: 24px;
  background: #0a0a0a;
  border: 1px solid #282828;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
  z-index: 100;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.14s ease;
}

.ws-floating-search.ws-search-active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ws-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-search-input {
  background: #000000;
  border: 1px solid #222222;
  border-radius: 4px;
  padding: 4px 8px;
  color: #f3f4f6;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  width: 170px;
  outline: none;
}

.ws-search-input:focus {
  border-color: #444444;
}

.ws-search-count {
  font-size: 10px;
  color: #8e95a5;
  font-family: var(--font-mono, monospace);
  min-width: 48px;
}

/* ==========================================================================
   DRAWER 1: DIAGNOSTIC RADAR (COLLAPSIBLE)
   ========================================================================== */
.ws-radar-drawer {
  width: 320px;
  background: #0a0a0a;
  border-left: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ws-radar-drawer.ws-collapsed {
  width: 0;
  border-left: none;
}

@media (max-width: 1024px) {
  .ws-radar-drawer:not(.ws-collapsed), .ws-diff-drawer:not(.ws-collapsed) {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100% !important;
    max-width: 480px;
    z-index: 150;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.85);
  }
}

.ws-pane-header {
  height: 34px;
  padding: 0 12px;
  background: #0e0e0e;
  border-bottom: 1px solid #1f1f1f;
  font-size: 10px;
  font-weight: 700;
  color: #8e95a5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.ws-radar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-radar-card {
  background: #000000;
  border: 1px solid #222222;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ws-radar-card:hover {
  border-color: #444444;
  background: #141414;
}

.ws-radar-card.ws-card-arch { border-left: 3px solid #f5a623; }
.ws-radar-card.ws-card-secret { border-left: 3px solid #ff3333; }
.ws-radar-card.ws-card-hallucination { border-left: 3px solid #f5a623; }

.ws-radar-title {
  font-size: 11px;
  font-weight: 600;
  color: #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ws-radar-snippet {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #8e95a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   DRAWER 2: LIVE DIFF COMPANION (COLLAPSIBLE)
   ========================================================================== */
.ws-diff-drawer {
  width: 440px;
  background: #0a0a0a;
  border-left: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ws-diff-drawer.ws-collapsed {
  width: 0;
  border-left: none;
}

.ws-diff-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  line-height: 1.6;
  background: #000000;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ws-diff-row {
  display: flex;
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 6px;
  border-radius: 2px;
}

.ws-diff-add {
  background: rgba(100, 255, 204, 0.08);
  color: #64ffcc;
}

.ws-diff-del {
  background: rgba(255, 133, 133, 0.08);
  color: #ff8585;
  text-decoration: line-through;
}

.ws-diff-ctx {
  color: #666666;
}

/* ==========================================================================
   IDE-GRADE BOTTOM STATUS BAR
   ========================================================================== */
.ws-status-bar {
  height: 26px;
  padding: 0 12px;
  background: #08080a;
  border-top: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #8e95a5;
  user-select: none;
  flex-shrink: 0;
}

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

.ws-status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-status-item.ws-status-interactive {
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  transition: all 0.1s ease;
}

.ws-status-item.ws-status-interactive:hover {
  background: #141414;
  color: #ffffff;
}

.ws-status-deltas-add { color: #64ffcc; font-weight: 600; }
.ws-status-deltas-del { color: #ff8585; font-weight: 600; }