/*
 * dashboard-table.css
 * Shared styles for all dashboard listing pages.
 * Converted from: frontend-nextjs/src/assets/scss/components/_table.scss
 *                 frontend-nextjs/src/assets/scss/components/dashboard/_gp-dashboard.scss
 */

/* ── Page Header ── */
.gp-dashboard-header {
  padding: 25px 32px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gp-dashboard-header .left p {
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 600;
  color: #7b7c7e;
}
.gp-dashboard-header .gp-header-title {
  color: #19263a;
  font-size: 28px;
  font-weight: 400;
  font-family: "DM Serif Display", serif;
  margin: 0 0 4px;
}
.gp-dashboard-header .cta {
  display: flex;
  gap: 12px;
}

/* ── Table container ── */
.table-wrap {
  padding: 0 32px 30px;
  overflow-x: auto;
}

.gp-data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 17px 1px #e5ebf7;
  overflow: hidden;
}

.gp-data-table thead tr {
  border-bottom: 1px solid #eaeaea;
}

.gp-data-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: #19263a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 16px 14px;
  text-align: left;
  white-space: nowrap;
}

.gp-data-table tbody tr {
  border-bottom: 1px solid #eaeaea;
  transition: background 0.2s;
}
.gp-data-table tbody tr:last-child {
  border-bottom: 0;
}
.gp-data-table tbody tr:hover {
  background: #f6f8ff;
}

.gp-data-table tbody td {
  font-size: 14px;
  color: #19263a;
  padding: 14px 14px;
  vertical-align: middle;
}

/* ── Thumbnail cell ── */
.gp-data-table .cell-thumb img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.gp-data-table .cell-thumb .no-thumb {
  width: 80px;
  height: 60px;
  background: #f1f3f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b5c3;
  font-size: 20px;
}

/* ── Status badges ── */
.status-cell-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.status-verified {
  color: #17ba93;
}
.status-pending {
  color: #f6ad3f;
}
.status-answered {
  color: #17ba93;
}
.status-remaining {
  color: #f6ad3f;
}

/* ── Action buttons ── */
.gp-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-action-item {
  width: 32px;
  height: 32px;
  border: 1px solid #e2e6ef;
  background: #fff;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #19263a;
  font-size: 15px;
  transition: all 0.2s;
  padding: 0;
  text-decoration: none;
}
.table-action-item:hover {
  background: #f6f8ff;
  border-color: #b5c4fb;
  color: #e78125;
}
.table-action-item--danger:hover {
  color: #f74641;
  border-color: #f74641;
  background: #fff5f5;
}
.table-action-item--link {
  width: auto;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #e78125;
  border-color: #e78125;
  border-radius: 4px;
}
.table-action-item--link:hover {
  background: #e78125;
  color: #fff;
}

/* ── Pagination ── */
.gp-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px 0 0;
}
.gp-pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e2e6ef;
  background: #fff;
  border-radius: 4px;
  font-size: 13px;
  color: #19263a;
  cursor: pointer;
  transition: all 0.2s;
}
.gp-pagination button.active,
.gp-pagination button:hover:not(:disabled) {
  background: #e78125;
  border-color: #e78125;
  color: #fff;
}
.gp-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gp-pagination-info {
  font-size: 12px;
  color: #7b7c7e;
  margin-right: auto;
}

/* ── Add button ── */
.btn-add-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #e78125;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-add-item:hover {
  background: #cf7120;
  color: #fff;
}

/* ── Modal overlay ── */
.gp-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.gp-modal-overlay.open {
  display: flex;
}
.gp-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 32px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}
.gp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  color: #7b7c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.gp-modal-close:hover {
  background: #f1f3f9;
}
.gp-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #19263a;
  margin: 0 0 20px;
  font-family: "DM Serif Display", serif;
}
.gp-modal-body p {
  font-size: 15px;
  color: #19263a;
  line-height: 1.6;
}

/* ── Question text block ── */
.question-txt {
  background: #f6f8ff;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.question-txt p {
  margin: 0;
  font-size: 14px;
  color: #19263a;
}

/* ── Empty state ── */
.gp-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #7b7c7e;
  font-size: 15px;
}

/* ── Status select (native — used on call-back-requests, questions-asked) ── */
.status-select select {
  height: 36px;
  border: 1px solid #cdcdcd;
  border-radius: 4px;
  font-size: 13px;
  color: #19263a;
  padding: 0 10px;
  cursor: pointer;
  min-width: 120px;
}

/* ── Custom status button (dot + label + chevron) ── */
.gp-status-btn-wrap {
  position: relative;
  display: inline-block;
}
.gp-status-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  color: #19263a;
  font-family: inherit;
  line-height: 1.4;
}
.gp-status-btn:focus { outline: none; }
.gp-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.gp-status-btn.status--complete .gp-status-dot   { background: #22c55e; }
.gp-status-btn.status--remaining .gp-status-dot  { background: #ef4444; }
.gp-status-btn.status--answered .gp-status-dot   { background: #17ba93; }
.gp-status-chevron {
  flex-shrink: 0;
  transition: transform 0.18s;
  color: #6c757d;
}
.gp-status-btn-wrap.is-open .gp-status-chevron { transform: rotate(180deg); }
.gp-status-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,.13);
  min-width: 140px;
  overflow: hidden;
}
.gp-status-btn-wrap.is-open .gp-status-dropdown { display: block; }
.gp-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 14px;
  color: #19263a;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.gp-status-option:hover  { background: #f5f7fb; }
.gp-status-option.is-selected { font-weight: 500; background: #eef2ff; }

/* ── Notice ── */
.gp-table-notice {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin: 0 32px 16px;
}
.gp-table-notice--success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.gp-table-notice--error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ── Read-more truncate ── */
.gp-truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ── Button spinner ── */
@keyframes gp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.gp-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gp-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ── Success popup ── */
.gp-success-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
}
.gp-success-popup-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  animation: gp-popup-in .22s ease;
}
@keyframes gp-popup-in {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.gp-success-popup-icon {
  width: 56px;
  height: 56px;
  background: #e8f9f4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.gp-success-popup-title {
  font-size: 20px;
  font-weight: 600;
  color: #19263a;
  margin-bottom: 8px;
}
.gp-success-popup-msg {
  font-size: 14px;
  color: #7b7c7e;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .gp-dashboard-header {
    padding: 20px 16px 20px;
    display: block;
  }
  .gp-dashboard-header .cta {
    margin-top: 14px;
  }
  .table-wrap {
    padding: 0 16px 30px;
  }
}
