:root {
  --primary-blue: #1e3a8a;
  --secondary-blue: #1e40af;
  --accent-blue: #3b82f6;
  --dark-blue: #1e2451;
  --light-blue: #e0f2fe;
  --success-green: #065f46;
  --warning-amber: #92400e;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: white;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Google-like centered layout */
.search-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  width: 100%;
}

.logo-section {
  text-align: center;
  margin-bottom: 40px;
}

.logo-title {
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.tagline {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Search input section */
.search-section {
  width: 100%;
  max-width: 584px;
  margin-bottom: 32px;
  position: relative;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 20px;
  font-size: 16px;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  outline: none;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  background: white;
}

.search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1), var(--shadow-lg);
}

.search-input::placeholder {
  color: var(--neutral-600);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--neutral-600);
  pointer-events: none;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
  display: none;
}

.autocomplete-item {
  display: block;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--neutral-100);
  transition: background-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--neutral-50);
}

.autocomplete-item.no-results {
  cursor: default;
}

.autocomplete-item.no-results:hover {
  background: white;
}

.autocomplete-address {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.autocomplete-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.autocomplete-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.search-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--neutral-300);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Pills section */
.pills-section {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  max-width: 600px;
  width: 100%;
}

.pill {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  min-height: 44px;
}

.pill:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Footer */
.footer {
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  background: var(--neutral-50);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.footer-content {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  overflow-y: auto;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 32px;
  max-width: 800px;
  width: 95%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: all 0.2s;
  margin: auto;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  flex-shrink: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  min-height: 0;
}

.modal-footer {
  flex-shrink: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  background: white;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.modal-text {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
}

.modal-checkbox input {
  margin-top: 2px;
}

.modal-checkbox label {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  text-align: center;
  min-height: 44px;
  min-width: 44px;
}

.modal-button.secondary {
  background: var(--neutral-100);
  color: var(--text-secondary);
}

.modal-button.secondary:hover {
  background: var(--neutral-200);
}

.modal-button.primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
}

.modal-button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.modal-button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-weight: 300;
  line-height: 1;
}

.close-button:hover {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Attribution modal specific styles */
.attribution-modal .modal-content {
  max-width: min(1200px, 90vw);
  max-height: 85vh;
}

.attribution-content {
  margin-bottom: 24px;
}

.attribution-intro {
  margin-bottom: 20px;
  font-weight: 500;
}

.attribution-content h5 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 12px 0;
}

.attribution-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.attribution-list li {
  margin-bottom: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
  overflow-wrap: break-word;
  padding-right: 10px;
}

.attribution-note {
  margin-top: 20px;
  padding: 12px;
  background: var(--neutral-50);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Loading animation */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--neutral-300);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Property page styles */
.property-container {
  flex: 1;
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.property-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  display: none;
}

.property-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 100%;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary-blue);
  text-decoration: none;
  margin-bottom: 30px;
  font-weight: 500;
  padding: 8px 0;
  height: 40px;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.back-link-mobile:hover {
  background: var(--neutral-50);
}

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

.property-header {
  text-align: center;
  margin-bottom: 40px;
}

.property-title {
  font-size: clamp(22px, 5vw, 42px);
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--primary-blue);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.property-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

.property-nav-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  margin: 0 16px;
}

