/* DevBox Global Styles — Dark Dev Theme */
:root {
  --bg: #1e1e1e;
  --bg-light: #252526;
  --bg-card: #2d2d30;
  --border: #3e3e42;
  --text: #cccccc;
  --text-bright: #e0e0e0;
  --accent: #4ec9b0;
  --accent-hover: #3cb89a;
  --danger: #e06c75;
  --warning: #dcdcaa;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 6px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav { background: var(--bg-light); border-bottom: 1px solid var(--border); padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.nav .container { display: flex; align-items: center; gap: 24px; }
.nav-logo { font-size: 1.3rem; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: -0.5px; }
.nav-logo:hover { opacity: 0.85; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 0.78rem; padding: 4px 8px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.nav-links a:hover { color: var(--accent); background: rgba(78,201,176,0.08); }

/* Main */
.main { padding: 32px 0 60px; }
.main-header { margin-bottom: 28px; }
.page-title { font-size: 1.7rem; color: var(--text-bright); margin-bottom: 4px; }
.page-desc { color: #888; font-size: 0.9rem; }

/* Tool Grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; display: block;
  transition: border-color 0.18s, transform 0.18s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card h3 { color: var(--accent); font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.tool-card p { color: #888; font-size: 0.82rem; line-height: 1.4; }

/* Form Elements */
textarea, input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%; background: var(--bg-light); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-bright); padding: 10px 12px;
  font-family: var(--font-mono); font-size: 0.88rem; resize: vertical; outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 200px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 0.84rem; cursor: pointer; font-family: var(--font-sans);
  transition: background 0.15s, opacity 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #1e1e1e; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #3e3e42; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 4px 10px; font-size: 0.76rem; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btn:active { transform: scale(0.97); }

/* Labels */
label { display: block; font-size: 0.82rem; color: #999; margin-bottom: 4px; }

/* Ad Placeholder */
.ad-placeholder {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
  color: #666; font-size: 0.8rem; margin: 22px 0;
}

/* Related Tools */
.related-tools { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.related-tools h4 { color: var(--text-bright); margin-bottom: 10px; font-size: 0.88rem; }
.related-tools a { color: var(--accent); text-decoration: none; font-size: 0.84rem; margin-right: 14px; }
.related-tools a:hover { text-decoration: underline; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 18px 0; text-align: center; color: #666; font-size: 0.78rem; }

/* Utility */
.text-mono { font-family: var(--font-mono); }
.text-sm { color: #999; font-size: 0.82rem; }
.text-xs { color: #888; font-size: 0.75rem; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.result-area {
  background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; font-family: var(--font-mono); font-size: 0.88rem; min-height: 50px;
  word-break: break-all; white-space: pre-wrap; overflow-x: auto; line-height: 1.5;
}

/* Tool Layout */
.tool-row { display: flex; gap: 14px; }
.tool-row > * { flex: 1; min-width: 0; }
.tool-col-half { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Highlight */
.highlight { background: rgba(78,201,176,0.2); color: var(--accent); padding: 1px 3px; border-radius: 3px; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--accent); color: #1e1e1e;
  padding: 10px 18px; border-radius: var(--radius); font-size: 0.84rem; font-weight: 600;
  opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Error state */
.error-msg { color: var(--danger); font-size: 0.82rem; margin-top: 6px; font-family: var(--font-mono); }

/* Responsive */
@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-col-half { grid-template-columns: 1fr; }
  .tool-row { flex-direction: column; }
  .nav .container { flex-direction: column; gap: 6px; }
  .nav-links { justify-content: center; }
  .page-title { font-size: 1.4rem; }
}
