.insert-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.insert-modal {
  background: var(--color-bg-secondary, #1e1e1e);
  border: 1px solid var(--color-border, #3c3c3c);
  border-radius: 8px;
  width: 600px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.insert-modal-header {
  padding: 16px 20px 0;
  border-bottom: 1px solid var(--color-border, #3c3c3c);
}

.insert-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #fff);
  margin: 0 0 12px 0;
}

.insert-modal-tabs {
  display: flex;
  gap: 0;
  margin: 0 -20px;
  border-bottom: none;
}

.insert-modal-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted, #888);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.insert-modal-tab:hover {
  color: var(--color-text, #ccc);
  background: var(--color-bg-tertiary, #252526);
}

.insert-modal-tab.active {
  color: var(--color-text, #fff);
  border-bottom-color: var(--color-primary, #0e639c);
  background: var(--color-bg-tertiary, #252526);
}

.insert-modal-search {
  border-bottom: 1px solid var(--color-border, #3c3c3c);
}

.insert-modal-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  background: transparent;
  border: none;
  color: var(--color-text, #ccc);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.insert-modal-input::placeholder {
  color: var(--color-text-muted, #888);
}

.insert-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 200px;
}

.insert-modal-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-text-muted, #888);
  font-size: 14px;
  text-align: center;
}

.insert-modal-result-item {
  padding: 12px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background-color 0.15s ease;
}

.insert-modal-result-item:hover,
.insert-modal-result-item.selected {
  background: var(--color-bg-tertiary, #2a2a2a);
}

.insert-modal-result-item.selected {
  border-left: 3px solid var(--color-primary, #0e639c);
  padding-left: 13px;
}

.insert-modal-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #fff);
  margin-bottom: 4px;
}

.insert-modal-result-excerpt {
  font-size: 12px;
  color: var(--color-text-muted, #888);
  line-height: 1.4;
  margin-bottom: 4px;
}

.insert-modal-result-path,
.insert-modal-result-meta {
  font-size: 11px;
  color: var(--color-text-muted, #666);
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

.insert-modal-external {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 200px;
}

.insert-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insert-modal-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insert-modal-field .insert-modal-input {
  padding: 10px 12px;
  border: 1px solid var(--color-border, #3c3c3c);
  border-radius: 4px;
  background: var(--color-bg-primary, #1a1a1a);
}

.insert-modal-field .insert-modal-input:focus {
  border-color: var(--color-primary, #0e639c);
}

.insert-modal-submit {
  margin-top: 8px;
  padding: 10px 20px;
  background: var(--color-primary, #0e639c);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  align-self: flex-start;
}

.insert-modal-submit:hover:not(:disabled) {
  background: var(--color-primary-hover, #1177bb);
}

.insert-modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.insert-modal-footer {
  border-top: 1px solid var(--color-border, #3c3c3c);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
}

.insert-modal-footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.insert-modal-hint {
  font-size: 11px;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insert-modal-format-hint {
  font-size: 11px;
  color: var(--color-text-muted, #888);
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

/* Scrollbar styling */
.insert-modal-results::-webkit-scrollbar {
  width: 8px;
}

.insert-modal-results::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #1e1e1e);
}

.insert-modal-results::-webkit-scrollbar-thumb {
  background: var(--color-border, #3c3c3c);
  border-radius: 4px;
}

.insert-modal-results::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted, #555);
}

/* Create post option */
.insert-modal-result-create {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-top: 1px solid var(--color-border, #3c3c3c);
  margin-top: 4px;
  padding-top: 16px;
  background: transparent;
  color: var(--vscode-notificationsInfoIcon-foreground, #75beff);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 0 0 4px 4px;
  transition: background-color 0.15s ease;
}

.insert-modal-result-create:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 12px;
}

.insert-modal-result-create:hover,
.insert-modal-result-create.selected {
  background: var(--color-bg-tertiary, #2a2a2a);
}

.insert-modal-result-create.selected {
  border-left: 3px solid var(--vscode-notificationsInfoIcon-foreground, #75beff);
  padding-left: 13px;
}

.insert-modal-result-create:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.insert-modal-create-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px dashed currentColor;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
