/* ==================== REQUEST CARD STYLES ==================== */

.req-card {
  background: #ffffff;
  border: 2px solid #b7f3d0; /* light green */
  border-radius: 1.375rem; /* 22px */
  padding: 0.875rem 0.875rem 0.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 100%;
  min-width: 0;

  /* Container queries: card internals adapt to their own width */
  container-type: inline-size;
  container-name: req-card;
}

.req-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
  border-color: #16a34a; /* green-600 */
}

/* ==================== HOVER LAYER (green tint, like item card) ==================== */

.req-hover-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
  pointer-events: none;
  background: rgba(220, 252, 231, 0); /* green-100 */
  border-radius: inherit;
}

.req-card:hover .req-hover-layer {
  opacity: 1;
  background: rgba(220, 252, 231, 0.70);
}

/* ==================== CONTENT LAYERS (above hover layer) ==================== */

.req-top,
.req-title,
.req-meta,
.req-footer {
  position: relative;
  z-index: 2;
}

/* ==================== HOVER HINT (inside .req-meta, only link in the card) ==================== */

.req-hint-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  margin-right: auto; /* RTL: push hint to the far left (end of row) */
}

.req-card:hover .req-hint-container {
  opacity: 1;
}

/* Always visible on touch devices (no hover) */
@media (hover: none) {
  .req-hint-container {
    opacity: 1;
  }
}

.req-hint-text {
  display: flex;
  flex-direction: column;
  font-size: 0.6875rem; /* 11px */
  font-weight: 900;
  color: #16a34a; /* green-600 */
  line-height: 1.1;
  text-align: center;
}

.req-hint-arrow {
  color: #16a34a;
  transform-origin: center;
}

/* Arrow animation */
@keyframes nudgeLeft {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-6px);
  }
}

.req-card:hover .req-hint-arrow {
  animation: nudgeLeft 0.65s ease-in-out infinite;
}

/* ==================== TOP PILLS ==================== */

.req-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.req-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem; /* 12px */
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.req-pill-featured {
  background: #16a34a; /* green-600 */
  color: #ffffff;
}

.req-pill-category {
  background: #ffffff;
  color: #15803d; /* green-700 */
  border: 2px solid #15803d;
  cursor: pointer;
  position: relative;
  z-index: 30;
  transition: all 0.18s ease;
}

.req-pill-category:hover {
  background: #dcfce7; /* green-100 */
  color: #1e293b; /* slate-800 */
}

/* ==================== TITLE ==================== */

.req-title {
  font-size: 1rem; /* 16px */
  font-weight: 900;
  color: #374151; /* gray-700 */
  line-height: 1.8;
  margin: 0.375rem 0 0.625rem;

  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  /* Ensure minimum height for 2 lines */
  min-height: calc(1.8em * 2);
}

/* ==================== META INFO ==================== */

.req-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.6875rem !important; /* 11px */
  font-weight: 400 !important;
  color: #6b7280 !important; /* gray-500 */
  padding-bottom: 0.625rem;
  border-bottom: 2px solid #b7f3d0; /* light green */
}

.req-meta-item {
  display: inline-flex;
  gap: 0.375rem;
  align-items: center;
  white-space: nowrap !important;
}

.req-meta-icon {
  width: 0.875rem; /* 14px — matches .ad-ico */
  height: 0.875rem;
  color: #16a34a; /* green-600 */
}

/* ==================== FOOTER ==================== */

.req-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.625rem;
  flex-direction: row-reverse;
}

/* Budget */
.req-budget-container {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-direction: row-reverse;
  flex-shrink: 0;
}

.req-budget-price {
  border: 2px solid #b7f3d0; /* light green */
  color: #16a34a; /* green-600 */
  font-weight: 900;
  font-size: 0.8125rem; /* 13px */
  padding: 0.3rem 0.625rem;
  border-radius: 0.75rem; /* 12px */
  background: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.req-budget-label {
  background: #16a34a; /* green-600 */
  color: #ffffff;
  font-weight: 900;
  font-size: 0.625rem; /* 10px */
  width: 1.75rem; /* 28px */
  height: 1.75rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
}

/* User */
.req-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

.req-avatar {
  width: 2.25rem; /* 36px */
  height: 2.25rem;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.req-avatar-fallback {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: #e5e7eb; /* gray-200 */
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #6b7280; /* gray-500 */
  font-size: 0.8125rem; /* 13px */
  flex-shrink: 0;
}

.req-user-name {
  font-weight: 500 !important;
  color: #111827 !important; /* gray-900 */
  font-size: 0.75rem !important; /* 12px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

/* ── sm+ base: match .ad-meta (12px) and .ad-seller-name (14px) ── */
@media (min-width: 640px) {
  .req-meta      { font-size: 0.75rem !important; }    /* 12px */
  .req-user-name { font-size: 0.875rem !important; }   /* 14px */
}

/* ── Mobile: match item-card mobile sizes ── */
@media (max-width: 639px) {
  .req-meta      { font-size: 0.8125rem !important; }  /* 13px */
  .req-meta-icon { width: 0.9375rem !important; height: 0.9375rem !important; }
  .req-user-name { font-size: 0.875rem !important; }   /* 14px */
}

/* ==================== CONTAINER QUERIES (desktop only — mobile always uses default sizes) ==================== */

@media (min-width: 640px) {

  /* ── 4-col width: card ≤ 310px ── */
  @container req-card (max-width: 310px) {
    .req-title         { font-size: 0.9375rem; }
    .req-meta          { font-size: 0.75rem; gap: 0.75rem; }
    .req-meta-icon     { width: 0.9375rem; height: 0.9375rem; }
    .req-pill          { font-size: 0.75rem; padding: 0.3rem 0.625rem; }
    .req-avatar        { width: 2rem; height: 2rem; }
    .req-avatar-fallback { width: 2rem; height: 2rem; font-size: 0.8125rem; }
    .req-user-name     { font-size: 0.875rem; }
    .req-budget-price  { font-size: 0.8125rem; padding: 0.3rem 0.625rem; }
    .req-budget-label  { width: 1.625rem; height: 1.625rem; font-size: 0.5625rem; }
  }

  /* ── 5-col width: card ≤ 260px ── */
  @container req-card (max-width: 260px) {
    .req-title         { font-size: 0.875rem; line-height: 1.6; min-height: calc(1.6em * 2); }
    .req-meta          { font-size: 0.6875rem; gap: 0.625rem; }
    .req-meta-icon     { width: 0.875rem; height: 0.875rem; }
    .req-top           { margin-bottom: 0.375rem; }
    .req-pill          { font-size: 0.6875rem; padding: 0.25rem 0.5625rem; }
    .req-avatar        { width: 1.875rem; height: 1.875rem; }
    .req-avatar-fallback { width: 1.875rem; height: 1.875rem; font-size: 0.75rem; }
    .req-user-name     { font-size: 0.6875rem; }
    .req-budget-price  { font-size: 0.75rem; padding: 0.3rem 0.625rem; }
    .req-budget-label  { width: 1.5rem; height: 1.5rem; font-size: 0.5rem; }
    .req-footer        { padding-top: 0.5rem; }
  }

}
