/* © 2026 Wannlabs. Realtime Collaboration Design System (Standalone CSS) */

/* 1. Header Presence & Controls */
.wl-collab-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-family: inherit;
  font-size: 12.5px;
}

.wl-collab-avatars {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
}

.wl-collab-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #140d0a;
  margin-left: -7px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), z-index 0.18s;
  cursor: default;
  user-select: none;
  background-color: #f97316;
}

.wl-collab-avatar:first-child {
  margin-left: 0;
}

.wl-collab-avatar:hover {
  transform: scale(1.15);
  z-index: 10;
}

.wl-collab-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.wl-collab-avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #140d0a;
  background: #10b981;
}

.wl-collab-avatar-dot.connecting {
  background: #f59e0b;
  animation: wl-pulse 1.8s infinite;
}

.wl-collab-avatar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #231915;
  border: 2px solid #140d0a;
  color: #d1c7bd;
  font-size: 10px;
  font-weight: 700;
  margin-left: -7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 2. Unified Pill Buttons */
.wl-collab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #f3e9df;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  box-sizing: border-box;
}

.wl-collab-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.wl-collab-pill:active {
  transform: translateY(0);
}

.wl-collab-pill:focus-visible {
  outline: 2px solid #ff9a4c;
  outline-offset: 2px;
}

.wl-collab-pill.active {
  background: rgba(255, 154, 76, 0.16);
  border-color: rgba(255, 154, 76, 0.45);
  color: #ff9a4c;
  box-shadow: 0 0 14px rgba(255, 154, 76, 0.2);
}

.wl-collab-pill .wl-ico {
  width: 14px;
  height: 14px;
  flex: none;
  color: #ff9a4c;
}

.wl-collab-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff7a3d;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 2px;
}

/* 3. Collab Side Drawer (Obsidian Glassmorphism) */
.wl-collab-drawer {
  position: fixed !important;
  top: 52px;
  right: 14px;
  bottom: 14px;
  width: 380px;
  max-width: calc(100vw - 28px);
  background: rgba(20, 14, 11, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  color: #f3e9df;
  font-family: inherit;
  animation: wl-drawer-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes wl-drawer-in {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Header */
.wl-collab-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  flex: none;
}

.wl-collab-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-collab-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.wl-collab-pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.wl-collab-pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: wl-pulse 2s infinite;
}

.wl-collab-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wl-collab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d1c7bd;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.wl-collab-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.wl-collab-icon-btn:active {
  transform: translateY(0);
}

.wl-collab-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Tabs */
.wl-collab-tabs {
  display: flex;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
  flex: none;
}

.wl-collab-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #a8998c;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wl-collab-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.wl-collab-tab.active {
  color: #ffffff;
  background: rgba(255, 154, 76, 0.14);
  border-color: rgba(255, 154, 76, 0.35);
  font-weight: 600;
}

.wl-collab-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff7a3d;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

/* Chat Feed */
.wl-collab-feed {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wl-collab-feed::-webkit-scrollbar {
  width: 5px;
}
.wl-collab-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.wl-collab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 24px;
  color: #8f7e72;
}

.wl-collab-empty-icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  color: #a8998c;
  opacity: 0.6;
  margin-bottom: 8px;
}

.wl-collab-empty h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #f3e9df;
}

.wl-collab-empty p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: #a8998c;
  line-height: 1.4;
}

/* Chat Message Bubbles */
.wl-collab-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.wl-collab-msg-row.me {
  align-self: flex-end;
  align-items: flex-end;
}

.wl-collab-msg-row.peer {
  align-self: flex-start;
  align-items: flex-start;
}

.wl-collab-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
  padding: 0 4px;
}

.wl-collab-msg-author {
  font-size: 11px;
  font-weight: 600;
}

.wl-collab-msg-time {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.35);
}

.wl-collab-bubble {
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}

.wl-collab-msg-row.me .wl-collab-bubble {
  background: linear-gradient(135deg, rgba(255, 154, 76, 0.25) 0%, rgba(255, 122, 61, 0.32) 100%);
  border: 1px solid rgba(255, 154, 76, 0.4);
  color: #ffffff;
  border-radius: 14px 14px 3px 14px;
}

.wl-collab-msg-row.peer .wl-collab-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #f3e9df;
  border-radius: 14px 14px 14px 3px;
}

.wl-collab-ref-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  background: rgba(255, 154, 76, 0.15);
  border: 1px solid rgba(255, 154, 76, 0.3);
  color: #ff9a4c;
}

/* Chat Input Bar */
.wl-collab-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  flex: none;
}

.wl-collab-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.wl-collab-input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.wl-collab-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ff9a4c;
  box-shadow: 0 0 12px rgba(255, 154, 76, 0.25);
}

.wl-collab-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.wl-collab-send-btn {
  position: absolute;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9a4c 0%, #ff7a3d 100%);
  border: none;
  color: #160904;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  outline: none;
}

.wl-collab-send-btn:hover {
  transform: translateY(-1px);
}

.wl-collab-send-btn:active {
  transform: translateY(0);
}

.wl-collab-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* 4. Track Changes Tab */
.wl-collab-history-feed {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wl-collab-history-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wl-collab-history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.wl-collab-history-item.undone {
  opacity: 0.5;
  text-decoration: line-through;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}

.wl-collab-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wl-collab-history-author-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wl-collab-history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.wl-collab-history-author {
  font-weight: 600;
  color: #ffffff;
}

.wl-collab-history-action {
  font-size: 10px;
  font-family: monospace;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #a8998c;
}

.wl-collab-history-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.wl-collab-history-desc {
  color: #d1c7bd;
  line-height: 1.4;
  margin: 0;
}

.wl-collab-revert-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3e9df;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 3px;
}

.wl-collab-revert-btn:hover {
  background: rgba(255, 154, 76, 0.2);
  border-color: #ff9a4c;
  color: #ffffff;
}

/* 5. Share Modal Overlay */
.wl-collab-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
  animation: wl-fade 0.18s ease;
  box-sizing: border-box;
}

.wl-collab-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 18px;
  background: #18120e;
  color: #f5efe9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  padding: 24px;
  box-sizing: border-box;
  font-family: inherit;
  animation: wl-modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wl-modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wl-collab-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wl-collab-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.wl-collab-modal-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #a8998c;
}

.wl-collab-modal-section {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wl-collab-modal-label {
  font-size: 12px;
  font-weight: 500;
  color: #d1c7bd;
}

.wl-collab-modal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-collab-modal-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.wl-collab-modal-input:focus {
  border-color: #ff9a4c;
}

.wl-collab-modal-hint {
  font-size: 11px;
  color: #8f7e72;
  margin: 2px 0 0;
}

@keyframes wl-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes wl-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
