/* Container and layout */
.address-collection-container {
  max-width: 900px;
  margin: 48px auto;
  padding: 20px;
  box-sizing: border-box;
}

.address-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.address-field-with-label {
  flex: 1;
}

.main-part {
  flex: 2;
}

.margin-right {
  margin-right: 16px;
}

.autocomplete-container {
  position: relative;
}

.message-container {
  margin: 12px 0 8px 0;
  color: #6b7a90;
  font-size: 14px;
}

.small-input {
  width: 110px;
  flex-shrink: 0;
}

.helper-text {
  margin: 6px 0 16px 0;
  color: #6b7a90;
  font-size: 13px;
}

.helper-text a {
  color: #007bff;
  text-decoration: underline;
}

.helper-text a:hover {
  color: #0056b3;
}

.button-container {
  margin-top: 10px;
  text-align: right;
}

/* Visual highlight for editable fields after autofill */
.highlight-on-select {
  animation: fieldPulse 1.8s ease;
}

@keyframes fieldPulse {
  0% { box-shadow: 0 0 0 0 rgba(46,162,255,0.45); }
  50% { box-shadow: 0 0 0 6px rgba(46,162,255,0.18); }
  100% { box-shadow: 0 0 0 0 rgba(46,162,255,0); }
}

.warning-input {
  border-color: #ffb610;
}

.geoapify-autocomplete-input {
  width: 100% !important;
  box-sizing: border-box;
}

/* Ensure proper spacing for autocomplete containers */
.address-field {
  min-height: 36px;
}

/* Theme selector styling (reused across demos) */
.theme-selector {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1001;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  padding: 4px 8px 4px 12px;
  border-right: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 4px 0 0 4px;
  white-space: nowrap;
}

.theme-selector select {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  min-width: 100px;
  border-radius: 0 4px 4px 0;
}

.theme-selector select:focus { outline: none; }

.theme-selector:hover {
  border-color: #007bff;
  box-shadow: 0 2px 12px rgba(0, 123, 255, 0.15);
}

/* Dark theme styles for the demo page */
body.theme-minimal-dark,
body.theme-round-borders-dark {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.theme-minimal-dark .theme-selector,
body.theme-round-borders-dark .theme-selector {
  background: #333;
  border-color: #555;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.theme-minimal-dark .theme-label,
body.theme-round-borders-dark .theme-label {
  color: #bbb;
  background: #444;
  border-right-color: #555;
}

body.theme-minimal-dark .theme-selector select,
body.theme-round-borders-dark .theme-selector select { color: #e0e0e0; }

body.theme-minimal-dark .theme-selector:hover,
body.theme-round-borders-dark .theme-selector:hover {
  border-color: #007bff;
  box-shadow: 0 2px 12px rgba(0, 123, 255, 0.2);
}

body.theme-minimal-dark .message-container,
body.theme-round-borders-dark .message-container { color: #bbb; }

body.theme-minimal-dark button,
body.theme-round-borders-dark button {
  background-color: #444;
  color: #e0e0e0;
  border: 1px solid #666;
}

body.theme-minimal-dark button:hover,
body.theme-round-borders-dark button:hover { background-color: #555; }

/* Match-level badge */
.match-badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  margin: 6px 0 0 0;
}

.match-badge.is-building { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.match-badge.is-street   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.match-badge.is-city     { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.match-badge.is-ambiguous{ background: #fff7ed; color: #7c2d12; border-color: #fed7aa; }
.match-badge.is-error    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }


/* Button helper */
.button-hint { font-size: 12px; color: #6b7a90; margin-top: 8px; text-align: right; }

/* Disabled button state */
button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Developer info panel */
.dev-info-panel[hidden] { display: none; }
.dev-info-panel {
  margin-top: 12px;
  border: 1px dashed #c7d7ea;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f7fbff;
}
.dev-info-title { font-weight: 600; font-size: 13px; color: #264a66; margin-bottom: 8px; }
.dev-kv { font-size: 12px; color: #35546a; line-height: 1.5; }
.dev-kv strong { color: #1f2f3a; }
.dev-code {
  margin-top: 8px;
  padding: 8px;
  background: #0b1526;
  color: #d7e3ef;
  border-radius: 6px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  max-height: 240px;
}
body.theme-minimal-dark .dev-info-panel,
body.theme-round-borders-dark .dev-info-panel {
  background: #1e2633;
  border-color: #334155;
}
body.theme-minimal-dark .dev-info-title,
body.theme-round-borders-dark .dev-info-title { color: #9ec5ff; }
body.theme-minimal-dark .dev-kv,
body.theme-round-borders-dark .dev-kv { color: #94a3b8; }
body.theme-minimal-dark .dev-kv strong,
body.theme-round-borders-dark .dev-kv strong { color: #cbd5e1; }

/* A11y utility: screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Sectioned flow (1. Search, 2. Check, 3. Confirm) */
.section-block {
  border: 1px solid #e6ecf5;
  border-radius: 12px;
  padding: 14px 16px 12px;
  margin: 18px 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(16,24,40,.03);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px 0;
}

.section-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: #2ea2ff;
  box-shadow: 0 2px 8px rgba(46,162,255,.25);
}

.section-heading {
  font-weight: 600;
  color: #0b1526;
}

/* Dark theme tweaks for sections */
body.theme-minimal-dark .section-block,
body.theme-round-borders-dark .section-block {
  background: #242424;
  border-color: #3a3a3a;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
body.theme-minimal-dark .section-heading,
body.theme-round-borders-dark .section-heading { color: #e0e0e0; }

/* Dark mode link styling */
body.theme-minimal-dark .helper-text a,
body.theme-round-borders-dark .helper-text a {
  color: #4da3ff;
  text-decoration: underline;
}

body.theme-minimal-dark .helper-text a:hover,
body.theme-round-borders-dark .helper-text a:hover {
  color: #80bdff;
}
