/* ── Component: ContactsPage full-page overlay ──
 * Class prefix: contacts-
 */

/* ── ContactsPage — full-page overlay ── */
.contacts-page {
  position: fixed;
  top: var(--topbar-h, 0);
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: var(--bg-primary, #080B14);
  display: flex;
  flex-direction: column;
  animation: contactsFadeIn 0.25s ease-out;
}
@keyframes contactsFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.contacts-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.contacts-back-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.contacts-back-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.contacts-header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}
.contacts-header-actions {
  display: flex;
  gap: 8px;
}
.contacts-import-btn,
.contacts-add-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.contacts-import-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}
.contacts-import-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.contacts-add-btn {
  background: var(--accent-primary, #7C6FF7);
  color: #fff;
}
.contacts-add-btn:hover {
  background: var(--accent-hover, #6B5CE7);
  transform: translateY(-1px);
}

/* ── Body ── */
.contacts-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 20px 24px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ── Search ── */
.contacts-search {
  margin-bottom: 16px;
}
.contacts-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.contacts-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.contacts-search-input:focus {
  border-color: var(--accent-primary, #7C6FF7);
}

/* ── List ── */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Card ── */
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}
.contact-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
.contact-card--selected {
  background: rgba(124, 111, 247, 0.1);
  border-color: rgba(124, 111, 247, 0.25);
}
.contact-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #7C6FF7;
  cursor: pointer;
}

/* ── Selection bar ── */
.contacts-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: rgba(124, 111, 247, 0.12);
  border-bottom: 1px solid rgba(124, 111, 247, 0.2);
}
.contacts-sel-info {
  font-size: 13px;
  font-weight: 500;
  color: #a78bfa;
}
.contacts-sel-actions {
  display: flex;
  gap: 8px;
}
.contacts-sel-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s;
}
.contacts-sel-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.contacts-sel-btn--delete {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.contacts-sel-btn--delete:hover {
  background: rgba(239, 68, 68, 0.25);
}
.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.contact-info {
  flex: 1;
  min-width: 0;
}
.contact-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-detail {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.contact-company-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 400;
}
.contact-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.contact-card:hover .contact-actions {
  opacity: 1;
}
.contact-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.contact-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.contact-action-btn--delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Empty state ── */
.contacts-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.4);
}
.contacts-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.contacts-empty h3 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin: 0 0 8px;
}
.contacts-empty p {
  font-size: 13px;
  margin: 0;
}

/* ── Inline form ── */
.contact-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  animation: contactFormSlide 0.2s ease-out;
}
@keyframes contactFormSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.contact-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-form-field--full {
  grid-column: 1 / -1;
}
.contact-form-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.contact-form-input {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.contact-form-input:focus {
  border-color: var(--accent-primary, #7C6FF7);
}
.contact-form-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.contact-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.contact-form-cancel {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.contact-form-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}
.contact-form-save {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent-primary, #7C6FF7);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.contact-form-save:hover {
  background: var(--accent-hover, #6B5CE7);
}

/* ── Toast ── */
.contacts-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 500;
  animation: contactsToastIn 0.2s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@keyframes contactsToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Mention contact items ── */
.mention-section-label {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mention-avatar--contact {
  background: #3B82F6 !important;
  font-size: 13px;
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .contacts-header {
    padding: 12px 16px;
  }
  .contacts-body {
    padding: 16px;
  }
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
  .contact-actions {
    opacity: 1;
  }
}
