proxelar 0.4.0

MITM proxy for HTTP/HTTPS traffic
:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --border: #0f3460;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #e94560;
    --highlight: #0f3460;
    --get: #4caf50;
    --post: #ff9800;
    --put: #2196f3;
    --delete: #f44336;
    --patch: #9c27b0;
    --status-2xx: #4caf50;
    --status-3xx: #00bcd4;
    --status-4xx: #ff9800;
    --status-5xx: #f44336;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f5f5;
        --surface: #fff;
        --border: #ddd;
        --text: #333;
        --text-muted: #666;
        --highlight: #e3f2fd;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 { font-size: 18px; color: var(--accent); }

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

.controls select, .controls input, .controls button {
    padding: 6px 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}

.controls button:hover { background: var(--border); cursor: pointer; }

.status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.status.connected { background: #1b5e20; color: #4caf50; }
.status.disconnected { background: #b71c1c33; color: #f44336; }

main {
    flex: 1;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
}

td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
}

tr:hover { background: var(--highlight); cursor: pointer; }
tr.selected { background: var(--highlight); }

.method-get { color: var(--get); font-weight: 600; }
.method-post { color: var(--post); font-weight: 600; }
.method-put { color: var(--put); font-weight: 600; }
.method-delete { color: var(--delete); font-weight: 600; }
.method-patch { color: var(--patch); font-weight: 600; }

.status-2xx { color: var(--status-2xx); }
.status-3xx { color: var(--status-3xx); }
.status-4xx { color: var(--status-4xx); }
.status-5xx { color: var(--status-5xx); }
.status-pending { color: #f59e0b; font-weight: 600; }

/* ── Intercept toggle button ─────────────────────────────────────────── */

#intercept-btn {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
    transition: background 0.2s, color 0.2s;
}

#intercept-btn:hover { background: #4b5563; cursor: pointer; }

#intercept-btn.active {
    background: #991b1b;
    color: #fca5a5;
    border-color: #dc2626;
}

/* ── Pending request rows ────────────────────────────────────────────── */

tr.pending {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

tr.pending:hover { background: rgba(245, 158, 11, 0.12); }

/* ── Intercept editor panel ──────────────────────────────────────────── */

.intercept-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60%;
    background: var(--surface);
    border-top: 2px solid #f59e0b;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.intercept-panel.hidden { display: none; }

.intercept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(245, 158, 11, 0.1);
}

.intercept-title {
    font-weight: 600;
    color: #f59e0b;
    font-size: 13px;
}

#close-intercept {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

.intercept-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intercept-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intercept-row label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.intercept-row select, .intercept-row input {
    padding: 5px 8px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}

.intercept-row input { flex: 1; }

.intercept-section-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.headers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.headers-table td { padding: 2px 4px; }

.headers-table input.header-name,
.headers-table input.header-value {
    width: 100%;
    padding: 4px 6px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.edit-body {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
}

.intercept-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    gap: 8px;
}

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

.intercept-actions {
    display: flex;
    gap: 8px;
}

.btn-primary {
    padding: 6px 16px;
    background: #1d4ed8;
    color: #fff;
    border: 1px solid #2563eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.btn-primary:hover { background: #2563eb; }

.btn-danger {
    padding: 6px 16px;
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.btn-danger:hover { background: #991b1b; }

.btn-secondary {
    padding: 6px 16px;
    background: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.btn-secondary:hover { background: #4b5563; }

.btn-small {
    padding: 2px 8px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}
.btn-small:hover { background: var(--border); }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}
.btn-icon:hover { color: var(--accent); }

.detail-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: var(--surface);
    border-top: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.detail-panel.hidden { display: none; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.tabs { display: flex; gap: 4px; }

.tab {
    padding: 4px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

#close-detail {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

.detail-content {
    flex: 1;
    overflow: auto;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}