/* Integrations Styles */

/* ─── Integration Status ────────────────────────────────────── */

.integration-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.integration-status.connected {
  border-color: var(--success);
  background: rgba(63, 185, 80, 0.05);
}

.integration-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.integration-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.integration-icon svg {
  width: 24px;
  height: 24px;
}

.github-icon {
  color: var(--text-primary);
}

.integration-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.integration-name {
  font-weight: 600;
  font-size: 14px;
}

.integration-account {
  font-size: 13px;
  color: var(--text-secondary);
}

.integration-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Repos List ────────────────────────────────────────────── */

.repos-list {
  max-height: 400px;
  overflow-y: auto;
}

.repo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.repo-item:hover {
  background: var(--bg-tertiary);
}

.repo-item:last-child {
  border-bottom: none;
}

.repo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.repo-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--accent);
}

.repo-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.private-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 166, 87, 0.15);
  color: #ffa657;
  border-radius: 4px;
  text-transform: uppercase;
}

.repo-language {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── Search Box ────────────────────────────────────────────── */

.search-box {
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Design Picker ─────────────────────────────────────────── */

.design-picker {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pages-list {
  max-height: 350px;
  overflow-y: auto;
}

.design-page {
  margin-bottom: 16px;
}

.design-page h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-secondary);
}

.page-frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.design-node {
  padding: 12px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.design-node:hover {
  border-color: var(--border);
}

.design-node.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.node-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-type {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.framework-select,
.css-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.framework-select label,
.css-select label {
  font-size: 13px;
  color: var(--text-secondary);
}

.framework-select select,
.css-select select {
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
}

.selection-actions .btn {
  margin-left: auto;
}

/* ─── Modal Description ─────────────────────────────────────── */

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

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Collaboration Presence ────────────────────────────────── */

.presence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.presence-avatars {
  display: flex;
  align-items: center;
}

.presence-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  margin-left: -8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

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

.presence-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* ─── Live Cursors ──────────────────────────────────────────── */

.remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.1s ease-out;
}

.cursor-pointer {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--cursor-color, #58a6ff);
  transform: rotate(-45deg);
}

.cursor-label {
  position: absolute;
  top: 12px;
  left: 8px;
  padding: 2px 6px;
  background: var(--cursor-color, #58a6ff);
  color: white;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ─── Collab Chat ───────────────────────────────────────────── */

.collab-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.collab-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.collab-chat-header h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.collab-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  max-height: 250px;
}

.collab-message {
  margin-bottom: 12px;
}

.collab-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.collab-message-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.collab-message-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.collab-message-text {
  font-size: 13px;
  line-height: 1.4;
}

.collab-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.collab-chat-input input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.collab-chat-input button {
  padding: 8px 12px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}
