/* ════════════════════════════════════════════════════════════════
   VERIFLY — Component library
   ──────────────────────────────────────────────────────────────
   Depends on: shared/tokens.css
   Reference:  drafts/draft-1/  (visual UI library)
   ──────────────────────────────────────────────────────────── */

/* ════════════════════════════════════════════════════════════
   BUTTON — .btn + variants
   ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 13px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1;
  color: var(--color-ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--duration-fast) ease,
    color      var(--duration-fast) ease,
    transform  var(--duration-fast) ease;
}
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: var(--color-blue);
  color: var(--color-white);
  box-shadow: var(--shadow-blue);
}
.btn--primary:hover {
  background: var(--color-blue-deep);
  transform: translateY(-1px);
}

.btn--ghost {
  border: 1px solid var(--color-divider);
}
.btn--ghost:hover { background: var(--color-paper); }

.btn--text:hover { background: rgba(255, 255, 255, 0.7); }

/* Sizes */
.btn--lg { padding: 14px 18px; font-size: 15px; }
.btn--sm { padding: 8px 10px;  font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   CHIP — .chip + variants (tags, status pills, eyebrow, saved)
   ──────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* Color variants */
.chip--green  { background: var(--color-success-bg); color: var(--color-success-fg); }
.chip--violet { background: var(--color-violet-bg);  color: var(--color-violet-fg); }
.chip--orange { background: var(--color-warn-bg);    color: var(--color-warn-fg); }

/* Solid blue chip — for "Saved AED 180K" slot */
.chip--blue {
  background: var(--color-blue);
  color: var(--color-white);
  font-weight: 600;
  padding: 5px 10px;
}

/* Mono chip — uppercase tracked */
.chip--mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

/* Status pill — dark glass with green dot ("Closed in 22h") */
.chip--status {
  padding: 5px 10px 5px 8px;
  background: var(--color-glass-dark);
  color: var(--color-success-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.chip--status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--color-success-accent);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
  flex-shrink: 0;
}

/* Eyebrow — mono uppercase with leading blue dot, no background */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-ink);
  line-height: 1;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--color-blue);
}

/* ════════════════════════════════════════════════════════════
   ICON TILE — Lucide icon in blue gradient rounded square
   ──────────────────────────────────────────────────────────── */

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-deep) 100%);
  color: var(--color-white);
  box-shadow: 0 4px 12px -4px rgba(75, 108, 255, 0.5);
  flex-shrink: 0;
}
.icon-tile svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-tile--lg    { width: 56px; height: 56px; border-radius: var(--radius-xl); }
.icon-tile--lg svg { width: 28px; height: 28px; }
.icon-tile--sm    { width: 32px; height: 32px; border-radius: var(--radius-md); }
.icon-tile--sm svg { width: 18px; height: 18px; }

/* ════════════════════════════════════════════════════════════
   MARKER — pulsing circle on map/video (Figma 27:643)
   ──────────────────────────────────────────────────────────── */

.marker {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  outline: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
.marker__pulse {
  position: absolute;
  inset: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(75, 108, 255, 0.33);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transform: scale(0.85);
  opacity: 0.7;
  animation: marker-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes marker-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50%      { transform: scale(1.18); opacity: 1; }
}
.marker__core {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(75, 108, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.marker:hover .marker__core,
.marker:focus-visible .marker__core { transform: scale(1.15); }
.marker.is-pinned .marker__core      { transform: scale(1.05); }
.marker:focus-visible .marker__core {
  box-shadow: 0 0 0 2px var(--color-blue), 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ════════════════════════════════════════════════════════════
   PRICE STICK — vertical price tag on city panorama
   anchor (dot) at bottom · vertical line · price chip at top
   Height of line is set via inline `--line-h: 120px;`
   ──────────────────────────────────────────────────────────── */

.price-stick {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  /* Anchor coords (when used absolutely): set top/left/bottom inline */
}
.price-stick__chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  padding: 6px 10px;
  background: var(--color-white);
  color: var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-chip);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--duration-fast) var(--ease-out);
}
.price-stick__chip-currency {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--color-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.price-stick__chip-amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.price-stick__line {
  width: 1px;
  height: var(--line-h, 100px);
  background: linear-gradient(to bottom,
    rgba(75, 108, 255, 0.95) 0%,
    rgba(75, 108, 255, 0.45) 100%);
  margin-top: 4px;
}
.price-stick__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-blue);
  margin-top: -3px;
  box-shadow:
    0 0 0 4px rgba(75, 108, 255, 0.18),
    0 0 0 8px rgba(75, 108, 255, 0.08);
}
.price-stick:hover .price-stick__chip { transform: translateY(-2px); }

/* Featured variant — solid blue chip */
.price-stick--featured .price-stick__chip {
  background: var(--color-blue);
  color: var(--color-white);
  box-shadow: var(--shadow-blue);
}
.price-stick--featured .price-stick__chip-currency {
  color: rgba(255, 255, 255, 0.75);
}

/* ════════════════════════════════════════════════════════════
   DEAL CARD — base (220px, no photo) + --photo (260px) variant
   ──────────────────────────────────────────────────────────── */

.deal-card {
  position: relative;
  width: 220px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.deal-card--glass {
  background: var(--color-glass-bg);
  backdrop-filter: blur(var(--color-glass-blur));
  -webkit-backdrop-filter: blur(var(--color-glass-blur));
}
.deal-card--photo { width: 260px; }

.deal-card__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #E5E7EB;
  background-size: cover;
  background-position: center;
}
.deal-card--photo .deal-card__photo .chip--status {
  position: absolute;
  top: 10px;
  left: 10px;
}

.deal-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}
.deal-card--photo .deal-card__body {
  padding: 12px 14px 14px;
  gap: 10px;
}

.deal-card__location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 11px;
  color: var(--color-mute);
  font-weight: 500;
  line-height: 1;
}
.deal-card--photo .deal-card__location {
  font-size: 12px;
  gap: 6px;
}
.deal-card__location svg {
  width: 13px; height: 13px;
  color: var(--color-pin);
  flex-shrink: 0;
}

.deal-card__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.deal-card--photo .deal-card__title {
  font-size: 13px;
  line-height: 1.35;
}

.deal-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.deal-card__footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: 11px;
  border-top: 1px solid var(--color-divider);
}
.deal-card--photo .deal-card__footer {
  padding-top: 12px;
  border-top-color: var(--color-border-light);
}

.deal-card__price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
}
.deal-card__price-currency {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--color-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.deal-card--photo .deal-card__price-currency { font-size: 10px; }
.deal-card__price-amount {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.deal-card--photo .deal-card__price-amount { font-size: 17px; }

/* ════════════════════════════════════════════════════════════
   Reduced motion
   ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .marker__pulse { animation: none; }
  .btn, .deal-card, .price-stick__chip { transition-duration: 0ms; }
}
