/* Bridge Workbench - Layout */
/* 3-pane fluid responsive IDE layout */

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

html, body {
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
}

/* Status Bar - Top */
.status-bar {
  height: var(--status-bar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  gap: var(--space-md);
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.back-link:hover { color: var(--accent); }

.status-bar .title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-bright);
}

.status-bar .status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.checking { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.ready { background: var(--success); }
.status-dot.error { background: var(--error); }

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

/* Workbench - 3-pane fluid layout with resize handles */
.workbench {
  display: flex;
  height: calc(100vh - var(--status-bar-height));
  min-height: 0;
  position: relative;
}

.context-rail {
  width: var(--context-rail-width);
  min-width: 150px;
  max-width: 350px;
  background: var(--bg-alt);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  position: relative;
}

.composer {
  flex: 1 1 40%;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.telemetry {
  flex: 1 1 40%;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Resize Handles */
.resize-handle {
  width: 8px;
  background: var(--border);
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  transition: background 0.15s, width 0.15s;
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  background: var(--muted);
  border-radius: 2px;
  opacity: 0.4;
}

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

.resize-handle:hover::before,
.resize-handle.active::before {
  background: white;
  opacity: 0.8;
}

/* Ghost Overlay - Extension not detected */
.ghost-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ghost-overlay.visible { display: flex; }

.ghost-content {
  text-align: center;
  color: var(--muted);
}

.ghost-content svg { margin-bottom: var(--space-lg); }
.ghost-content h2 { color: var(--text); margin-bottom: var(--space-sm); font-size: 18px; }
.ghost-content p { margin-bottom: var(--space-lg); }

.install-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: var(--space-md) var(--space-xl);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
}
.install-btn:hover { background: #1557b0; }

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .context-rail {
    width: 180px;
    min-width: 120px;
  }
  .composer, .telemetry {
    min-width: 200px;
  }
}

@media (max-width: 900px) {
  .workbench {
    flex-direction: column;
  }
  .context-rail {
    width: 100% !important;
    max-width: none;
    height: auto;
    max-height: 200px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    border-right: none;
  }
  .composer, .telemetry {
    width: 100% !important;
    min-width: 0;
    flex: 1;
  }
  .resize-handle {
    display: none;
  }
}

@media (max-width: 600px) {
  .status-bar {
    padding: 0 var(--space-sm);
  }
  .status-bar .title {
    font-size: 12px;
  }
  .context-rail {
    max-height: 150px;
  }
}
