/* ================================================================
   Tender Plugin — Frontend Styles
   Single-column card list (desktop + mobile)
   Matches the exact layout from the screenshot
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --tnd-green:         #1a6b3a;
  --tnd-green-bg:      #f0faf4;
  --tnd-green-border:  #bbf7d0;
  --tnd-text:          #111827;
  --tnd-muted:         #6b7280;
  --tnd-border:        #e5e7eb;
  --tnd-bg:            #f5f5f0;
  --tnd-white:         #ffffff;
  --tnd-radius:        12px;
  --tnd-radius-sm:     8px;
  --tnd-shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --tnd-shadow-hov:    0 4px 20px rgba(0,0,0,.1);
  --tnd-transition:    .2s cubic-bezier(.4,0,.2,1);

  /* Status colours */
  --st-open-color:      #16a34a;
  --st-open-bg:         #f0fdf4;
  --st-open-border:     #bbf7d0;
  --st-closed-color:    #dc2626;
  --st-closed-bg:       #fef2f2;
  --st-closed-border:   #fecaca;
  --st-ongoing-color:   #2563eb;
  --st-ongoing-bg:      #eff6ff;
  --st-ongoing-border:  #bfdbfe;
  --st-pulse-color:     #d97706;
  --st-pulse-bg:        #fffbeb;
  --st-pulse-border:    #fde68a;
}

/* ── Reset ─────────────────────────────────────────────── */
.tnd-container * {
  box-sizing: border-box;
}

/* ── Outer Wrapper ─────────────────────────────────────── */
.tnd-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 60px;
  font-family: 'Inter', sans-serif;
  color: var(--tnd-text);
}

/* ── List (single column) ──────────────────────────────── */
.tnd-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ══════════════════════════════════════════════════════════
   CARD
   ══════════════════════════════════════════════════════════ */
.tnd-card {
  background: var(--tnd-white);
  border: 1px solid var(--tnd-border);
  border-radius: var(--tnd-radius);
  padding: 22px 24px 20px;
  box-shadow: var(--tnd-shadow);
  transition: box-shadow var(--tnd-transition), transform var(--tnd-transition);
}

.tnd-card:hover {
  box-shadow: var(--tnd-shadow-hov);
  transform: translateY(-2px);
}

/* ── Card Header: Title + Status Badge ─────────────────── */
.tnd-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* ── Title ─────────────────────────────────────────────── */
.tnd-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tnd-text);
  flex: 1;
}

/* ── Status Badge ──────────────────────────────────────── */
.tnd-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid transparent;
}

.tnd-status--open {
  color: var(--st-open-color);
  background: var(--st-open-bg);
  border-color: var(--st-open-border);
}

.tnd-status--closed {
  color: var(--st-closed-color);
  background: var(--st-closed-bg);
  border-color: var(--st-closed-border);
}

.tnd-status--ongoing {
  color: var(--st-ongoing-color);
  background: var(--st-ongoing-bg);
  border-color: var(--st-ongoing-border);
}

.tnd-status--pulse {
  color: var(--st-pulse-color);
  background: var(--st-pulse-bg);
  border-color: var(--st-pulse-border);
}

/* ── Category Tag ──────────────────────────────────────── */
.tnd-category-wrap {
  margin-bottom: 12px;
}

.tnd-category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 6px;
  border: 1.5px solid #d1d5db;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  letter-spacing: .01em;
}

/* ── Description ───────────────────────────────────────── */
.tnd-description {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--tnd-muted);
}

/* ── Meta Row ──────────────────────────────────────────── */
.tnd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--tnd-border);
}

.tnd-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tnd-muted);
  white-space: nowrap;
}

/* SVG icon */
.tnd-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #9ca3af;
  display: inline-block;
  vertical-align: middle;
}

/* Email link */
.tnd-email-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--tnd-transition);
}

.tnd-email-link:hover {
  color: var(--tnd-green);
  text-decoration: underline;
}

/* ── Empty State ───────────────────────────────────────── */
.tnd-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--tnd-muted);
}

.tnd-empty-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════════════
   MOBILE  ≤ 640px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .tnd-container {
    padding: 0 14px 48px;
  }

  .tnd-card {
    padding: 18px 16px 16px;
    border-radius: 14px;
  }

  /* On mobile: stack title above status badge */
  .tnd-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
  }

  .tnd-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    order: 1;
  }

  /* Status goes below title on mobile */
  .tnd-status {
    order: 2;
    font-size: 13px;
    padding: 5px 16px;
  }

  .tnd-category-wrap {
    margin-bottom: 14px;
  }

  .tnd-category {
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 8px;
  }

  .tnd-description {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 16px;
  }

  /* Stack meta items vertically on mobile */
  .tnd-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 16px;
  }

  .tnd-meta-item {
    font-size: 14px;
    white-space: normal;
  }

  .tnd-icon {
    width: 17px;
    height: 17px;
  }
}

/* ── Very small screens ────────────────────────────────── */
@media (max-width: 380px) {
  .tnd-title {
    font-size: 16px;
  }
}
