/* True Generator — style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d2e;
  --surface2: #252840;
  --border: #2e3250;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --accent2: #00d4aa;
  --text: #e2e4f0;
  --text-muted: #8b90b0;
  --text-dim: #555a7a;
  --danger: #ff4d6a;
  --warn: #ffb347;
  --good: #4dd97a;
  --strong: #00d4aa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-brand { font-weight: 700; font-size: 1.1rem; color: var(--text); letter-spacing: 0.02em; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.lang-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}
.lang-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* MAIN LAYOUT */
main { flex: 1; max-width: 720px; margin: 0 auto; padding: 40px 20px; width: 100%; }

.page-title { font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.page-sub { color: var(--text-muted); margin-bottom: 32px; font-size: 1rem; }

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* PASSWORD DISPLAY */
.pwd-display-wrap {
  position: relative;
  margin-bottom: 16px;
}
.pwd-display {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 52px 16px 16px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 1.15rem;
  color: var(--text);
  word-break: break-all;
  min-height: 60px;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}
.pwd-display:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
}
.pwd-display:focus { outline: none; border-color: var(--accent); }

.copy-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn.copied { background: var(--good); border-color: var(--good); color: #fff; }

/* STRENGTH BAR */
.strength-wrap { margin-bottom: 20px; }
.strength-bar-bg {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.strength-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease, background-color 0.35s;
  width: 0%;
}
.strength-label { font-size: 0.8rem; color: var(--text-muted); display: flex; justify-content: space-between; }
.strength-label span { font-weight: 600; }

/* BUTTONS ROW */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,0.4); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

/* CONTROLS */
.control-group { margin-bottom: 20px; }
.control-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-muted); }
.control-value { font-weight: 700; color: var(--accent); font-size: 1rem; }

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  transition: background 0.2s;
}
input[type=range]::-webkit-slider-thumb:hover { background: var(--accent-hover); }

/* CHECKBOXES */
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cb-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  user-select: none;
}
.cb-item:hover { border-color: var(--accent); }
.cb-item input[type=checkbox] { display: none; }
.cb-icon {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  background: var(--bg);
}
.cb-item input:checked ~ .cb-icon {
  background: var(--accent);
  border-color: var(--accent);
}
.cb-item input:checked ~ .cb-icon::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 700; }
.cb-text { font-size: 0.88rem; color: var(--text); }
.cb-sample { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; margin-left: auto; }

/* TEXT INPUT */
.text-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-dim); }

/* MODE TOGGLE */
.mode-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 20px; }
.mode-btn {
  flex: 1; padding: 9px; text-align: center; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface2); border: none; transition: all 0.2s;
}
.mode-btn.active { background: var(--accent); color: #fff; }
.mode-btn:hover:not(.active) { background: var(--border); color: var(--text); }

/* HISTORY */
.history-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 10px;
}
.history-item .hi-pwd { flex: 1; word-break: break-all; color: var(--text); }
.history-copy {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  font-size: 0.8rem; padding: 2px 6px; border-radius: 4px;
  transition: color 0.2s;
}
.history-copy:hover { color: var(--accent); }
.history-empty { color: var(--text-dim); font-size: 0.85rem; font-style: italic; padding: 8px 0; }

/* SECTION TITLE */
.section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 14px; }

/* STATIC PAGE */
.static-content { max-width: 720px; }
.static-content h2 { font-size: 1.2rem; color: var(--text); margin: 28px 0 10px; }
.static-content p, .static-content li { color: var(--text-muted); margin-bottom: 12px; font-size: 0.95rem; }
.static-content ul { padding-left: 20px; }
.static-content .meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 32px; }

/* 404 */
.error-page { text-align: center; padding: 80px 20px; }
.error-page .error-code { font-size: 6rem; font-weight: 800; color: var(--accent); opacity: 0.5; line-height: 1; }
.error-page .error-msg { font-size: 1.5rem; margin: 16px 0 8px; }
.error-page .error-sub { color: var(--text-muted); margin-bottom: 32px; }

/* FOOTER */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; color: var(--text-dim);
  flex-wrap: wrap; gap: 10px;
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--text-muted); }

@media (max-width: 520px) {
  .checkbox-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.5rem; }
  .btn-row { flex-direction: column; }
  footer { flex-direction: column; text-align: center; }
  .nav-links a:not(.lang-btn) { display: none; }
}
