/* ============================================================
   listview.css — Property list view panel & toggle
   ============================================================ */

/* --- View toggle in toolbar --- */
.view-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-right: 4px;
}

.view-toggle__btn {
  width: 36px;
  height: 32px;
  padding: 0;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.view-toggle__btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.view-toggle__btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.view-toggle__btn--active {
  background: var(--color-primary);
  color: #fff;
}

.view-toggle__btn--active:hover {
  background: var(--color-primary);
  color: #fff;
  filter: brightness(1.15);
}

/* --- List container (same positioning strategy as #card-container) --- */
#list-container {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--card-width);
  z-index: 9998;
  pointer-events: none;
  display: none;
}

#list-container.list-active {
  pointer-events: auto;
  display: block;
}

/* --- List panel (scrollable inner region) --- */
.list-panel {
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.list-panel__header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

/* --- Individual list item card --- */
.list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.list-item:hover {
  background: var(--color-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary);
}

.list-item:active {
  transform: scale(0.99);
}

/* Thumbnail (left side) */
.list-item__thumb {
  width: 80px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface);
}

.list-item__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  width: 80px;
  height: 64px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--color-surface);
}

/* Info area (right of thumbnail) */
.list-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item__top-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-item__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.list-item__type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.list-item__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item__address {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item__stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.list-item__stat {
  font-size: 11px;
  color: var(--color-text-muted);
}

.list-item__stat strong {
  color: var(--color-text);
  font-weight: 600;
}

/* --- Responsive: mobile --- */
@media (max-width: 768px) {
  #list-container {
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .list-panel {
    height: calc(100vh - var(--header-height));
    border-radius: 0;
    box-shadow: none;
  }
}
