/* ===== PROXY MODAL ===== */
.proxy-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
  animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes modalIn { from{opacity:0;transform:scale(0.98)} to{opacity:1;transform:scale(1)} }
.proxy-modal.closing { animation: modalOut 0.22s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes modalOut { from{opacity:1;transform:scale(1)} to{opacity:0;transform:scale(0.98)} }

.proxy-toolbar {
  height: 42px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 8px; gap: 4px; flex-shrink: 0;
}
.proxy-tool-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-secondary); transition: all var(--transition);
}
.proxy-tool-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.proxy-url-bar {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12px;
  color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; margin: 0 4px; position: relative;
}

.proxy-url-bar input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  padding: 0;
  white-space: nowrap;
}

.proxy-url-bar input::-webkit-input-placeholder,
.proxy-url-bar input::-moz-placeholder,
.proxy-url-bar input:-ms-input-placeholder,
.proxy-url-bar input::placeholder {
  color: var(--text-muted);
}

.proxy-url-input.hidden {
  display: none !important;
}

/* Main area */
.proxy-main {
  flex: 1; display: flex; flex-direction: row; overflow: hidden; position: relative;
}

/* Browsing surface: canvas (background) + iframe (proxied document — required for SW/HTML) */
.proxy-viewport {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.proxy-surface-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
  background: #0c0c0e;
}

#proxy-frame {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  min-width: 0;
  min-height: 0;
}

/* ===== DEVTOOLS PANEL ===== */
.proxy-devtools-panel {
  width: 380px; flex-shrink: 0;
  background: #0d0d0d; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: 'Consolas', 'Monaco', monospace;
}

.pdt-header {
  height: 36px; background: #111; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; flex-shrink: 0;
}
.pdt-tabs { display: flex; gap: 2px; }
.pdt-tab {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); border-radius: 4px; cursor: pointer;
  transition: all var(--transition); background: none; border: none;
  font-family: var(--font);
}
.pdt-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.05); }
.pdt-tab.active { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.pdt-close {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.pdt-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

.pdt-body { flex: 1; overflow: hidden; position: relative; }
.pdt-panel { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.pdt-panel.active { display: flex; }

/* Console */
.pdt-console-output {
  flex: 1; overflow-y: auto; padding: 8px; font-size: 11px; line-height: 1.6;
  color: #ccc;
}
.pdt-console-output::-webkit-scrollbar { width: 4px; }
.pdt-console-output::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.pdt-log   { color: #ccc; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pdt-error { color: #ff6b6b; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pdt-warn  { color: #ffd93d; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pdt-info  { color: #74b9ff; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pdt-result { color: #a29bfe; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pdt-cmd   { color: #55efc4; padding: 2px 0; }

.pdt-console-input-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-top: 1px solid rgba(255,255,255,0.08);
  background: #0a0a0a; flex-shrink: 0;
}
.pdt-prompt { color: #55efc4; font-size: 12px; font-weight: 700; }
.pdt-console-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 11px; color: #fff; font-family: 'Consolas', 'Monaco', monospace;
}
.pdt-console-input::placeholder { color: rgba(255,255,255,0.2); }

/* Network */
.pdt-net-list { flex: 1; overflow-y: auto; padding: 4px; font-size: 10px; }
.pdt-net-item {
  display: flex; gap: 8px; padding: 3px 6px; border-radius: 3px;
  color: #aaa; cursor: pointer; transition: background 0.1s;
}
.pdt-net-item:hover { background: rgba(255,255,255,0.05); }
.pdt-net-method { color: #74b9ff; font-weight: 700; width: 36px; flex-shrink: 0; }
.pdt-net-status { width: 28px; flex-shrink: 0; }
.pdt-net-status.ok  { color: #55efc4; }
.pdt-net-status.err { color: #ff6b6b; }
.pdt-net-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Storage */
.pdt-storage-content { flex: 1; overflow-y: auto; padding: 8px; font-size: 11px; }
.pdt-storage-section { margin-bottom: 12px; }
.pdt-storage-title { color: #74b9ff; font-weight: 700; margin-bottom: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.pdt-storage-item { display: flex; gap: 8px; padding: 2px 0; color: #aaa; }
.pdt-storage-key { color: #a29bfe; min-width: 80px; }
.pdt-storage-val { color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* Placeholder */
.pdt-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 10px; color: rgba(255,255,255,0.2); font-size: 11px; text-align: center; padding: 20px;
}
