/* Responsive Recent Listings Table Component */
/* Converts table to card layout on mobile */

/* Desktop: standard table */
@media (min-width: 768px) {
  .recent-listings-table {
    display: table;
    width: 100%;
  }

  .recent-listings-table thead {
    display: table-header-group;
  }

  .recent-listings-table tbody {
    display: table-row-group;
  }

  .recent-listings-table tr {
    display: table-row;
  }

  .recent-listings-table th,
  .recent-listings-table td {
    display: table-cell;
  }

  /* Hide mobile-only elements on desktop */
  .recent-listings-mobile-header {
    display: none !important;
  }
}

/* Mobile: card layout */
@media (max-width: 767px) {
  .recent-listings-table-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: visible !important;
  }

  .recent-listings-table-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .recent-listings-table {
    display: block;
    border: none !important;
    box-shadow: none !important;
  }

  .recent-listings-table thead {
    display: none;
  }

  .recent-listings-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .recent-listings-table tr {
    display: flex;
    flex-direction: column;
    background: rgb(29 25 50 / 0.5);
    border: 1px solid rgb(99 102 241 / 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
  }

  .recent-listings-table tr:hover {
    background: rgb(55 65 81 / 0.3);
  }

  .recent-listings-table td {
    display: block;
    text-align: left !important;
    padding: 0 !important;
    border: none !important;
    white-space: normal !important;
  }

  /* Product cell - prominent header */
  .recent-listings-table .cell-product {
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid rgb(99 102 241 / 0.2) !important;
    margin-bottom: 0.75rem;
    order: 1;
  }

  .recent-listings-table .cell-product .ml-3 p {
    font-size: 0.9375rem;
  }

  /* User cell */
  .recent-listings-table .cell-user {
    margin-bottom: 0.75rem;
    order: 2;
  }

  .recent-listings-table .cell-user .flex {
    flex-wrap: nowrap;
  }

  /* Mobile info grid - show on mobile */
  .recent-listings-table .recent-listings-mobile-header {
    display: block !important;
    order: 3;
  }

  .recent-listings-mobile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgb(99 102 241 / 0.08);
    border-radius: 0.5rem;
  }

  .recent-listings-mobile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }

  .recent-listings-mobile-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgb(167 155 183);
    letter-spacing: 0.05em;
  }

  .recent-listings-mobile-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
  }

  /* Hide individual cells that are now in the mobile grid */
  .recent-listings-table .cell-price,
  .recent-listings-table .cell-quantity,
  .recent-listings-table .cell-package,
  .recent-listings-table .cell-posted {
    display: none !important;
  }

  /* Action cell - full width button */
  .recent-listings-table .cell-action {
    order: 4;
  }

  .recent-listings-table .cell-action a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem !important;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: rgb(195 222 99 / 0.15);
  }

  .recent-listings-table .cell-action a:hover {
    background: rgb(195 222 99);
  }
}

/* Tablet category filters - 2x2 grid */
@media (min-width: 640px) and (max-width: 1023px) {
  .recent-listings-category-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem !important;
  }

  .recent-listings-category-filters > div {
    flex: none !important;
    width: 100% !important;
  }
}
