:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --card-light: #ffffff;
  --card-dark: #1e293b;
  --text-light: #334155;
  --text-dark: #f1f5f9;
  --border-light: #e2e8f0;
  --border-dark: #334155;
  --glass-blur: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  line-height: 1.5;
  transition: var(--transition);
}

.dark-mode {
  --bg-light: var(--bg-dark);
  --card-light: var(--card-dark);
  --text-light: var(--text-dark);
  --border-light: var(--border-dark);
}

.dark-mode body {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-light);
  height: 70px;
  display: flex;
  align-items: center;
}

.dark-mode .navbar {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--border-dark);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: inherit;
  opacity: 0.7;
  transition: var(--transition);
}

.nav-links a:hover {
  opacity: 1;
  color: var(--primary);
}

/* Theme Toggle */
.theme-btn {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--primary);
  display: flex;
  padding: 0.6rem;
  border-radius: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.theme-btn i {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon Visibility */
.dark-mode .moon-icon,
html:not(.dark-mode) .sun-icon {
  display: none !important;
}

.dark-mode .sun-icon,
html:not(.dark-mode) .moon-icon {
  display: block;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* Layout Content */
.content-wrapper {
  margin-top: 70px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 4rem 1.5rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 5rem;
}

.hero-section h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.hero-subtitle {
  max-width: 750px;
  margin: 0 auto 4rem;
  font-size: 1.25rem;
  opacity: 0.7;
  line-height: 1.7;
}

/* Generator Card */
.generator-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 40px;
  padding: 3rem;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.08);
  text-align: left;
  transition: var(--transition);
}

.dark-mode .generator-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

/* Result Area */
.result-section {
  margin-bottom: 2.5rem;
}

.token-display {
  background: #f8fafc;
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 0.6rem 0.6rem 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dark-mode .token-display {
  background: #0f172a;
  border-color: var(--border-dark);
}

#tokenOutput {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  color: inherit;
  outline: none;
  width: 0;
  padding: 0.5rem 0;
}

.icon-btn {
  background: white;
  border: 1px solid var(--border-light);
  padding: 0 1.5rem;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  color: var(--primary);
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

/* Strength Meter */
.strength-meter {
  height: 8px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 2rem;
}

.dark-mode .strength-meter {
  background: var(--border-dark);
}

.strength-meter .bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
}

.strength-meter .label {
  position: absolute;
  top: -1.5rem;
  left: 0;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.6;
}

.strength-meter .indicator {
  position: absolute;
  top: -1.5rem;
  right: 0;
  font-size: 0.85rem;
  font-weight: 800;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input {
  display: none;
}

.checkmark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
}

.checkbox-wrapper input:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrapper input:checked ~ .checkmark:after {
  content: "✔";
  color: white;
  font-size: 0.9rem;
}

.label-text {
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.9;
}

.length-control {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

/* Advanced Options Panel */
.advanced-toggle {
  margin: 2.5rem 0 1.5rem;
  text-align: left;
}

.advanced-toggle .secondary-btn {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: var(--text-light);
  height: 48px;
  padding: 0 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
}

.dark-mode .advanced-toggle .secondary-btn {
  background: #334155;
  border-color: var(--border-dark);
  color: white;
}

.advanced-panel {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  animation: fadeIn 0.3s ease;
}

.dark-mode .advanced-panel {
  background: #0f172a;
  border-color: var(--border-dark);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.control-group {
  margin-bottom: 2rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1rem;
}

.slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  background: var(--border-light);
  border-radius: 10px;
  outline: none;
  appearance: none;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Custom Salt Input */
.custom-input-wrapper {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.custom-input-wrapper label {
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-input-wrapper input {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: white;
  color: inherit;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.dark-mode .custom-input-wrapper input {
  background: var(--bg-dark);
  border-color: var(--border-dark);
}

.custom-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Details List Fix */
.details-section {
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
  padding-top: 2rem;
}

.detail-item {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-label {
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item code {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  display: block;
  word-break: break-all;
  line-height: 1.6;
  color: var(--primary);
  font-weight: 500;
}

.dark-mode .detail-item code {
  background: rgba(255, 255, 255, 0.05);
}

.mini-copy-btn {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--border-light);
  padding: 0 1.25rem;
  height: 40px;
  border-radius: 10px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mini-copy-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* Footer Actions */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.generate-btn {
  background: var(--primary);
  color: white;
  border: none;
  height: 64px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 12px 24px -6px rgba(99, 102, 241, 0.5);
}

.generate-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -8px rgba(99, 102, 241, 0.6);
  filter: brightness(1.1);
}

.download-footer-btn {
  background: white;
  border: 2px solid var(--border-light);
  color: var(--text-light);
  height: 64px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.dark-mode .download-footer-btn {
  background: transparent;
  color: white;
  border-color: var(--border-dark);
}

.download-footer-btn:hover {
  background: var(--bg-light);
  border-color: var(--primary);
}

/* Info Sections */
.info-sections {
  margin-top: 8rem;
}

.info-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 32px;
  padding: 3rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

.dark-mode .info-card {
  background: #1e293b;
  border-color: var(--border-dark);
}

.info-card h2, .info-card h3 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 800;
}

.info-card p, .info-card li {
  font-size: 1.15rem;
  opacity: 0.8;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 6rem 2rem;
  border-top: 1px solid var(--border-light);
  margin-top: 6rem;
}

.footer p {
  opacity: 0.5;
  font-weight: 500;
}

/* Utilities */
.hidden { display: none !important; }

.spinning { animation: spin 1s linear infinite; }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: white;
  padding: 1.25rem 2.5rem;
  border-radius: 100px;
  font-weight: 700;
  z-index: 2000;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.copied {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

@media (max-width: 600px) {
  .action-buttons { grid-template-columns: 1fr; }
  .generator-card { padding: 1.5rem; }
  .nav-logo { font-size: 1.2rem; }
}
