/* =====================================================
   Timestamp Converter — timestamp-converter.css
   Chedders Tools · Bootstrap 5 base
   ===================================================== */

/* --- Base & Variables --- */
: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);
}

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

body {
  font-family: 'Inter', 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;
}

.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;
  display: flex;
  align-items: center;
  gap: 1px;
}

.brand-text { font-weight: 700; color: var(--primary); font-size: 16px; }
.brand-dot  { color: var(--primary); font-weight: 700; font-size: 16px; }
.brand-tools{ font-weight: 400; color: var(--muted); font-size: 16px; }

[data-theme="dark"] .brand-text,
[data-theme="dark"] .brand-dot { color: #ffffff; }

.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;
  transition: border-color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { background: var(--background); }
.theme-icon { font-size: 14px; line-height: 1; display: block; }

/* --- Page Header --- */
.tool-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
}

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

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

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

/* --- Two-column grid --- */
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* --- Tool Card --- */
.tool-card {
  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;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .section-title { color: #ffffff; }

/* --- Fields --- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

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

.form-input {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  height: 44px;
  outline: none;
  transition: border-color 0.2s, background-color 0.25s ease;
}
.form-input:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* datetime-local calendar icon tint in dark mode */
[data-theme="dark"] .form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.form-input.is-error { border-color: #dc3545; }

.field-error {
  font-size: 13px;
  color: #dc3545;
  margin: 0;
  min-height: 18px;
}

/* --- Toggle group (UTC / Local) --- */
.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.toggle-btn {
  background: var(--background);
  border: none;
  padding: 0 18px;
  height: 40px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.toggle-btn:not(:last-child) { border-right: 1px solid var(--border); }
.toggle-btn.active { background: var(--primary); color: #ffffff; }
.toggle-btn:not(.active):hover { background: var(--surface); color: var(--text); }

/* --- Buttons --- */
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn-primary-tool {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  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 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: background-color 0.2s, color 0.2s;
}
.btn-secondary-tool:hover { background: var(--primary); color: #ffffff; }

[data-theme="dark"] .btn-secondary-tool {
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .btn-secondary-tool:hover {
  background: var(--primary-light);
  color: #ffffff;
  border-color: var(--primary-light);
}

/* --- Output area --- */
.output-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.output-box {
  flex: 1;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  min-height: 48px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.output-placeholder {
  color: var(--muted);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 14px;
}

.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  height: 48px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.copy-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* --- Detection note --- */
.detect-note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  min-height: 18px;
  font-style: italic;
}

/* --- Footer --- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.25s ease;
}

.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: #ffffff; }
.footer-text a:hover { text-decoration: underline; }

/* --- Responsive --- */
@media (max-width: 767px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .tool-card { padding: 16px; }
  .tool-title { font-size: 22px; }

  .btn-primary-tool,
  .btn-secondary-tool { width: 100%; }

  .output-wrap { flex-direction: column; }
  .copy-btn { width: 100%; height: 40px; }
}
