/* Regex Tester — tool-specific styles */

/* Regex input bar */
.regex-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.pattern-wrap {
  display: flex; align-items: center; gap: 0;
  border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; flex: 1; min-width: 200px;
  transition: border-color 0.15s;
  overflow: hidden;
}
.pattern-wrap:focus-within { border-color: #2563eb; }
.pattern-wrap.error { border-color: #dc2626; background: #fff5f5; }

.pattern-slash {
  padding: 0 8px; font-size: 18px; font-weight: 300;
  color: #94a3b8; font-family: monospace; user-select: none;
  line-height: 32px;
}

#pattern {
  flex: 1; border: none; outline: none; padding: 6px 4px;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 13px; color: #1e293b; background: transparent;
  min-width: 0;
}
#pattern::placeholder { color: #cbd5e1; }

.match-count-badge {
  padding: 0 10px; font-size: 11px; font-weight: 600;
  color: #16a34a; white-space: nowrap; font-family: inherit;
  min-width: 20px;
}

/* Flag buttons */
.flags-wrap {
  display: flex; gap: 3px; align-items: center; flex-shrink: 0;
}
.flag-btn {
  width: 26px; height: 26px; padding: 0;
  border: 1px solid #e2e8f0; border-radius: 4px;
  background: #f8fafc; color: #94a3b8;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Fira Code', monospace; line-height: 1;
  transition: none;
}
.flag-btn:hover { color: #1e293b; opacity: 1; }
.flag-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Highlight output */
.highlight-output {
  flex: 1; min-height: 0; overflow: auto;
  padding: 16px;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.65;
  background: #f8fafc; color: #1e293b;
  white-space: pre-wrap; word-break: break-all;
  border-bottom: 1px solid #e2e8f0;
}
.highlight-output::-webkit-scrollbar { width: 8px; height: 8px; }
.highlight-output::-webkit-scrollbar-track { background: transparent; }
.highlight-output::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

mark.match-hl {
  background: #fef08a; color: #1e293b;
  border-radius: 2px; padding: 0 1px;
  font-style: normal;
}

/* Match list */
.match-list {
  flex-shrink: 0; max-height: 200px; overflow-y: auto;
  background: #fff;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 12px;
}
.match-list::-webkit-scrollbar { width: 6px; }
.match-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

.match-item {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  padding: 5px 14px; border-bottom: 1px solid #f1f5f9;
  line-height: 1.5;
}
.match-item:last-child { border-bottom: none; }
.match-num {
  font-size: 10px; font-weight: 700; color: #94a3b8;
  min-width: 20px; flex-shrink: 0;
}
.match-val {
  background: #fef9c3; color: #854d0e;
  padding: 0 5px; border-radius: 3px; font-size: 12px;
}
.match-pos { color: #94a3b8; font-size: 11px; }
.match-group {
  background: #eff6ff; color: #1d4ed8;
  padding: 0 5px; border-radius: 3px; font-size: 11px;
}

.match-list-empty {
  padding: 12px 16px; color: #94a3b8; font-size: 12px;
  font-family: inherit;
}
