/* ============================
   Badge
============================ */

.ad-badge {
  position: absolute;
  top: 12px;
  left: 12px;

  background: rgba(0,0,0,0.65);
  color: #fff;

  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Profiltyp-badges (matchar databas: privatperson, foretag, konsult) */

.ad-card.is-privatperson .ad-badge {
  background: #111827;
}

.ad-card.is-foretag .ad-badge {
  background: var(--accent);
}

.ad-card.is-konsult .ad-badge {
  background: #0d9488;
}


/* ============================
   Ad Card
============================ */

.ad-card {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);

  display: flex;
  flex-direction: column;
  transition:
    transform .18s ease,
    box-shadow .18s ease;
  cursor: pointer;
}

.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ============================
   Image
============================ */

.ad-image {
  height: 160px;
  background:
    linear-gradient(135deg, #e5e7eb, #f3f4f6);
  position: relative;
}

.ad-image-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  z-index: 2;
}

.ad-image-badges .ad-badge {
  position: static;
}

.ad-badge--sponsored {
  background: #7c3aed !important;
}
.ad-badge--just-posted {
  background: #059669 !important;
}

.ad-scarcity {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 8px 0;
}

.ad-card-preview-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  padding: 12px 16px;
  background: #1f2937;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}
.ad-card-preview-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}
.ad-card-preview-tooltip__desc {
  margin: 0 0 8px 0;
  line-height: 1.4;
}
.ad-card-preview-tooltip__meta {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #d1d5db;
}

.ad-image-badges .ad-status {
  margin-bottom: 0;
}

.ad-image-badges .ad-status__badge {
  margin-left: auto;
}

.ad-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 60%,
    rgba(0,0,0,0.08)
  );
}

/* ============================
   Body
============================ */

.ad-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
}

.ad-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.ad-price {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.ad-description-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.ad-quickinfo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.ad-quickinfo__item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.ad-guest-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
}

.ad-card__footer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ad-card__timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

.ad-card__cta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.ad-card__report {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: auto;
}
.ad-card__report:hover {
  color: #b91c1c;
  text-decoration: underline;
}

/* ============================
   States (redo för senare)
============================ */

.ad-card.is-featured {
  outline: 2px solid var(--accent-soft);
}

.ad-badge--boost {
  background: #fef3c7;
  color: #92400e;
}

.ad-badge--featured {
  background: #dbeafe;
  color: #1e40af;
}

.ad-badge--top_listing {
  background: #dcfce7;
  color: #166534;
}

.ad-badge--highlighted {
  background: #fce7f3;
  color: #9d174d;
}

.ad-card--boost {
  outline: 2px solid #fbbf24;
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
}

.ad-card--featured {
  outline: 2px solid #3b82f6;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.18);
}

.ad-card--top_listing {
  outline: 2px solid #32d296;
}

.ad-card--highlighted {
  outline: 2px solid #ec4899;
}

.ad-card.is-disabled {
  opacity: .55;
  pointer-events: none;
}

.ad-card {
  opacity: 0;
  transform: translateY(12px);
  animation: cardFade .45s ease forwards;
}

.ad-card:nth-child(1) { animation-delay: .02s; }
.ad-card:nth-child(2) { animation-delay: .06s; }
.ad-card:nth-child(3) { animation-delay: .10s; }
.ad-card:nth-child(4) { animation-delay: .14s; }

@keyframes cardFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


