/* ============================================
   SHARE MODE STYLES
   Applied when body has .share-mode class
   ============================================ */

/* --- Share Header (single-row, fits 44px .chat-header) --- */
.share-mode .chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

.share-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.share-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.share-header-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.share-model-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-hover);
  white-space: nowrap;
}

.share-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.share-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border-main);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.share-btn-secondary:hover {
  background: var(--color-bg-hover);
}

.share-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.share-btn-primary:hover {
  background: var(--color-primary-hover);
}

/* --- Share Error Page --- */
.share-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.share-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.share-error h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-heading);
  margin: 0 0 8px;
}

.share-error p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 24px;
}

.share-error-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background: var(--color-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.share-error-link:hover {
  background: var(--color-primary-hover);
}

/* --- Share Invite Explanation --- */
.share-invite-explanation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.share-invite-explanation h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-heading);
  margin: 16px 0 8px;
}

.share-invite-explanation p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 24px;
  max-width: 400px;
}

.share-join-btn-center {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--color-primary);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.share-join-btn-center:hover {
  background: var(--color-primary-hover);
}

/* --- Share Mode Overrides --- */

/* Show action buttons on messages in share mode (clicking them triggers promo modal) */
.share-mode .message-actions,
.share-mode .user-message-actions {
  /* visible — clicks intercepted by JS → promo modal */
}

/* Hide header hide button in share mode */
.share-mode .header-hide-btn {
  display: none !important;
}

/* Hide onboarding suggestion buttons in share mode */
.share-mode .onboarding-buttons-container,
.share-mode .onboarding-hint {
  display: none !important;
}

/* Hide cost and latency in share mode */
.share-mode .response-time,
.share-mode .response-cost {
  display: none !important;
}

/* Hide suggestion chips / prompt suggestions in share mode */
.share-mode .suggestion-chips,
.share-mode .prompt-suggestions,
.share-mode .suggestions-container {
  display: none !important;
}

/* Gray out model options in share mode */
.share-model-disabled {
  opacity: 0.45;
  pointer-events: auto;
  cursor: pointer;
}

.share-model-disabled input[type="checkbox"] {
  pointer-events: none;
}

.share-social-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.share-social-svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* WhatsApp icon has more padding inside SVG, needs slight upscale */
.share-modal-social-btn[data-url*="wa.me"] .share-social-svg {
  width: 30px;
  height: 30px;
}

/* --- Share Promo Modal --- */
.share-promo-overlay {
  z-index: 1100;
}

.share-promo-modal {
  max-width: 420px;
  position: relative;
  padding: 0;
}

.share-promo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  z-index: 1;
}

.share-promo-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.share-promo-body {
  padding: 40px 32px 32px;
  text-align: center;
}

.share-promo-icon {
  font-size: 32px;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.share-promo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-heading);
  margin: 0 0 8px;
  line-height: 1.3;
}

.share-promo-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

.share-promo-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.share-promo-feature {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.share-promo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-promo-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.share-promo-btn-primary:hover {
  background: var(--color-primary-hover);
}

.share-promo-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border-main);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.share-promo-btn-secondary:hover {
  background: var(--color-bg-hover);
}

.share-promo-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 14px 0 0;
}

/* --- Responsive --- */
/* --- Auth page promo block (for users coming from share page) --- */
.auth-share-bullets {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 16px 0 12px;
}

.auth-share-icon {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-share-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 6px;
  text-align: center;
}

.auth-share-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  text-align: center;
  line-height: 1.5;
}

.auth-share-bullet {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.6;
}

.auth-share-nocredit {
  font-size: 12px;
  color: var(--color-text-tertiary, #999);
  margin-top: 6px;
  margin-bottom: 0;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .share-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   SHARE MODAL (Phase 2A)
   Uses .delete-modal-overlay + .delete-modal base
   ============================================ */

.share-modal {
  max-width: 480px;
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.share-modal-header .delete-modal-title {
  margin: 0;
}

.share-modal-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.share-modal-link {
  font-size: 13px;
  color: var(--color-text-primary);
  background: var(--color-bg-sidebar);
  padding: 10px 14px;
  border-radius: 6px;
  word-break: break-all;
  font-family: var(--font-mono, monospace);
  margin-bottom: 6px;
}

.share-modal-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.share-modal-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 16px;
}

.share-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.share-modal-divider {
  border-top: 1px solid var(--color-border-main);
  margin: 20px 0 16px;
}

.share-modal-social-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.share-modal-social-row {
  display: flex;
  gap: 8px;
}

.share-modal-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--color-border-main);
  background: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.share-modal-social-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-secondary);
}

/* --- Sidebar share icon --- */
.sidebar-share-icon {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: -1px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ============================================
   COLLABORATE / PARTICIPANTS STYLES
   ============================================ */

/* --- Participants section in share modal --- */
.share-participants-section {
  margin-bottom: 4px;
}

.share-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.share-section-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.share-participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.share-participant-name {
  font-size: 13px;
  color: var(--color-text-primary);
}

.share-participant-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

.share-participant-kick {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.share-participant-kick:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.share-modal-invite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  cursor: pointer;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  transition: all 0.15s ease;
  height: 36px;
  box-sizing: border-box;
}

.share-modal-invite-btn:hover {
  opacity: 0.9;
}

/* --- Sidebar collaborative chat subtitle --- */
.conversation-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Collaborate badge in chat header --- */
.collab-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(102, 126, 234, 0.1);
  white-space: nowrap;
  vertical-align: middle;
}

.collab-header-badge:hover {
  background: rgba(102, 126, 234, 0.2);
}

.sidebar-collab-icon {
  color: var(--color-primary);
}

/* Collaborate polling — typing indicator */
.collaborate-typing-indicator {
  padding: 8px 16px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
  animation: collaborateTypingPulse 1.5s ease-in-out infinite;
}

@keyframes collaborateTypingPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Collab progress placeholder — shown while partner generates */
.collab-progress-placeholder {
  opacity: 0.7;
}

.collab-progress-placeholder .message-content {
  padding: 12px 0;
}

.collab-progress-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9ca3af;
  font-size: 14px;
  font-style: italic;
}

.collab-progress-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: collabSpin 0.8s linear infinite;
}

@keyframes collabSpin {
  to { transform: rotate(360deg); }
}

/* Send button locked while other participant generates */
.collaborate-locked {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.collaborate-connection-lost {
  padding: 12px 16px;
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
  margin: 8px 16px;
}
