body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #090909;
  color: white;
}

.header {
  padding: 28px 16px 22px;
  background: linear-gradient(180deg, #1b1b1b, #101010);
  text-align: center;
  border-bottom: 1px solid #1f1f1f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.header h1 {
  margin: 0;
  color: #d4af37;
  font-size: 32px;
  letter-spacing: 0.3px;
}

.header p {
  margin-top: 8px;
  color: #bdbdbd;
  font-size: 15px;
}

.container {
  padding: 18px 16px 28px;
  max-width: 900px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

#searchInput {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  background: #151515;
  color: white;
  box-sizing: border-box;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#searchInput::placeholder {
  color: #8f8f8f;
}

#searchInput:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
  background: #181818;
}

#locationBtn {
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: #d4af37;
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.18);
}

#locationBtn:hover {
  transform: translateY(-1px);
}

#locationBtn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.map {
  height: 300px;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
}

.map.hidden {
  display: none;
}

.card {
  background: linear-gradient(180deg, #151515, #111111);
  border: 1px solid #242424;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.card:hover {
  transform: translateY(-2px);
  border-color: #343434;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.2px;
}

.badge.recommended {
  background: #d4af37;
  color: black;
}

.badge.premium {
  background: #3f51b5;
  color: white;
}

.card h2 {
  margin: 0 0 8px 0;
  font-size: 21px;
  line-height: 1.25;
}

.trade {
  color: #d4af37;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 15px;
}

.city {
  color: #b8b8b8;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.distance {
  margin: 0 0 14px;
  color: #9ad0ff;
  font-size: 14px;
  font-weight: bold;
}

.call-btn {
  display: inline-block;
  padding: 11px 14px;
  border-radius: 11px;
  background: #d4af37;
  color: black;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.call-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.18);
}

.secondary-btn {
  display: inline-block;
  padding: 11px 14px;
  border-radius: 11px;
  background: #1f1f1f;
  color: white;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #333;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  background: #262626;
  border-color: #444;
}

.call-btn.disabled,
.secondary-btn.disabled {
  background: #444;
  color: #bbb;
  pointer-events: none;
  box-shadow: none;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.card-actions .call-btn,
.card-actions .secondary-btn {
  flex: 1;
  min-width: 160px;
  text-align: center;
  box-sizing: border-box;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.details-btn {
  appearance: none;
}

.suggestions.hidden {
  display: none;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #171717;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 50;
}

.suggestion-item {
  width: 100%;
  border: none;
  background: transparent;
  color: white;
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #242424;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #212121;
}

.suggestion-label {
  font-weight: bold;
}

.suggestion-type {
  color: #d4af37;
  font-size: 12px;
  white-space: nowrap;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  width: min(720px, 100%);
  background: linear-gradient(180deg, #171717, #121212);
  border: 1px solid #2a2a2a;
  border-radius: 24px;
  padding: 26px;
  color: white;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: #222;
  color: white;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.close-btn:hover {
  background: #2b2b2b;
  transform: scale(1.03);
}

#modalName {
  margin: 0 48px 8px 0;
  font-size: 30px;
  line-height: 1.2;
}

#modalTrade {
  color: #d4af37;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 6px;
}

#modalLocation {
  color: #bbbbbb;
  margin-bottom: 12px;
  font-size: 15px;
}

.detail-block {
  margin-top: 18px;
  padding: 15px;
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 15px;
}

.detail-block strong {
  display: block;
  margin-bottom: 8px;
  color: #d4af37;
  font-size: 14px;
}

.detail-block div,
.detail-block a {
  color: #efefef;
  line-height: 1.55;
  word-break: break-word;
}

.detail-block a {
  text-decoration: none;
}

.detail-block a:hover {
  text-decoration: underline;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.modal-actions .call-btn,
.modal-actions .secondary-btn {
  flex: 1;
  min-width: 180px;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .header {
    padding: 24px 16px 20px;
  }

  .header h1 {
    font-size: 28px;
  }

  .container {
    padding-top: 16px;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-height: calc(100vh - 10px);
    border-radius: 22px 22px 0 0;
    padding: 22px 20px 24px 20px;
  }

  #modalName {
    font-size: 25px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .call-btn,
  .modal-actions .secondary-btn,
  .card-actions .call-btn,
  .card-actions .secondary-btn {
    width: 100%;
  }

  .card-actions {
    flex-direction: column;
  }
}