/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c28;
  --accent: #00ff88;
  --accent2: #00ccff;
  --danger: #ff4466;
  --warning: #ffaa00;
  --text: #f0f0f5;
  --muted: #6b6b80;
  --border: #2a2a3a;
  --font-display: 'JetBrains Mono', monospace;
  --font-mono: 'Fira Code', monospace;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== NOISE OVERLAY ===== */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: -0.5px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--text); }

/* ===== AD BANNERS ===== */
.ad-banner {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 90px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ===== MAIN ===== */
main {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 4rem 0 2rem;
  animation: fadeUp 0.6s ease both;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

/* ===== GENERATOR ===== */
.generator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  animation: fadeUp 0.7s ease 0.1s both;
}

/* Output box */
.output-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  gap: 1rem;
  transition: border-color 0.3s;
}

.output-box:has(#password-display:not(:empty)) {
  border-color: var(--accent);
}

#password-display {
  flex: 1;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--accent);
  word-break: break-all;
  letter-spacing: 1px;
}

#copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,255,136,0.08);
}

/* Strength bar */
.strength-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.4s ease, background 0.4s ease;
}

.strength-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

/* Controls */
.controls { margin-bottom: 1.5rem; }

.control-row, .quantity-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.control-row label, .quantity-row label {
  font-size: 0.9rem;
  color: var(--muted);
}

.control-row label strong, .quantity-row label strong {
  color: var(--text);
  font-family: var(--font-mono);
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,255,136,0.4);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Toggle options */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s;
  user-select: none;
}

.toggle:hover { color: var(--text); }

.toggle input { display: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--muted);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.3s, background 0.3s;
}

.toggle input:checked + .toggle-track {
  background: rgba(0,255,136,0.2);
  border: 1px solid var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--accent);
}

/* Generate button */
.generate-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 0.2s;
}

.generate-btn:hover::before { opacity: 0.1; }
.generate-btn:active { transform: scale(0.98); }

/* Multi output */
#multi-output {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.multi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent2);
  animation: fadeUp 0.3s ease both;
}

.multi-item button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.multi-item button:hover {
  color: var(--accent);
  background: rgba(0,255,136,0.08);
}

/* ===== TIPS ===== */
.tips {
  padding: 3rem 0;
  animation: fadeUp 0.7s ease 0.2s both;
}

.tips h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.tip-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.tip-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.tip-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tip-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  z-index: 999;
  transition: transform 0.3s ease;
  pointer-events: none;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .options-grid { grid-template-columns: 1fr; }
  header { padding: 1rem; }
  .generator { padding: 1.5rem 1rem; }
}
