:root {
  --bg-app: #0c0d10;
  --bg-window: #131418;
  --bg-sidebar: #17181d;
  --bg-panel: #131418;
  --bg-item-hover: #1e2027;
  --bg-item-active: #252832;
  --border-color: #262933;
  --border-subtle: #1e2027;
  --text-main: #f1f3f7;
  --text-muted: #8b92a1;
  --text-dim: #5c6370;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --code-bg: #111215;
  --badge-get: #3b82f6;
  --badge-post: #f1f3f7;
  --badge-put: #f59e0b;
  --badge-delete: #ef4444;
  --badge-patch: #a855f7;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

/* App Window Shell */
.window-container {
  width: 100%;
  max-width: 1400px;
  height: 90vh;
  min-height: 700px;
  background: var(--bg-window);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.window-controls-bar {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(19, 20, 24, 0.7);
  backdrop-filter: blur(8px);
}

.traffic-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar */
.sidebar {
  width: 340px;
  min-width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 24px;
  line-height: 1;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.icon-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-button:hover {
  background: var(--bg-item-hover);
  color: var(--text-main);
}

/* Endpoint Selector Pill */
.endpoint-selector-wrapper {
  padding: 0 16px 14px;
  position: relative;
}

.endpoint-pill {
  background: #111216;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.endpoint-pill:hover {
  border-color: #383d4c;
  background: #15171d;
}

.endpoint-slug-text {
  font-size: 13px;
  font-weight: 500;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.endpoint-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.endpoint-btn-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.endpoint-btn-copy:hover {
  color: #ffffff;
}

.chevron-icon {
  color: var(--text-muted);
  font-size: 11px;
}

/* Endpoint Dropdown Menu */
.endpoint-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 16px;
  right: 16px;
  background: #16171d;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  padding: 8px;
  display: none;
}

.endpoint-dropdown-menu.active {
  display: block;
}

.endpoint-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.endpoint-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.endpoint-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: background 0.15s;
}

.endpoint-list-item:hover {
  background: var(--bg-item-hover);
}

.endpoint-list-item.selected {
  background: var(--bg-item-active);
  font-weight: 600;
  color: var(--accent);
}

.btn-new-endpoint {
  width: 100%;
  background: #252833;
  border: 1px dashed var(--border-color);
  color: var(--text-main);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-new-endpoint:hover {
  background: #2f3442;
  border-color: var(--accent);
}

/* Requests Bar Header */
.requests-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 6px;
  border-top: 1px solid var(--border-subtle);
}

.requests-bar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.btn-select-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-select-toggle:hover {
  background: var(--bg-item-hover);
  color: var(--text-main);
  border-color: #3b4252;
}

.btn-select-toggle.active {
  background: var(--accent);
  color: #0b1329;
  border-color: var(--accent);
  font-weight: 600;
}

/* Selection Actions Bar */
.selection-actions-bar {
  background: #14151b;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 14px;
  margin: 0 8px 6px;
  border-radius: 8px;
}

.selection-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.selection-counter {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.selection-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-selected {
  flex: 1;
  background: var(--accent);
  border: none;
  color: #0b1329;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-copy-selected:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-copy-selected:disabled {
  background: #252833;
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-delete-selected {
  background: #252833;
  border: none;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-delete-selected:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.btn-delete-selected:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-cancel-selection {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-cancel-selection:hover {
  background: var(--bg-item-hover);
  color: var(--text-main);
}

/* Checkbox inside Request Item */
.req-chk-wrapper {
  margin-right: 10px;
  display: flex;
  align-items: center;
}

.req-checkbox, #chk-select-all {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

/* Request List in Sidebar */
.requests-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px;
}

.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  position: relative;
}

.request-item:hover {
  background: var(--bg-item-hover);
}

.request-item.active {
  background: var(--bg-item-active);
}

.btn-select-toggle.active {
  background: var(--accent);
  color: #0b1329;
  font-weight: 600;
}

/* Group Item in Sidebar */
.group-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.group-item:hover {
  background: var(--bg-item-hover);
  border-color: var(--border-color);
}

.group-item.active {
  background: var(--bg-item-active);
  border-color: var(--accent);
}

.group-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.group-id-text {
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.group-count-badge {
  background: #252833;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
}

.group-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.req-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.req-method {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.req-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.req-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
}

.request-item:hover .req-delete-btn,
.request-item.active .req-delete-btn {
  opacity: 1;
}

.req-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

/* Main Detail Panel */
.main-panel {
  flex: 1;
  background: var(--bg-panel);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-content {
  padding: 28px 36px;
  max-width: 1000px;
}

.request-title-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-method {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
}

.detail-path {
  font-size: 24px;
  font-weight: 400;
  color: #94a3b8;
  word-break: break-all;
}

.info-pill-bar {
  background: #181920;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.info-ip {
  color: #ffffff;
  font-weight: 500;
}

.info-country-flag {
  font-size: 16px;
}

/* Feature Tip Banner */
.tip-banner {
  background: linear-gradient(135deg, rgba(30, 32, 40, 0.8), rgba(20, 22, 28, 0.8));
  border: 1px dashed #2f333f;
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.tip-banner strong {
  color: #ffffff;
}

/* Section Containers */
.section-wrapper {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.btn-action {
  background: #1e2027;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-action:hover {
  background: #282c37;
  border-color: #3b4252;
}

/* Headers Table */
.headers-table-card {
  background: #15161b;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.header-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.header-row:last-child {
  border-bottom: none;
}

.header-key {
  width: 240px;
  min-width: 200px;
  padding: 10px 16px;
  color: #9aa1b0;
  background: rgba(255, 255, 255, 0.015);
  border-right: 1px solid var(--border-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.header-val {
  flex: 1;
  padding: 10px 16px;
  color: #f1f5f9;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

/* Insomnia Code Editor Theme */
.badge-insomnia {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #a0a5b5;
  background: #191a22;
  border: 1px solid #282937;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.insomnia-code-container {
  background-color: #000000;
  border: 1px solid #1c1d24;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 3px rgba(0, 0, 0, 0.9);
}

.insomnia-editor-body {
  display: flex;
  background-color: #000000;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 24px;
  overflow-x: auto;
  padding: 14px 0;
}

/* Left Gutter with line numbers */
.insomnia-gutter {
  display: flex;
  flex-direction: column;
  user-select: none;
  padding: 0 8px 0 14px;
  text-align: right;
  color: #555866;
  border-right: 1px solid #16171d;
  min-width: 48px;
}

.insomnia-gutter-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 24px;
  line-height: 24px;
  gap: 5px;
}

.insomnia-gutter-line .line-num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #555866;
}

.insomnia-fold-arrow {
  font-size: 10px;
  color: #616575;
  cursor: pointer;
  user-select: none;
  width: 10px;
  text-align: center;
  transition: color 0.15s;
}

.insomnia-fold-arrow:hover {
  color: #48e589;
}

/* Code area */
.insomnia-code-lines {
  flex: 1;
  padding: 0 18px;
  white-space: pre;
  color: #f8f8f2;
}

.insomnia-code-line {
  height: 24px;
  line-height: 24px;
}

/* Insomnia Color Tokens matching the screenshot */
.json-insomnia-key {
  color: #48e589; /* Vibrant Insomnia Green */
  font-weight: 500;
}

.json-insomnia-string {
  color: #f3e36e; /* Vibrant Insomnia Yellow */
}

.json-insomnia-number {
  color: #ff9f43; /* Insomnia Orange */
}

.json-insomnia-boolean {
  color: #bd93f9; /* Insomnia Purple */
  font-weight: 600;
}

.json-insomnia-null {
  color: #8be9fd; /* Cyan italic */
  font-style: italic;
}

.json-insomnia-punct {
  color: #f8f8f2; /* Clean White */
}

.json-insomnia-brace {
  color: #f8f8f2;
  display: inline-block;
}

.json-insomnia-brace.bracket-match {
  border-bottom: 2px solid #f3e36e;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  max-width: 440px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.curl-box {
  background: #111216;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 18px;
  font-family: monospace;
  font-size: 12px;
  color: #a5f3fc;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
}

/* Modal for New Webhook Path */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  background: #17181f;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 440px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

.input-field {
  width: 100%;
  background: #0f1013;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #ffffff;
  outline: none;
  margin-bottom: 18px;
}

.input-field:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: #252833;
  border: none;
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary {
  background: var(--accent);
  border: none;
  color: #0b1329;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
