/* =============================================
   url-encoder.css — Chedders Tools
   ============================================= */

/* --- Base --- */
:root {
  --primary: #0b1f3a;
  --primary-light: #16345f;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text: #111111;
  --muted: #6c757d;
  --border: #e5e7eb;
  --shadow: rgba(0,0,0,0.05);
}

[data-theme="dark"] {
  --background: #081120;
  --surface: #0f1c2e;
  --text: #ffffff;
  --muted: #b0b7c3;
  --border: rgba(255,255,255,0.08);
  --shadow: rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', 'Plus Jakarta Sans', 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  margin: 0;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* --- Layout --- */
.container-xl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.navbar .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand { text-decoration: none; font-size: 17px; }
.brand-text { font-weight: 700; color: var(--primary); }
[data-theme="dark"] .brand-text { color: #ffffff; }
.brand-dot { font-weight: 700; color: var(--primary); }
[data-theme="dark"] .brand-dot { color: #ffffff; }
.brand-tools { font-weight: 400; color: var(--muted); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.nav-back {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--primary); }
[data-theme="dark"] .nav-back:hover { color: #ffffff; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); }

/* --- Page Header --- */
.tool-header { padding: 40px 0 24px; }

.tool-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}
[data-theme="dark"] .tool-title { color: #ffffff; }

.tool-description {
  font-size: 15px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* --- Tool Main --- */
.tool-main { padding: 0 0 80px; }

/* --- Tool Card --- */
.tool-card {
  max-width: 800px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* --- Input / Textarea --- */
.input-group-field { margin-bottom: 20px; }
.output-group { margin-top: 20px; }

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.tool-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
}
.tool-textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.tool-textarea.input-error { border-color: #dc3545; }

.tool-textarea--output {
  background: var(--surface);
  color: var(--text);
  cursor: default;
}
.tool-textarea--output::placeholder { color: var(--muted); font-family: inherit; }

.field-error {
  display: block;
  font-size: 13px;
  color: #dc3545;
  margin-top: 4px;
  min-height: 18px;
}

/* --- Mode Toggle --- */
.mode-toggle-group { margin-bottom: 20px; }

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
}

.radio-hint {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Courier New', monospace;
}

/* --- Button Row --- */
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-primary-tool {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-primary-tool:hover { background: var(--primary-light); }

.btn-secondary-tool {
  background: var(--background);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn-secondary-tool:hover { background: var(--primary); color: #ffffff; }
[data-theme="dark"] .btn-secondary-tool { color: #ffffff; border-color: rgba(255,255,255,0.3); }
[data-theme="dark"] .btn-secondary-tool:hover { background: var(--primary-light); border-color: var(--primary-light); }

/* --- Output Header --- */
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.output-header .field-label { margin-bottom: 0; }

.output-actions { display: flex; gap: 8px; }

.btn-action {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-action:hover { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .btn-action:hover { color: #ffffff; border-color: rgba(255,255,255,0.4); }

/* --- Footer --- */
.site-footer { padding: 24px 0; border-top: 1px solid var(--border); }
.footer-text { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.footer-text a { color: var(--primary); text-decoration: none; }
[data-theme="dark"] .footer-text a { color: #b0b7c3; }

/* --- Responsive --- */
@media (max-width: 575px) {
  .tool-card { padding: 16px; }
  .tool-title { font-size: 22px; }
  .button-row { flex-direction: column; }
  .btn-primary-tool,
  .btn-secondary-tool { width: 100%; }
  .radio-row { flex-direction: column; gap: 10px; }
  .output-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
