/* ── Group Requests Button (map page) ── */
.group-requests-button {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #1e293bf2;
  color: white;
  border: 2px solid #7297F045;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  z-index: 99;
  min-width: 180px;
  box-sizing: border-box;
}

.group-requests-button:hover {
  border-color: #4752C4;
}

.group-requests-icon {
  display: none;
  flex-shrink: 0;
}

.group-requests-text {
  color: white;
}

.group-requests-badge {
  background: white;
  color: #5865F2;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  display: inline-block;
}

.group-requests-line {
  height: 25px;
  width: 2px;
  background-color: #4751c459;
  padding: 1px;
  margin: 1px;
}

/* ── Panel Shell ── */
.group-requests-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 500px;
  height: calc(100vh - 60px);
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  overflow: hidden;
}

.group-requests-panel.active {
  transform: translateX(0);
}

.gr-panel-inner {
  flex: 1;
  overflow-y: auto;
}

/* ── Panel Header ── */
.gr-panel-header {
  padding: 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.gr-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.gr-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
  transition: color 0.2s;
}

.gr-close-btn:hover {
  color: #222;
}

/* ══════════════════════════════════════════════════════════════════════
   Accordion (mirrors mt-accordion from manage-tracker)
   ══════════════════════════════════════════════════════════════════════ */

.group-requests-panel .mt-accordion {
  margin-bottom: 0;
  border-bottom: 1px solid #f0f0f0;
}

.group-requests-panel .mt-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  transition: background 0.2s;
}

.group-requests-panel .mt-accordion-header:hover {
  background: #f9f9f9;
}

.group-requests-panel .mt-accordion-chevron {
  flex-shrink: 0;
  transition: transform 0.3s;
  transform: rotate(0deg);
}

.group-requests-panel .mt-accordion.open .mt-accordion-chevron {
  transform: rotate(180deg);
}

.group-requests-panel .mt-accordion-body {
  display: none;
  padding: 16px 0;
}

.group-requests-panel .mt-accordion.open > .mt-accordion-body {
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════
   Review-info header (mirrors mt-review-info from manage-tracker)
   ══════════════════════════════════════════════════════════════════════ */

.group-requests-panel .mt-review-info {
  margin-bottom: 0;
  padding: 0 20px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.group-requests-panel .mt-review-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 0 0 4px;
}

.group-requests-panel .mt-review-subtitle {
  font-size: 14px;
  color: #555;
  margin: 0 0 4px;
}

.group-requests-panel .mt-review-stats {
  font-size: 13px;
  color: #888;
  margin: 0;
}

.group-requests-panel .mt-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f57d6;
  flex-shrink: 0;
}

.group-requests-panel .mt-status-dot.grey {
  background: #888;
}

.group-requests-panel .mt-status-dot.danger {
  background: #f34141;
}

.group-requests-panel .mt-status-dot.success {
  background: #27ae60;
}

.group-requests-panel .mt-status-text {
  /* default color inherited */
}

.group-requests-panel .mt-status-text.danger {
  color: #f34141;
}

.group-requests-panel .mt-status-text.success {
  color: #27ae60;
}

.group-requests-panel .mt-status-text.grey {
  color: #888;
}

.group-requests-panel .mt-trash-icon.danger {
  color: #f34141;
  vertical-align: middle;
}

.group-requests-panel .mt-check-icon.success {
  color: #27ae60;
  vertical-align: middle;
}

/* Resolved state (past/completed requests) */
.group-requests-panel .mt-review-info.resolved {
  background: #eaebf0;
  margin-top: 0;
  margin-bottom: 0;
  padding: 16px 20px;
  border-bottom: 1px solid #ced4da;
}

.group-requests-panel .mt-review-info.resolved .mt-review-status {
  margin-bottom: 2px;
}

.group-requests-panel .mt-review-info.resolved .mt-review-stats {
  font-size: 13px;
  color: #666;
}

/* Approved success state */
.group-requests-panel .mt-review-info.success {
  background: #f0f7f4;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Empty state */
.group-requests-panel .mt-empty-state {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 24px 20px 8px;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   Card-level styles (group-requests specific)
   ══════════════════════════════════════════════════════════════════════ */

.gr-request-card {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

.gr-request-card:last-child {
  border-bottom: none;
}

/* Card title: "Submit for review" / "Delete in progress" */
.gr-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Node Section ── */
.gr-node-section {
  padding: 8px 20px 12px;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

.gr-node-desc {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 0 0 6px;
}

.gr-node-row {
  font-size: 14px;
  color: #444;
  padding: 1px 0;
}

.gr-new-name {
  padding: 4px 20px 8px;
  font-size: 13px;
  color: #555;
}

/* ── Actions Row ── */
.gr-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 4px;
  justify-content: flex-end;
}

.gr-actions-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gr-btn-approve {
  background: #4a5fc1;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.gr-btn-approve:hover {
  background: #3d4fb0;
}

.gr-btn-reject {
  background: #fff;
  color: #555;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.gr-btn-reject:hover {
  background: #f5f5f5;
  border-color: #b0b0b0;
}

/* Cancel request link row */
.gr-cancel-row {
  padding: 0 20px 8px;
  text-align: right;
}

.gr-btn-cancel {
  background: none;
  color: #666;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.gr-btn-cancel:hover {
  color: #333;
}

/* Divider before votes */
.gr-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 8px 20px;
}

/* ── Votes headings ── */
.gr-votes-header-text {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin: 0;
  padding: 12px 20px 4px;
}

.gr-voter-heading {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 0;
  padding: 8px 20px 4px;
}

.gr-voter-list {
  padding: 0;
}

/* ── Voter Row ── */
.gr-vote-item {
  display: flex;
  align-items: flex-start;
  padding: 10px 20px 8px;
  gap: 12px;
}

.gr-voter-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4a5fc1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.gr-voter-avatar.gr-voter-avatar-has-img {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.gr-vote-info {
  flex: 1;
  min-width: 0;
}

.gr-voter-name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  display: block;
}

.gr-vote-status {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gr-vote-status.approved {
  color: #888;
}

.gr-vote-status.approved .gr-vote-icon {
  color: #27ae60;
}

.gr-vote-status.rejected {
  color: #666;
}

.gr-vote-status.rejected .gr-vote-icon {
  color: #f34141;
}

.gr-vote-icon {
  font-weight: 700;
}

.gr-vote-label {
  font-size: 12px;
}

.gr-chat-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #999;
  vertical-align: middle;
}

.gr-vote-reason {
  font-size: 12px;
  color: #999;
  display: block;
  margin-top: 4px;
  font-style: italic;
}

.gr-vote-time {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Overlay ── */
.group-requests-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: opacity 0.3s ease-in-out;
}

.group-requests-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.group-requests-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .group-requests-icon {
    display: block;
  }

  .group-requests-text,
  .group-requests-badge,
  .group-requests-line {
    display: none;
  }

  .group-requests-button {
    padding: 10px;
    min-width: inherit;
  }
}

@media (max-width: 600px) {
  .group-requests-panel {
    width: 100%;
  }

  .gr-actions-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .gr-actions-buttons {
    flex-direction: column;
    width: 100%;
  }

  .gr-btn-approve,
  .gr-btn-reject {
    width: 100%;
  }
}
