/* =========================================
   ReconCG v5.0
   style.css — Core theme
   ========================================= */

:root {
  --bg:        #0d1117;
  --bg-panel:  #12181f;
  --bg-raised: #1a222c;
  --border:    #263140;
  --text:      #d8e0e8;
  --text-dim:  #7c8a9a;
  --accent:    #39ff9e;   /* terminal green */
  --accent-dim:#1f8f5c;
  --danger:    #ff5c5c;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

::selection { background: var(--accent-dim); color: #05130c; }

/* ===== Nav ===== */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .logo {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  font-size: 1.1rem;
}

nav .logo::before { content: "> "; color: var(--text-dim); }

.logo-link { text-decoration: none; }

.author-badge a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-dim);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.author-badge a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover strong { text-decoration: underline; }

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

nav a:hover, nav a:focus-visible { color: var(--accent); }

/* ===== Hero ===== */

.hero {
  text-align: center;
  padding: 96px 24px 72px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  color: var(--text);
}

.hero p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0 0 32px;
}

.hero button {
  background: var(--accent);
  color: #05130c;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(57, 255, 158, 0.4);
}

/* ===== Dashboard layout ===== */

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 20px;
  padding: 32px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}

/* ===== Sidebar ===== */

.sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.sidebar h3 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.search-box {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.category-header {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dim);
  margin: 16px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.category-header:first-of-type { margin-top: 0; }

.category-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-btn {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.tool-btn:hover { background: var(--bg-raised); color: var(--text); }

.tool-btn.active {
  background: rgba(57, 255, 158, 0.08);
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* ===== Generator panel ===== */

.generator-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.generator-panel h2 {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 1.4rem;
}

.explanation {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 0.92rem;
}

#dynamicFields input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}

#dynamicFields input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 16px;
  margin-bottom: 8px;
}

.options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
}

.options input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.options label:has(input:checked) { color: var(--text); }

.preset-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.preset-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.preset-btn:hover { border-color: var(--accent-dim); color: var(--accent); }

.command-info {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}

.command-info h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.command-info p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.action-buttons button {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.action-buttons button:first-child {
  background: var(--accent);
  color: #05130c;
  border-color: var(--accent);
}

.action-buttons button:hover { transform: translateY(-1px); }
.action-buttons button:first-child:hover { box-shadow: 0 6px 16px -6px rgba(57, 255, 158, 0.5); }

#output {
  width: 100%;
  min-height: 90px;
  padding: 14px;
  background: #05090d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 14px;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

#toolStatus.status-ok { color: var(--accent); }
#toolStatus.status-error { color: var(--danger); }

/* ===== History panel ===== */

.history-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.history-panel h3 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.history-panel > p.hint {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin: 0 0 14px;
}

.history-export {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.history-export button {
  flex: 1;
  padding: 7px;
  font-size: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
}

.history-export button:hover { color: var(--accent); border-color: var(--accent-dim); }

#historyList p { color: var(--text-dim); font-size: 0.85rem; }

.history-item {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.history-tool { color: var(--accent-dim); font-weight: 600; }

.history-cmd {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.history-actions { display: flex; gap: 6px; }

.history-actions button {
  flex: 1;
  padding: 5px;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
}

.history-actions button:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ===== Footer ===== */

footer {
  text-align: center;
  padding: 28px;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

footer strong { color: var(--accent); }
