/* Reset default WP table styles */
.ub-event-groups table {
  border-collapse: collapse;
  width: 100%;
  border: none;
  margin: 0;
  background: #fff;
  font-size: 14px;
}

/* Reduce padding for a more compact table and keep left alignment for first column */
.ub-event-groups th,
.ub-event-groups td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

/* Center all columns except the first one */
.ub-event-groups td:not(:first-child),
.ub-event-groups th:not(:first-child) {
  text-align: center;
}

.ub-event-groups th {
  background: #f7f7f7;
  font-weight: 600;
}

/* Compact layout */
.ub-event-groups tr:nth-child(even) {
  background-color: #fafafa;
}

/* Visually separate each group as cards */
.ub-event-groups tr {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin: 10px 0;
  padding: 8px 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Highlight key columns */
.ub-event-groups td.start_time,
.ub-event-groups td.remaining_capacity {
  font-weight: bold;
  color: #222;
}

.ub-event-groups td.remaining_capacity {
  background: #e9f8ec;
  color: #107a3d;
  text-align: center;
}

.ub-event-groups td.start_time {
  background: #eef4ff;
  color: #1a4ca3;
}

/* Make headers for these match */
.ub-event-groups th.start_time,
.ub-event-groups th.remaining_capacity {
  color: #000;
}

.ub-event-groups td,
.ub-event-groups th {
  padding: 4px 8px !important;
  border-bottom: 1px solid #ddd !important;
}

/* Prominent column styling */
.ub-event-groups td.ub-event-prominent,
.ub-event-groups th.ub-event-prominent {
  background: #e6ffb3;
  color: #8a6000;
  font-weight: 700;
  text-align: center;
  font-size: 15px;
}

/* Responsive stacked layout for mobile */
@media (max-width: 600px) {
  .ub-event-groups table,
  .ub-event-groups thead,
  .ub-event-groups tbody,
  .ub-event-groups th,
  .ub-event-groups td,
  .ub-event-groups tr {
    display: block;
  }

  .ub-event-groups thead {
    display: none;
  }

  .ub-event-groups tr {
    background: #f9fff0; /* soft greenish background for visibility */
    border: 1px solid #cde6a6;
    border-radius: 8px;
    margin: 12px 0;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  .ub-event-groups tr:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  }

  .ub-event-groups td {
    text-align: right !important;
    padding-left: 45% !important;
    position: relative;
    border: none !important;
    border-bottom: 1px solid #eee !important;
  }

  .ub-event-groups td::before {
    content: attr(data-label);
    position: absolute;
    left: 8px;
    top: 4px;
    font-weight: 600;
    text-align: left;
    color: #555;
  }

  .ub-event-groups td:last-child {
    border-bottom: none !important;
  }
}