.property-nav-address {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-nav-municipality {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.property-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.property-nav-bar .back-link {
  margin-bottom: 0;
  height: auto;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.property-nav-bar .back-link:hover {
  background: var(--neutral-50);
  text-decoration: none;
}

.copy-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  min-height: 44px;
}

.copy-link-btn:hover {
  background: var(--secondary-blue);
  transform: translateY(-1px);
}

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

.copy-link-desktop {
  flex-shrink: 0;
}

.property-address-card {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  color: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.property-address-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  opacity: 0.5;
}

.property-address-card .property-title {
  color: white;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.property-address-card .property-subtitle {
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.municipality {
  cursor: help;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s;
}

.municipality:hover {
  border-bottom-color: white;
}

.property-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 60px;
}

.property-field {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.property-field:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.field-label {
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-value {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
}

/* Locked enterprise fields */
.property-field.locked {
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.property-field.locked:hover {
  opacity: 1;
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.property-field.locked .field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lock-icon {
  width: 12px;
  height: 12px;
  color: var(--neutral-600);
  flex-shrink: 0;
}

.field-value.blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.enterprise-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--accent-blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s;
}

.property-field.locked:hover .enterprise-hint {
  opacity: 1;
}

/* Copyable field styles */
.copyable {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.copyable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.property-address-card.copyable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(30, 58, 138, 0.3);
}

.copy-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.property-address-card .copy-hint {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.2);
}

.copyable:hover .copy-hint {
  opacity: 1;
}

/* Map card styles */
.map-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 0;
  margin-top: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.2s ease;
}

.map-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.map-container {
  width: 100%;
  height: 300px;
  position: relative;
  isolation: isolate;
}

.map-info {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.coordinates {
  font-weight: 500;
  font-family: monospace;
  color: var(--text-primary);
}

/* Responsive design */
@media (min-width: 769px) {
  .attribution-modal .modal-content {
    max-width: min(1000px, 85vw);
    width: 1000px;
  }
}

@media (max-width: 1024px) {
  .modal-content {
    max-width: 90vw;
    width: 90%;
  }
}

@media (max-width: 800px) {
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .search-container {
    padding: 20px 16px;
  }

  .search-input {
    padding: 18px 48px 18px 20px;
    font-size: 18px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .search-icon {
    width: 22px;
    height: 22px;
    right: 18px;
  }

  .pills-section {
    gap: 8px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .autocomplete-dropdown {
    position: static;
    max-height: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin-top: 16px;
    background: transparent;
  }

  .autocomplete-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
  }

  /* Full-screen mobile modals */
  .modal-overlay {
    padding: 0;
  }

  .modal-content {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
  }

  .modal-overlay.show .modal-content {
    transform: translateY(0);
  }

  .modal-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 16px 20px 24px 20px;
    border-top: 1px solid var(--border-light);
    background: white;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
  }

  .modal-title {
    margin-bottom: 16px;
    font-size: 20px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .modal-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
  }

  .pills-section .pill {
    flex: 1;
    min-width: 0;
    justify-content: center;
    padding: 14px 12px;
    font-size: 13px;
    min-height: 48px;
    align-items: center;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .attribution-modal .modal-content {
    max-height: none;
    height: 100%;
  }

  .close-button {
    background: rgba(255, 255, 255, 0.2);
    font-size: 24px;
    width: 40px;
    height: 40px;
  }

  .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }

  /* Property page mobile */
  .property-fixed-header {
    display: block;
  }

  .property-container {
    padding-top: 80px;
  }

  .back-link {
    display: none;
  }

  .copy-link-desktop {
    display: none;
  }

  .property-nav-bar {
    margin-bottom: 16px;
  }

  .property-grid {
    gap: 16px;
    grid-template-columns: 1fr 1fr;
  }

  .property-field {
    padding: 16px;
  }

  .property-header {
    padding: 0;
    margin-bottom: 24px;
  }

  .property-address-card {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .property-title {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .property-subtitle {
    font-size: 16px;
  }

  .copy-hint {
    font-size: 10px;
    bottom: 6px;
    right: 8px;
  }
}

@media (max-width: 480px) {
  .logo-title {
    font-size: 32px;
  }

  .tagline {
    font-size: 14px;
  }

  .search-input {
    font-size: 16px;
    padding: 16px 44px 16px 18px;
  }

  .pills-section {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 8px;
  }

  .pill {
    justify-content: center;
    padding: 12px 16px;
  }

  .modal-header {
    padding: 16px 16px 0 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px 20px 16px;
  }

  .close-button {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

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

  .property-address-card {
    padding: 20px 16px;
  }

  .property-title {
    font-size: 20px;
  }

  .property-subtitle {
    font-size: 14px;
  }

  .map-card {
    margin-top: 24px;
    padding: 0;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}