@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Design Tokens ===== */
:root {
  --bg-primary: #0b1120;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263348;
  --bg-input: #0f172a;
  --border-color: #334155;
  --border-light: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #60a5fa;

  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --purple-500: #a855f7;
  --indigo-500: #6366f1;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(59,130,246,.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 17, 32, .85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-brand svg {
  width: 28px;
  height: 28px;
  color: var(--blue-500);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue-500);
  border-radius: 1px;
}

/* ===== Main Container ===== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 1.5rem 3rem;
}

/* ===== Hero Section ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.hero-badges {
  display: flex;
  gap: 1.5rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--text-secondary);
}

.badge svg {
  width: 18px;
  height: 18px;
  color: var(--green-500);
}

/* ===== Config Card ===== */
.config-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.config-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.state-select {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.state-select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.toggle-row {
  display: flex;
  gap: 1rem;
}

.toggle-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

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

.toggle-item span {
  font-size: .85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--blue-500);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===== Generate Button ===== */
.btn-generate {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-md), 0 0 20px rgba(37,99,235,.2);
}

.btn-generate:hover {
  background: linear-gradient(135deg, var(--blue-500), var(--indigo-500));
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(37,99,235,.3);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-generate svg {
  width: 20px;
  height: 20px;
  transition: transform .4s ease;
}

.btn-generate:hover svg {
  transform: rotate(180deg);
}

/* ===== Result Section ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-actions {
  display: flex;
  gap: .75rem;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .55rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-action.share { border-color: var(--blue-600); color: var(--blue-500); }
.btn-action.share:hover { background: rgba(37,99,235,.1); }

.btn-action.save { border-color: var(--green-600); color: var(--green-500); }
.btn-action.save:hover { background: rgba(22,163,74,.1); }

.btn-action.delete { border-color: var(--red-600); color: var(--red-500); }
.btn-action.delete:hover { background: rgba(220,38,38,.1); }

.btn-action.export { border-color: var(--blue-600); color: var(--blue-500); }
.btn-action.export:hover { background: rgba(37,99,235,.1); }

.btn-action svg {
  width: 16px;
  height: 16px;
}

/* Result Card */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-height: 200px;
  margin-bottom: 3rem;
  transition: var(--transition);
}

.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  text-align: center;
}

.result-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.result-empty p {
  font-size: .95rem;
  line-height: 1.7;
}

/* Result Grid */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--bg-card);
  transition: var(--transition);
}

.result-item:hover {
  background: var(--bg-card-hover);
}

.result-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  min-width: 80px;
}

.result-value {
  font-size: .92rem;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  text-align: right;
  margin: 0 .75rem;
  word-break: break-all;
}

.btn-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-copy:hover {
  color: var(--blue-500);
  background: rgba(59,130,246,.1);
}

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

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

/* Result Section Divider */
.result-section-title {
  grid-column: 1 / -1;
  padding: .65rem 1.1rem;
  background: var(--bg-input);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section-title svg {
  width: 16px;
  height: 16px;
}

/* ===== Saved Addresses ===== */
.saved-section {
  margin-bottom: 3rem;
}

.saved-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 100px;
}

.saved-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: .9rem;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.saved-item:hover {
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

.saved-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-item-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.saved-item-addr {
  font-size: .8rem;
  color: var(--text-muted);
}

.saved-item-actions {
  display: flex;
  gap: .5rem;
}

.btn-sm {
  padding: .4rem .7rem;
  font-size: .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
}

.btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm.delete-single {
  border-color: var(--red-600);
  color: var(--red-500);
}

.btn-sm.delete-single:hover {
  background: rgba(220,38,38,.1);
}

/* ===== FAQ Section ===== */
.faq-section {
  margin-bottom: 3rem;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item:first-child {
  padding-top: 0;
}

.faq-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .75rem;
}

.faq-answer {
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Info Section ===== */
.info-section {
  margin-bottom: 3rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.info-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 .75rem;
}

.info-card h3:first-child {
  margin-top: 0;
}

.info-card p, .info-card li {
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.info-card ul {
  padding-left: 1.25rem;
  margin: .5rem 0;
}

.info-card li {
  margin-bottom: .35rem;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.7;
  margin-top: .75rem;
}

.footer-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: .5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .85rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

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

.footer-disclaimer {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.footer-disclaimer p {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: .75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--green-500); }
.toast.info { border-left: 3px solid var(--blue-500); }

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

.animate-in {
  animation: fadeInUp .5s ease forwards;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 2rem;
    gap: 2rem;
  }

  .hero-title {
    font-size: 2rem;
    text-align: center;
  }

  .hero-desc {
    text-align: center;
  }

  .hero-badges {
    justify-content: center;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 1rem;
  }

  .nav-links {
    display: none;
  }

  .main-container {
    padding: 80px 1rem 2rem;
  }

  .hero {
    padding: 1.5rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .toggle-row {
    flex-direction: column;
  }

  .result-card {
    padding: 1rem;
  }

  .faq-card, .info-card {
    padding: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: .75rem;
    text-align: center;
  }
}
