/*
 * Lotus — custom CSS (data-bound styles que daisyUI/Tailwind não cobrem)
 *
 * Os componentes UI (btn, card, alert, navbar, form inputs) usam daisyUI.
 * Este arquivo cobre apenas:
 *   - CSS Grid variável (colunas dinâmicas via inline style)
 *   - Cores de status de lote (paleta semântica do domínio, não tema daisyUI)
 *   - Legenda com bolinhas coloridas
 */

.lots-grid {
  display: grid;
  gap: 4px;
}

.lot-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 0.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s;
}

.lot-cell:hover {
  transform: scale(1.08);
  z-index: 10;
}

.lot-available    { background: #C0DD97; border-color: #639922; color: #27500A; }
.lot-reserved     { background: #FAC775; border-color: #BA7517; color: #633806; }
.lot-negotiating { background: #85B7EB; border-color: #185FA5; color: #042C53; }
.lot-sold         { background: #D3D1C7; border-color: #5F5E5A; color: #2C2C2A; }

.legenda {
  display: flex;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
  align-items: center;
}

.legenda > span {
  display: inline-flex;
  align-items: center;
}

/* Links de filtro de status na legenda (?status=X). O ativo ganha destaque. */
.legenda-filter {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.legenda-filter:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.legenda-filter[aria-pressed="true"] {
  border-color: color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-weight: 600;
}

.legenda .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 6px;
  border: 0.5px solid;
}

.legenda .dot.lot-available    { background: #C0DD97; border-color: #639922; }
.legenda .dot.lot-reserved     { background: #FAC775; border-color: #BA7517; }
.legenda .dot.lot-negotiating { background: #85B7EB; border-color: #185FA5; }
.legenda .dot.lot-sold         { background: #D3D1C7; border-color: #5F5E5A; }

/* Status pill no modal de lote */
.status-pill {
  display: inline-flex;
  align-items: center;
  border: 0.5px solid;
}

/* ── Mapa com pinos ────────────────────────────────────────────── */
.map-canvas {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.map-canvas.is-panning {
  cursor: grabbing;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
}

.map-canvas.is-editing {
  cursor: crosshair;
}

/* Durante o arrasto de pan, o cursor "grabbing" vence, mesmo em modo edição. */
.map-canvas.is-editing.is-panning {
  cursor: grabbing;
}

.map-transform {
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
}

.map-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lot-pin {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--pin-scale, 1));
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1;
}

.lot-pin.is-selected {
  outline: 3px solid #2563eb;
  outline-offset: 1px;
  z-index: 5;
}

/* Pino com pop-up aberto sobe acima dos demais pinos (cada pino cria seu
   próprio stacking context via transform, então o z-index do pop-up sozinho
   não basta). */
.lot-pin--popup-open {
  z-index: 40;
}

/* Filtro de status ativo: pinos que não batem ficam atenuados. */
.lot-pin--dimmed {
  opacity: 0.25;
}

.lot-pin__number {
  pointer-events: none;
}

.lot-pin__popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 12px;
  font-size: 12px;
  font-weight: 400;
  z-index: 20;
}

/* Pino perto do topo: abre o pop-up abaixo dele para não recortar no viewport. */
.lot-pin__popup--below {
  bottom: auto;
  top: calc(100% + 8px);
}

.lot-pin__popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lot-pin__popup-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin-bottom: 10px;
}

.lot-pin__popup-dl dt { opacity: 0.6; }
.lot-pin__popup-dl dd { text-align: right; margin: 0; }
