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

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-glow: rgba(6, 182, 212, 0.3);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --border: #334155;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
}

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.mode-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* Password Display */
.password-display {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  gap: 12px;
}

.password-text {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  word-break: break-all;
  color: var(--accent);
  min-height: 28px;
  display: flex;
  align-items: center;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
}

.copy-btn.copied {
  color: var(--success);
}

/* Strength Indicator */
.strength-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all 0.3s;
}

.strength-fill.weak { width: 25%; background: var(--danger); }
.strength-fill.medium { width: 50%; background: var(--warning); }
.strength-fill.strong { width: 75%; background: var(--accent); }
.strength-fill.very-strong { width: 100%; background: var(--success); }

.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 90px;
  text-align: right;
}

.strength-label.weak { color: var(--danger); }
.strength-label.medium { color: var(--warning); }
.strength-label.strong { color: var(--accent); }
.strength-label.very-strong { color: var(--success); }

/* Options */
.options {
  margin-bottom: 24px;
}

.options.hidden {
  display: none;
}

.option-row {
  margin-bottom: 16px;
}

.option-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.option-row label span {
  color: var(--accent);
  font-weight: 600;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  outline: none;
}

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 var(--accent-glow);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Select */
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--accent);
}

/* Checkboxes */
.checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.checkbox input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked + .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.checkbox:hover .checkmark {
  border-color: var(--accent);
}

/* Generate Button */
.generate-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.generate-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.generate-btn:active {
  transform: scale(0.98);
}

.generate-btn.generating .btn-icon {
  animation: spin 0.6s linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Batch Section */
.batch-section {
  margin-bottom: 20px;
}

.batch-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-list.hidden {
  display: none;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.batch-item .batch-password {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--accent);
}

.batch-item .batch-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.batch-item .batch-copy:hover {
  color: var(--accent);
}

/* Breach Check */
.breach-check {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  opacity: 0.7;
}

.breach-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.breach-text strong {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.breach-text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.breach-text em {
  color: var(--accent);
  font-style: normal;
}

/* Ad Placeholder */
.ad-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 16px 0;
}

.ad-top {
  height: 90px;
  margin-bottom: 24px;
}

.ad-side {
  height: 250px;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 32px;
  padding: 16px;
}

footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

  header h1 {
    font-size: 1.5rem;
  }

  .password-text {
    font-size: 0.9375rem;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  pointer-events: none;
}

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