/* ============================================================
   CONTACTS.CSS
   Creator Relationship Hub — tabs, contact cards, star ratings,
   add-to-contacts button, and shared star rating widget used
   by both Contacts and Resources pages.
   ============================================================ */


/* ——————————————————————————————————————————————————————————
   TAB STRIP
   —————————————————————————————————————————————————————————— */
.con-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(231,207,207,0.3);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.con-tab {
  padding: 9px 18px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.con-tab:hover {
  color: var(--text-secondary);
  background: rgba(231,207,207,0.1);
}
.con-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--rose);
  background: rgba(231,207,207,0.12);
}


/* ——————————————————————————————————————————————————————————
   TOOLBAR
   —————————————————————————————————————————————————————————— */
.con-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.con-rating-filter {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.con-rating-btn {
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid rgba(231,207,207,0.45);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.con-rating-btn:hover {
  background: rgba(231,207,207,0.2);
  color: var(--text-primary);
}
.con-rating-btn.active {
  background: var(--blush);
  color: #8a4f4f;
  border-color: var(--blush);
}


/* ——————————————————————————————————————————————————————————
   CARD GRID
   —————————————————————————————————————————————————————————— */
.con-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}


/* ——————————————————————————————————————————————————————————
   CONTACT CARD
   —————————————————————————————————————————————————————————— */
.con-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.con-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.con-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

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

.con-card-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.con-card-person {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}


/* ——————————————————————————————————————————————————————————
   TYPE PILLS
   —————————————————————————————————————————————————————————— */
.con-type-pill {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 50px;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}
.con-type-brand    { background: rgba(237,216,204,0.55); color: #8a6040; }
.con-type-agency   { background: rgba(231,207,207,0.48); color: #8a4f4f; }
.con-type-platform { background: rgba(231,222,238,0.5);  color: #60508a; }
.con-type-person   { background: rgba(223,230,218,0.55); color: #4d6b48; }


/* ——————————————————————————————————————————————————————————
   LINKS ROW — email + website
   —————————————————————————————————————————————————————————— */
.con-links-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.con-web-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.con-web-link:hover { color: var(--rose); }


/* ——————————————————————————————————————————————————————————
   NOTES PREVIEW
   —————————————————————————————————————————————————————————— */
.con-notes-preview {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid rgba(231,207,207,0.22);
  padding-top: 8px;
  margin-top: -2px;
}


/* ——————————————————————————————————————————————————————————
   CARD FOOTER — status pill + actions
   —————————————————————————————————————————————————————————— */
.con-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  flex-wrap: wrap;
  gap: 6px;
}

.con-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* Inactive status pill (Active/Pending/Prospect/Paused already defined in resources.css) */
.pill-inactive {
  background: rgba(236,230,222,0.5);
  color: #9a8a78;
}


/* ——————————————————————————————————————————————————————————
   STAR RATING WIDGET
   Shared between Contacts cards, Resources cards, and modals.
   —————————————————————————————————————————————————————————— */
.star-rating {
  display: flex;
  gap: 2px;
  margin: 2px 0;
}

.star {
  font-size: 15px;
  color: rgba(190,168,168,0.35);
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s ease, transform 0.1s ease;
  user-select: none;
}
.star:hover {
  transform: scale(1.2);
}
.star.filled {
  color: #d4a853;
}
.star.hover {
  color: rgba(212,168,83,0.6);
}

/* Larger stars in modals */
.star-rating-modal {
  gap: 6px;
  margin: 4px 0;
}
.star-rating-modal .star {
  font-size: 22px;
}

/* Stars in Resources cards — slightly smaller */
.res-card-stars {
  gap: 2px;
  margin: 6px 0 2px;
}
.res-card-stars .star {
  font-size: 13px;
}


/* ——————————————————————————————————————————————————————————
   ADD-TO-CONTACTS BUTTON — appears on Resource cards
   —————————————————————————————————————————————————————————— */
.res-atc-btn {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid rgba(231,207,207,0.38);
  border-radius: 50px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.5;
  white-space: nowrap;
}
.res-atc-btn:hover {
  color: var(--rose);
  border-color: rgba(217,180,180,0.55);
  background: rgba(231,207,207,0.16);
}
.res-atc-btn.res-atc-done {
  color: #4d6b48;
  background: rgba(223,230,218,0.3);
  border-color: rgba(176,196,168,0.45);
  cursor: default;
  opacity: 0.85;
}
.res-atc-btn:disabled {
  cursor: default;
}


/* ——————————————————————————————————————————————————————————
   RESOURCE CARD FOOTER ROW — Edit + ATC alignment
   —————————————————————————————————————————————————————————— */
.res-card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.res-card-action-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}


/* ——————————————————————————————————————————————————————————
   ALPHA FILTER BAR
   —————————————————————————————————————————————————————————— */
.con-alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
}

.con-alpha-btn {
  padding: 4px 7px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  min-width: 26px;
  text-align: center;
  transition: all 0.12s ease;
}
.con-alpha-btn:hover {
  color: var(--text-primary);
  background: rgba(231,207,207,0.18);
}
.con-alpha-btn.active {
  color: var(--rose);
  background: rgba(231,207,207,0.22);
  border-color: rgba(217,180,180,0.35);
}


/* ——————————————————————————————————————————————————————————
   TABLE HEADER
   —————————————————————————————————————————————————————————— */
.con-table-header {
  display: grid;
  grid-template-columns: 96px 1fr 200px 114px 52px;
  gap: 0 12px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(231,207,207,0.35);
  margin-bottom: 4px;
}

.con-th {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease;
}
.con-th.con-th-actions { cursor: default; }
.con-th:hover { color: var(--text-secondary); }

.con-sort-arrow {
  font-size: 9px;
  color: transparent;
  line-height: 1;
}
.con-sort-arrow.con-sort-active {
  color: var(--rose);
}


/* ——————————————————————————————————————————————————————————
   LIST ROWS
   —————————————————————————————————————————————————————————— */
.con-list-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.con-list-row {
  display: grid;
  grid-template-columns: 96px 1fr 200px 114px 52px;
  gap: 0 12px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.con-list-row:hover {
  box-shadow: var(--shadow-card);
  background: #fff;
}

.con-row-type {
  display: flex;
  align-items: center;
}

.con-row-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.con-row-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(231,207,207,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.con-row-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.con-row-avatar-init {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text-muted);
}

.con-row-name-info {
  min-width: 0;
}

.con-row-company {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.con-row-person {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.con-row-email {
  min-width: 0;
}
.con-row-email .brand-email-link {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.con-row-empty {
  color: rgba(160,145,145,0.4);
  font-size: 12px;
}

.con-row-stars { margin: 0; gap: 1px; }
.con-row-stars .star { font-size: 12px; }

.con-row-actions {
  display: flex;
  justify-content: flex-end;
}


/* ——————————————————————————————————————————————————————————
   RESPONSIVE
   —————————————————————————————————————————————————————————— */
@media (max-width: 700px) {
  .con-card-grid {
    grid-template-columns: 1fr;
  }
  .con-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .con-rating-filter {
    justify-content: flex-start;
  }
  .con-table-header { display: none; }
  .con-list-row {
    grid-template-columns: 88px 1fr 44px;
    grid-template-rows: auto auto;
  }
  .con-row-email,
  .con-row-rating { display: none; }
}
