/* ==========================================================================
   Candidate Discovery - Train & Hire
   Employer candidate search and invitation views.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Job Selector
   -------------------------------------------------------------------------- */

.co-cd-job-selector {
  margin-bottom: 1.5rem;
}

.co-cd-job-selector-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 10px;
  animation: fadeSlideIn 0.25s ease-out;
}

.co-cd-job-selector-field {
  flex: 1;
}

.co-cd-job-selector-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-secondary);
  margin-bottom: 0.35rem;
}

.co-cd-job-selector-field select {
  width: 100%;
  font-family: var(--th-font);
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--th-border);
  padding: 0.55rem 0.85rem;
  background: var(--th-bg-subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.co-cd-job-selector-field select:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
  outline: none;
}

.co-cd-job-selector-help {
  font-size: 0.75rem;
  color: var(--th-text-muted);
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Search Layout (Filters + Results)
   -------------------------------------------------------------------------- */

.co-cd-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .co-cd-layout {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Filter Sidebar
   -------------------------------------------------------------------------- */

.co-cd-filters {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 10px;
  padding: 1.15rem;
  position: sticky;
  top: 1.5rem;
  animation: fadeSlideIn 0.25s ease-out;
}

.co-cd-filter-group {
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--th-border-light);
}

.co-cd-filter-group:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.co-cd-filter-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-secondary);
  margin-bottom: 0.4rem;
}

.co-cd-filter-select,
.co-cd-filter-input {
  width: 100%;
  font-family: var(--th-font);
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1.5px solid var(--th-border);
  padding: 0.4rem 0.65rem;
  background: var(--th-bg-subtle);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.co-cd-filter-select:focus,
.co-cd-filter-input:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
  outline: none;
}

.co-cd-filter-select[multiple] {
  min-height: 80px;
  padding: 0.25rem;
}

.co-cd-filter-select[multiple] option {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.co-cd-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.co-cd-filter-submit {
  font-family: var(--th-font);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  background: var(--th-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.co-cd-filter-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
}

.co-cd-filter-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.co-cd-filter-clear {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--th-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.co-cd-filter-clear:hover {
  color: var(--th-text-secondary);
}

/* --------------------------------------------------------------------------
   Results Header (count + sort)
   -------------------------------------------------------------------------- */

.co-cd-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.co-cd-results-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  letter-spacing: -0.01em;
}

.co-cd-sort-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.co-cd-sort-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--th-text-muted);
  white-space: nowrap;
}

.co-cd-sort-select {
  font-family: var(--th-font);
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1.5px solid var(--th-border);
  padding: 0.3rem 0.6rem;
  background: var(--th-bg-card);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.co-cd-sort-select:focus {
  border-color: var(--th-accent);
  outline: none;
}

/* --------------------------------------------------------------------------
   Candidate Card Grid
   -------------------------------------------------------------------------- */

.co-cd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

@media (max-width: 575.98px) {
  .co-cd-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Candidate Card
   -------------------------------------------------------------------------- */

.co-cd-card {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 10px;
  padding: 1.15rem;
  transition: all 0.18s ease;
  animation: fadeSlideIn 0.25s ease-out;
  position: relative;
  display: flex;
  flex-direction: column;
}

.co-cd-card:hover {
  border-color: var(--th-accent);
  box-shadow: var(--th-shadow-hover);
  transform: translateY(-2px);
}

/* Match score ring */
.co-cd-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.co-cd-candidate-info {
  flex: 1;
  min-width: 0;
}

.co-cd-candidate-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--th-text);
  letter-spacing: -0.015em;
  margin-bottom: 0.15rem;
  text-decoration: none;
  display: block;
}

.co-cd-candidate-name:hover {
  color: var(--th-accent);
}

.co-cd-candidate-headline {
  font-size: 0.78rem;
  color: var(--th-text-secondary);
  margin-bottom: 0.3rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.co-cd-candidate-location {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--th-text-muted);
  font-weight: 500;
}

.co-cd-candidate-location svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Match score ring */
.co-cd-match-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-cd-match-ring svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.co-cd-match-ring-bg {
  fill: none;
  stroke: var(--th-border-light);
  stroke-width: 4;
}

