/* tools/regex-tester/css/style.css — Tool-specific styles */

/* Regex input bar */
#regex-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; background: #1e1e2e; border-bottom: 2px solid #45475a;
}
.regex-delimiter {
  color: #f9e2af; font-family: monospace; font-size: 20px; font-weight: 700;
}
#regex-input {
  flex: 1; background: #313244; border: 1px solid #45475a; border-radius: 4px;
  padding: 8px 10px; color: #cdd6f4; font-family: 'Fira Code', monospace; font-size: 15px;
  outline: none;
}
#regex-input:focus { border-color: #89b4fa; }
#regex-input.error { border-color: #f38ba8; }

/* Flag toggles */
#flag-toggles { display: flex; gap: 4px; }
.flag-btn {
  background: #313244; color: #6c7086; border: 1px solid #45475a;
  border-radius: 4px; padding: 6px 10px; font-family: monospace; font-size: 14px;
  cursor: pointer; font-weight: 600;
}
.flag-btn:hover { background: #45475a; }
.flag-btn.active { background: #a6e3a1; color: #1e1e2e; border-color: #a6e3a1; }

/* Templates dropdown */
#templates-wrapper { position: relative; }
#templates-btn {
  background: #89b4fa; color: #1e1e2e; border: none; border-radius: 4px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
#templates-btn:hover { background: #74c7ec; }
#templates-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; background: #313244;
  border: 1px solid #45475a; border-radius: 6px; padding: 6px 0;
  min-width: 260px; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-height: 400px; overflow-y: auto;
}
.template-category {
  padding: 4px 14px; color: #6c7086; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1px; margin-top: 4px;
}
.template-item {
  padding: 6px 14px; color: #cdd6f4; font-size: 13px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.template-item:hover { background: #45475a; }
.template-item .template-pattern {
  color: #6c7086; font-family: monospace; font-size: 11px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Explanation bar */
#explanation-bar {
  padding: 6px 14px; background: #181825; border-bottom: 1px solid #313244;
  font-size: 13px; min-height: 30px;
}
#explanation-text { color: #a6adc8; }
#explanation-text.error { color: #f38ba8; }
#explanation-text.empty { color: #6c7086; }

/* Main area */
#main { display: flex; flex: 1; min-height: 0; }

/* Test string pane */
#test-pane { flex: 1; display: flex; flex-direction: column; border-right: 2px solid #45475a; min-width: 0; }
.pane-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: #181825; font-size: 12px; color: #6c7086;
  border-bottom: 1px solid #313244;
}
.badge { font-size: 11px; background: #313244; padding: 2px 8px; border-radius: 3px; }

/* Overlay highlight container */
#test-container { flex: 1; position: relative; overflow: auto; }
#test-highlights {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  padding: 12px; font-family: 'Fira Code', monospace; font-size: 14px;
  line-height: 1.6; white-space: pre-wrap; word-wrap: break-word;
  color: transparent; pointer-events: none;
}
#test-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  padding: 12px; font-family: 'Fira Code', monospace; font-size: 14px;
  line-height: 1.6; background: transparent; color: #cdd6f4;
  border: none; outline: none; resize: none; white-space: pre-wrap;
  word-wrap: break-word;
}
#test-container { background: #1e1e2e; }

/* Highlight styles */
.hl-match { background: rgba(137, 180, 250, 0.3); border-radius: 2px; }
.hl-group-0 { background: rgba(166, 227, 161, 0.3); border-radius: 2px; }
.hl-group-1 { background: rgba(249, 226, 175, 0.3); border-radius: 2px; }
.hl-group-2 { background: rgba(243, 139, 168, 0.3); border-radius: 2px; }
.hl-group-3 { background: rgba(203, 166, 247, 0.3); border-radius: 2px; }
.hl-group-4 { background: rgba(148, 226, 213, 0.3); border-radius: 2px; }

/* Results pane */
#results-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#results-content { flex: 1; overflow-y: auto; padding: 12px; }
.section-title {
  font-size: 12px; color: #6c7086; text-transform: uppercase;
  letter-spacing: 1px; margin: 0 0 8px 0; font-weight: 600;
}
.section-title span { color: #89b4fa; }

/* Match table */
.match-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.match-th {
  text-align: left; padding: 4px 8px; color: #6c7086; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #45475a; white-space: nowrap;
}
.match-row:hover { background: #313244; }
.match-td { padding: 5px 8px; border-bottom: 1px solid #313244; vertical-align: top; }
.match-index { color: #6c7086; font-size: 11px; width: 30px; }
.match-text { color: #a6e3a1; font-family: monospace; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-pos { color: #6c7086; font-size: 11px; white-space: nowrap; }
.group-value { color: #f9e2af; font-family: monospace; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-empty { color: #45475a; }
.no-results { color: #6c7086; font-size: 13px; font-style: italic; }

/* Code generation */
#codegen-section { margin-top: 16px; }
#codegen-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.codegen-tab {
  background: #313244; color: #6c7086; border: 1px solid #45475a;
  border-radius: 4px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.codegen-tab:hover { background: #45475a; }
.codegen-tab.active { background: #89b4fa; color: #1e1e2e; border-color: #89b4fa; font-weight: 600; }
#codegen-output { position: relative; }
#codegen-copy {
  position: absolute; top: 8px; right: 8px; background: #45475a;
  color: #cdd6f4; border: none; border-radius: 4px; padding: 4px 10px;
  font-size: 11px; cursor: pointer; z-index: 1;
}
#codegen-copy:hover { background: #585b70; }
#codegen-code {
  background: #11111b; border: 1px solid #313244; border-radius: 6px;
  padding: 12px; font-family: 'Fira Code', monospace; font-size: 12px;
  line-height: 1.6; color: #cdd6f4; overflow-x: auto; white-space: pre;
  margin: 0;
}
/* Basic syntax coloring in code blocks */
.code-keyword { color: #cba6f7; }
.code-string { color: #a6e3a1; }
.code-comment { color: #6c7086; font-style: italic; }
.code-func { color: #89b4fa; }

/* Reference section */
#reference-section { margin-top: 16px; }
#reference-toggle { user-select: none; }
#reference-toggle:hover { color: #89b4fa; }
.toggle-arrow { font-size: 10px; transition: transform 0.2s; display: inline-block; }
.toggle-arrow.open { transform: rotate(90deg); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.ref-table th {
  text-align: left; padding: 4px 8px; color: #6c7086; font-size: 11px;
  border-bottom: 2px solid #45475a;
}
.ref-table td { padding: 3px 8px; border-bottom: 1px solid #1e1e2e; }
.ref-category {
  color: #89b4fa; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding-top: 10px !important; background: #181825;
}
.ref-code {
  color: #f9e2af; font-family: 'Fira Code', monospace; white-space: nowrap; width: 100px;
}
