/* Modern CRM Contacts Styling */
.contacts-wrapper {
  min-height: 100vh;
  background: var(--bg-primary);
  font-family: 'Inter', sans-serif;
}

.contacts-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.8) !important;
}

.contacts-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* Smart Tags */
.filter-tag {
  transition: all 0.2s ease;
  border: 1px solid transparent !important;
  opacity: 0.8;
}

.filter-tag:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.filter-tag.active {
  opacity: 1 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 700 !important;
}

/* Contact Cards */
.contact-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.contact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 104, 255, 0.05);
  transform: translateY(-2px);
}

.contact-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-secondary);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-anchor: middle;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.card-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.type-user { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.type-group { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-secondary);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.contact-tag-pill {
  font-size: 11px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.card-notes {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.btn-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s;
}

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

.btn-card-primary {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-card-primary:hover {
  background: #0056D2;
}

/* Spinner adjustment */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 104, 255, 0.1);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* New List-based Contact Design */
.contact-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.contact-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.05);
  transform: translateY(-1px);
}

.contact-list-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.contact-list-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  flex-grow: 1;
  min-width: 0;
}

.contact-list-row-1 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-list-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-list-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.contact-list-row-2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-list-notes {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.contact-list-tags {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

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

.contact-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.contact-btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.contact-btn-icon.btn-chat-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.contact-btn-icon.btn-chat-primary:hover {
  background: #3b82f6;
  color: #fff;
}