.co-cd-match-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.co-cd-match-ring-fill[data-tier="excellent"] { stroke: #059669; }
.co-cd-match-ring-fill[data-tier="strong"] { stroke: #2563eb; }
.co-cd-match-ring-fill[data-tier="moderate"] { stroke: #d97706; }
.co-cd-match-ring-fill[data-tier="developing"] { stroke: #9ca3af; }

.co-cd-match-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.co-cd-match-label[data-tier="excellent"] { color: #059669; }
.co-cd-match-label[data-tier="strong"] { color: #2563eb; }
.co-cd-match-label[data-tier="moderate"] { color: #d97706; }
.co-cd-match-label[data-tier="developing"] { color: #9ca3af; }

.co-cd-match-tier {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 0.15rem;
}

.co-cd-match-tier[data-tier="excellent"] { color: #059669; }
.co-cd-match-tier[data-tier="strong"] { color: #2563eb; }
.co-cd-match-tier[data-tier="moderate"] { color: #d97706; }
.co-cd-match-tier[data-tier="developing"] { color: #9ca3af; }

/* Skills and Credentials sections */
.co-cd-card-section {
  margin-bottom: 0.75rem;
}

.co-cd-card-section:last-of-type {
  margin-bottom: 0;
}

.co-cd-card-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-muted);
  margin-bottom: 0.35rem;
}

.co-cd-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.co-cd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.co-cd-badge svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.co-cd-badge-matched {
  background: #d1fae5;
  color: #065f46;
}

.co-cd-badge-partial {
  background: #fef3c7;
  color: #92400e;
}

.co-cd-badge-missing {
  background: #fee2e2;
  color: #991b1b;
}

.co-cd-badge-credential-matched {
  background: #dbeafe;
  color: #1e40af;
}

.co-cd-badge-credential-missing {
  background: #f1f5f9;
  color: #475569;
}

.co-cd-badge-verified {
  position: relative;
}

.co-cd-badge-verified::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #059669;
  margin-left: 0.15rem;
}

/* Card footer */
.co-cd-card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--th-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.co-cd-card-stats {
  font-size: 0.68rem;
  color: var(--th-text-muted);
  font-weight: 500;
  line-height: 1.5;
}

.co-cd-invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--th-font);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: var(--th-accent);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.co-cd-invite-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
}

.co-cd-invite-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.co-cd-invite-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.co-cd-invited-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  padding: 0.35rem 0.75rem;
  background: #d1fae5;
  border-radius: 6px;
  white-space: nowrap;
}

.co-cd-invited-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.co-cd-applied-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e40af;
  padding: 0.35rem 0.75rem;
  background: #dbeafe;
  border-radius: 6px;
  white-space: nowrap;
}

.co-cd-applied-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.co-cd-view-profile {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--th-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.co-cd-view-profile:hover {
  color: var(--th-accent-hover);
}

/* --------------------------------------------------------------------------
   Invite Modal
   -------------------------------------------------------------------------- */

.co-cd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}

.co-cd-modal {
  background: var(--th-bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: fadeSlideIn 0.25s ease-out;
}

.co-cd-modal-header {
  padding: 1.25rem 1.5rem 0;
}

.co-cd-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.co-cd-modal-subtitle {
  font-size: 0.82rem;
  color: var(--th-text-secondary);
  line-height: 1.45;
}

.co-cd-modal-body {
  padding: 1.25rem 1.5rem;
}

.co-cd-modal-body label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-text-secondary);
  margin-bottom: 0.35rem;
}

.co-cd-modal-body textarea {
  width: 100%;
  font-family: var(--th-font);
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--th-border);
  padding: 0.65rem 0.85rem;
  background: var(--th-bg-subtle);
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.co-cd-modal-body textarea:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
  background: #fff;
  outline: none;
}

.co-cd-modal-help {
  font-size: 0.72rem;
  color: var(--th-text-muted);
  margin-top: 0.35rem;
}

.co-cd-modal-char-count {
  font-size: 0.68rem;
  color: var(--th-text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.co-cd-modal-footer {
  padding: 0 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.co-cd-modal-cancel {
  font-family: var(--th-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--th-text-secondary);
  background: none;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.co-cd-modal-cancel:hover {
  background: var(--th-bg-subtle);
  color: var(--th-text);
}

.co-cd-modal-send {
  font-family: var(--th-font);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--th-accent);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.co-cd-modal-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
}

.co-cd-modal-send:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */

.co-cd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  animation: fadeSlideIn 0.25s ease-out;
}

.co-cd-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.co-cd-empty-icon svg {
  width: 26px;
  height: 26px;
  stroke: #adb5bd;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.co-cd-empty h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--th-text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.co-cd-empty p {
  font-size: 0.85rem;
  color: var(--th-text-secondary);
  max-width: 340px;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Invitation Status Badges and Markers (Dashboard)
   -------------------------------------------------------------------------- */

.dash-application-status-pending {
  background: #fef3c7;
  color: #92400e;
}

.dash-application-status-accepted {
  background: #d1fae5;
  color: #065f46;
}

.dash-application-status-declined {
  background: #f1f5f9;
  color: #475569;
}

.dash-application-marker-pending { background: #d97706; }
.dash-application-marker-accepted { background: #059669; }
.dash-application-marker-declined { background: #6b7280; }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 575.98px) {
  .co-cd-job-selector-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .co-cd-card-top {
    flex-direction: column;
  }

  .co-cd-match-ring {
    align-self: flex-end;
  }

  .co-cd-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .co-cd-invite-btn {
    justify-content: center;
  }

  .co-cd-modal {
    margin: 0.5rem;
  }
}
