/* ============================================
   PASSWORD GENERATOR - Self-contained Stylesheet
   Dark Glassmorphism Theme
   ============================================ */

:root {
  --bg: #07071a;
  --bg2: #0d0d2b;
  --text: #f5f5f5;
  --muted: #a0a0b8;
  --accent: #6c63ff;
  --accent-2: #ff6584;
  --accent-3: #43e97b;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.09);
  --radius: 20px;
  --tr: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108,99,255,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255,101,132,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

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

/* ============================================
   HEADER / NAV
   ============================================ */
.header {
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 26, 0.8);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

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

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--tr);
}

.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent); }

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--tr);
}

.back-btn:hover {
  background: rgba(108, 99, 255, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.back-btn svg { width: 18px; height: 18px; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--tr);
}

/* ============================================
   MOBILE NAV OVERLAY
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 26, 0.98);
  backdrop-filter: blur(20px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.mobile-nav.active { display: flex; }

.mobile-nav a {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.mobile-nav .close-btn {
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 64px 0 40px;
  text-align: center;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.2;
}

.hero-title .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================
   TABS
   ============================================ */
.tabs-wrapper {
  padding: 0 0 80px;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
  font-family: inherit;
}

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

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================
   CARD / GLASS PANEL
   ============================================ */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  padding: 36px;
}

/* ============================================
   PASSWORD DISPLAY
   ============================================ */
.pwd-display-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.pwd-display {
  flex: 1;
  position: relative;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px 22px;
  font-family: 'Fira Code', monospace;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: 0.05em;
  line-height: 1.5;
  min-height: 72px;
  display: flex;
  align-items: center;
  transition: border-color var(--tr);
}

.pwd-display:hover { border-color: rgba(108,99,255,0.3); }

.pwd-text {
  flex: 1;
  word-break: break-all;
}

/* Inline action buttons group inside password box */
.inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Copy button lives INSIDE the password box */
.copy-inline {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.22);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}

.copy-inline:hover {
  background: rgba(108,99,255,0.3);
  transform: scale(1.08);
}

.copy-inline svg { width: 16px; height: 16px; }

.regen-inline {
  background: rgba(255, 101, 132, 0.12);
  border-color: rgba(255, 101, 132, 0.25);
  color: var(--accent-2);
}

.regen-inline:hover {
  background: rgba(255, 101, 132, 0.28);
  transform: scale(1.08);
}

/* Regenerate button sits OUTSIDE, right of the box */
.copy-btn {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(108,99,255,0.3);
  transform: scale(1.05);
}

.copy-btn svg { width: 18px; height: 18px; }

.regen-btn {
  background: rgba(255, 101, 132, 0.12);
  border-color: rgba(255, 101, 132, 0.25);
  color: var(--accent-2);
}

.regen-btn:hover {
  background: rgba(255, 101, 132, 0.28);
  transform: scale(1.05);
}

/* ============================================
   STRENGTH METER
   ============================================ */
.strength-wrap {
  margin-bottom: 28px;
}

.strength-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.strength-text {
  font-weight: 600;
  font-size: 0.9rem;
}

.strength-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

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

.strength-bar.weak    { background: #ff4d4d; width: 25%; }
.strength-bar.fair    { background: #ff9f43; width: 50%; }
.strength-bar.good    { background: #f9ca24; width: 75%; }
.strength-bar.strong  { background: var(--accent-3); width: 100%; }

/* ============================================
   CONTROLS
   ============================================ */
.control-group {
  margin-bottom: 24px;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label span.value {
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 700;
}

/* Slider row with stepper buttons */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-btn {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  font-family: inherit;
  user-select: none;
}

.stepper-btn:hover {
  background: rgba(108,99,255,0.18);
  border-color: rgba(108,99,255,0.4);
  color: var(--accent);
  transform: scale(1.08);
}

.stepper-btn:active { transform: scale(0.95); }

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(108,99,255,0.5);
  transition: transform var(--tr);
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(108,99,255,0.5);
}

/* Toggles */
.toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
  user-select: none;
}

.toggle-item:hover {
  border-color: rgba(108,99,255,0.3);
  background: rgba(108,99,255,0.06);
}

.toggle-item.active {
  border-color: rgba(108,99,255,0.4);
  background: rgba(108,99,255,0.1);
}

.toggle-item input { display: none; }

.toggle-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.toggle-switch {
  width: 40px; height: 22px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  position: relative;
  transition: background var(--tr);
  flex-shrink: 0;
}

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

.toggle-item.active .toggle-switch {
  background: var(--accent);
}

.toggle-item.active .toggle-switch::after {
  transform: translateX(18px);
  background: #fff;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108,99,255,0.45);
}

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(108,99,255,0.12);
  border-color: rgba(108,99,255,0.3);
  transform: translateY(-2px);
}

/* ============================================
   SELECT / INPUT
   ============================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form-select,
.form-input {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--tr);
  appearance: none;
  -webkit-appearance: none;
}

.form-select:focus,
.form-input:focus {
  border-color: rgba(108,99,255,0.5);
}

.form-select option { background: #0d0d2b; }

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.checkbox-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============================================
   PASSPHRASE DISPLAY
   ============================================ */
.phrase-display {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

/* ============================================
   BATCH LIST
   ============================================ */
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.batch-list::-webkit-scrollbar { width: 4px; }
.batch-list::-webkit-scrollbar-track { background: transparent; }
.batch-list::-webkit-scrollbar-thumb {
  background: rgba(108,99,255,0.3);
  border-radius: 4px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: border-color var(--tr);
}

.batch-item:hover { border-color: rgba(108,99,255,0.25); }

.batch-num {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Fira Code', monospace;
  width: 24px;
  flex-shrink: 0;
}

.batch-pwd {
  flex: 1;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-all;
}

.batch-copy {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
  flex-shrink: 0;
}

.batch-copy:hover {
  background: rgba(108,99,255,0.25);
  transform: scale(1.08);
}

.batch-copy svg { width: 14px; height: 14px; }

/* Copy all row */
.copy-all-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(67,233,123,0.15);
  border: 1px solid rgba(67,233,123,0.35);
  color: var(--accent-3);
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  z-index: 999;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

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

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .hero-title { font-size: 2rem; }
  .container { padding: 0 16px; }
  .card { padding: 24px; }
  .toggles-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .tabs-nav { gap: 4px; }
  .tab-btn { font-size: 0.82rem; padding: 10px 10px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.75rem; }
  .pwd-display { font-size: 1.05rem; padding: 18px 52px 18px 18px; }
  .btn-row { flex-direction: column; }
}
