/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

.building-widget {
  margin-top: 55px;
  padding: 25px;
}

.building-image-container {
  position: relative;
  width: 100%;
  max-width: 1440px;
  border-radius: 20px;
}

.building-image-container.building-image-container > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0px 4px 8px 0 rgba(0, 0, 0, 0.25);
}

.building-content {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* .building-image-container, */
.building-image-container svg {
  position: absolute;
  top: -1px;
  left: 0;
  width: calc(100%);
  pointer-events: none;

  polygon {
    pointer-events: all;
    fill-opacity: 0.3;
    stroke-width: 5px;
    opacity: 1;
  }

  polygon:hover {
    cursor: pointer;
    fill-opacity: 0.8;
  }
}

.apartment-tooltip {
  position: absolute;
  padding: 10px;
  background: #fff;
  color: #000;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  line-height: 1.4;
  min-width: 160px;
  pointer-events: none;
  display: none;
  z-index: 9999;
}

.apartment-tooltip__title {
  font-weight: bold;
  margin-bottom: 6px;
}

.apartment-tooltip__line {
  margin-bottom: 4px;
}

.apartment-tooltip__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.apartment-tooltip__dot--available-color {
  background-color: limegreen;
}

.apartment-tooltip__dot--unavailable-color {
  background-color: indianred;
}

.apartment-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  margin-top: 25px;
  height: 500px;
  max-width: 1000px;
  overflow-y: scroll;
  border-radius: 20px 20px 0 0;
}

.apartment-list__item {
  border-bottom: 1px solid #e0e0e0;
  padding: 10px;
  transition: background-color 0.5s ease;
}

.apartment-list__item:hover {
  background-color: #e0e0e0;
}

.apartment-list__item:first-child {
  border-radius: 20px 20px 0 0;
}

.apartment-list__item:last-child {
  border-radius: 0 0 20px 20px;
  border-bottom: none;
}

.apartment-card {
  display: flex;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0;
}

.apartment-card__image img {
  width: 120px;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}

.apartment-card__content {
  flex: 1;
}

.apartment-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apartment-card__title {
  font-weight: 600;
  font-size: 16px;
}

.apartment-card__status {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.apartment-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: #ccc;
}

.apartment-card__status--available .apartment-card__dot {
  background-color: #2ecc71;
}

.apartment-card__status--unavailable .apartment-card__dot {
  background-color: #e74c3c;
}

.apartment-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 14px;
}

.apartment-card__detail {
  white-space: nowrap;
}

.apartment-card__detail i {
  margin-right: 6px;
  color: #555;
}

.apartment-card__price {
  margin-top: 0.5rem;
  font-weight: bold;
  font-size: 15px;
}

.building-view-switcher {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.building-view-switcher__button {
  border: 2px solid #000;
  background: #fff;
  color: #000;
  border-radius: 3px;
  padding: 0.65rem 1.25rem;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.building-view-switcher__button:hover,
.building-view-switcher__button:focus-visible {
  outline: none;
}

.building-view-switcher__button.is-active {
  background: #000;
  color: #fff;
}

.building-views {
  width: 100%;
}

.building-view {
  display: none;
}

.building-view.is-active {
  display: block;
}

.building-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 768px) {
  .building-widget {
    border-radius: 20px;
    box-shadow: 0px 4px 20px 0 rgba(0, 0, 0, 0.25);
  }

  .apartment-list {
    padding: 0 25px;
  }
}
