/* collab.css — Collaborator review system styles.
 * Matches the existing dark theme:
 *   Background: #0a0f1a
 *   Brand blue: #4A8FFF
 *   Accent amber (pending/warning): #f5a623
 */

/* ── Toolbar buttons ───────────────────────────────────────────────────── */
.collab-btn {
  background: #1a2a3a;
  color: #aabacd;
  border: 1px solid #2a3a4a;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.collab-btn:hover  { background: #243447; color: #ffffff; }
.collab-btn:active { transform: translateY(1px); }

.collab-reviews-btn {
  color: #ffffff;
  border-color: #4A8FFF;
  background: #1a2a4a;
}
.collab-reviews-btn:hover { background: #223366; }

.collab-badge-wrap { position: relative; display: inline-block; }

.collab-badge {
  display: inline-block;
  background: #f5a623;
  color: #0a0a0a;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Reviews dropdown ──────────────────────────────────────────────────── */
.collab-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #111820;
  border: 1px solid #2a3a4a;
  border-radius: 6px;
  min-width: 280px;
  max-width: 340px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.collab-dropdown-item {
  padding: 10px 14px;
  border-bottom: 1px solid #1a2a3a;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s ease;
}
.collab-dropdown-item:hover    { background: #1a2a3a; }
.collab-dropdown-item:last-of-type { border-bottom: none; }
.collab-dropdown-name { color: #ffffff; font-weight: 600; }
.collab-dropdown-time { color: #666; font-size: 11px; margin-top: 2px; }
.collab-dropdown-empty {
  padding: 16px 14px;
  color: #555;
  font-size: 12px;
  text-align: center;
}
.collab-dropdown-upload {
  padding: 10px 14px;
  border-top: 1px solid #1a2a3a;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  text-align: center;
  transition: color 0.1s ease;
}
.collab-dropdown-upload:hover { color: #aabacd; }

/* ── Review panel (owner, bottom bar) ──────────────────────────────────── */
.review-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0d1420;
  border-top: 2px solid #4A8FFF;
  z-index: 900;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
}
.review-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #1a2a3a;
  flex-shrink: 0;
}
.review-panel-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.review-panel-title > span:first-child {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}
.review-note {
  color: #888;
  font-size: 11px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-panel-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Review action buttons */
.review-btn {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.1s ease, color 0.1s ease;
}
.review-btn-accept {
  background: #1a3a1a;
  color: #4caf50;
  border: 1px solid #2a4a2a;
}
.review-btn-accept:hover { background: #1e441e; }

.review-btn-reject {
  background: #3a1a1a;
  color: #f44336;
  border: 1px solid #4a2a2a;
}
.review-btn-reject:hover { background: #441e1e; }

.review-btn-apply {
  background: #4A8FFF;
  color: #ffffff;
  border: 1px solid #4A8FFF;
}
.review-btn-apply:hover { background: #3a7fff; }

.review-btn-close {
  background: #1a1a1a;
  color: #888;
  border: 1px solid #333;
}
.review-btn-close:hover { color: #ffffff; }

/* ── Changes list (horizontal card row) ────────────────────────────────── */
.review-changes-list {
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 10px 16px;
  flex: 1;
  min-height: 0;
}
.review-change-card {
  flex-shrink: 0;
  background: #111820;
  border: 1px solid #2a3a4a;
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 200px;
  max-width: 240px;
  font-size: 12px;
  transition: opacity 0.1s ease, border-color 0.1s ease;
}
.review-change-card.accepted { border-color: #2a4a2a; background: #0d1a0d; }
.review-change-card.rejected { border-color: #4a2a2a; background: #1a0d0d; opacity: 0.55; }

.change-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.change-added    { background: #1a3a1a; color: #4caf50; }
.change-removed  { background: #3a1a1a; color: #f44336; }
.change-modified { background: #1a2a3a; color: #4A8FFF; }

.change-name  { color: #ffffff; font-weight: 600; margin-bottom: 2px; }
.change-field { color: #8898aa; font-size: 11px; }
.change-values {
  color: #aabacd;
  margin-top: 4px;
  font-size: 11px;
  word-break: break-word;
}
.change-old { text-decoration: line-through; color: #666; }
.change-new { color: #4caf50; }

.change-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.change-card-actions button {
  flex: 1;
  padding: 3px 0;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.1s ease, color 0.1s ease;
}
.btn-accept-change        { background: #1a3a1a; color: #4caf50; }
.btn-accept-change:hover  { background: #1e441e; }
.btn-reject-change        { background: #3a1a1a; color: #f44336; }
.btn-reject-change:hover  { background: #441e1e; }
.btn-accept-change.active { background: #4caf50; color: #0a0a0a; }
.btn-reject-change.active { background: #f44336; color: #ffffff; }

/* ── Collaborator submit bar ───────────────────────────────────────────── */
.collab-submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0d1420;
  border-top: 2px solid #f5a623;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 900;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
}
#collab-submit-label {
  color: #f5a623;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
#collab-note-input {
  flex: 1;
  background: #1a2a3a;
  border: 1px solid #2a3a4a;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
}
#collab-note-input:focus {
  outline: none;
  border-color: #f5a623;
}
.collab-submit-btn {
  background: #f5a623;
  color: #0a0a0a;
  font-weight: 700;
  border: none;
}
.collab-submit-btn:hover { background: #f0b030; }
.collab-submit-btn:disabled {
  background: #5a4a20;
  color: #aaa;
  cursor: wait;
}

/* ── Share modal ───────────────────────────────────────────────────────── */
.collab-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.collab-modal-box {
  background: #111820;
  border: 1px solid #2a3a4a;
  border-radius: 10px;
  padding: 28px 32px;
  width: 440px;
  max-width: calc(100vw - 40px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.collab-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}
.collab-modal-box label {
  font-size: 12px;
  color: #8898aa;
  margin-top: 4px;
}
.collab-modal-box input[type="text"] {
  background: #1a2a3a;
  border: 1px solid #2a3a4a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.collab-modal-box input[type="text"]:focus {
  outline: none;
  border-color: #4A8FFF;
}
.collab-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}
.collab-link-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #1a2a3a;
}
.collab-link-label {
  font-size: 11px;
  color: #8898aa;
}
#collab-link-output {
  background: #0a0f1a;
  border: 1px solid #4A8FFF;
  color: #4A8FFF;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  width: 100%;
  box-sizing: border-box;
}

/* ── Version mismatch warning ──────────────────────────────────────────── */
.collab-version-warning {
  background: #2a2000;
  border: 1px solid #f5a623;
  color: #f5a623;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  margin: 0 16px 6px;
}

/* ── When review or submit bar is visible, nudge the canvas area so the
 *    3D viewport isn't covered. The app has no single "canvas-area" id,
 *    but the body can get a class that adds bottom padding.           */
body.has-review-panel { padding-bottom: 240px !important; }
body.has-collab-submit { padding-bottom: 56px !important; }
