/* ==========================================================================
   PROFESSOR HORIZONTAL CARDS DESIGN SYSTEM
   Modern, scannable horizontal block layout with expandable details
   ========================================================================== */

/* Container for full-width horizontal blocks */
.professors-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
}

/* Individual Horizontal Professor Card Block */
.prof-horizontal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  width: 100%;
}

.prof-horizontal-card:hover {
  border-color: #bbbbbb;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.prof-horizontal-card.is-expanded {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Header / Summary Row (Always Visible)
   -------------------------------------------------------------------------- */
.prof-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  user-select: none;
  gap: 1.25rem;
  background: transparent;
  transition: background-color 0.2s ease;
}

.prof-summary-row:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.theme-dark .prof-summary-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Left Grouping: Avatar + Main Metadata */
.prof-summary-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0; /* Enables flex item truncation if needed */
}

/* Large Initial Avatar */
.prof-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Main Text Details */
.prof-core-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.prof-title-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.prof-name-large {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.badge-position {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: #f0f0f0;
  color: var(--primary);
  border: 1px solid #e0e0e0;
}

.badge-contact-verified {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: #f0f0f0;
  color: #333333;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.prof-meta-line {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.prof-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.prof-meta-item strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Research Areas Preview Tags in Summary */
.prof-tags-preview {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.prof-preview-tag {
  background: rgba(100, 116, 139, 0.08);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(100, 116, 139, 0.15);
}

.prof-preview-tag-more {
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0.15rem 0.4rem;
}

/* --------------------------------------------------------------------------
   Right Grouping: Action Icons + Chevron Expand Button
   -------------------------------------------------------------------------- */
.prof-summary-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.prof-quick-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quick-link-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid var(--border-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.quick-link-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Expand Arrow & Trigger Button */
.prof-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.prof-expand-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary);
}

.expand-chevron {
  font-size: 0.75rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.is-expanded .expand-chevron {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Expandable Details Pane
   -------------------------------------------------------------------------- */
.prof-details-pane {
  display: none;
  padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: rgba(248, 250, 252, 0.6);
  animation: detailsFadeDown 0.25s ease;
}

.theme-dark .prof-details-pane {
  background: rgba(15, 23, 42, 0.4);
}

.is-expanded .prof-details-pane {
  display: block;
}

@keyframes detailsFadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Details Section Grid */
.prof-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.details-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.details-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.details-section-title i {
  color: var(--primary);
  font-size: 0.9rem;
}

/* Description Text */
.prof-description-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Rich Research Tags */
.prof-full-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.prof-interest-badge {
  background: #f0f0f0;
  color: #444444;
  border: 1px solid #e0e0e0;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

.prof-keyword-badge {
  background: #f5f5f5;
  color: #555555;
  border: 1px solid #e0e0e0;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Available Profile Links Bar */
.prof-links-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.prof-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.prof-link-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.prof-link-chip i {
  font-size: 0.95rem;
}

/* Education / Extra Details Line */
.education-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}

/* Bottom Action Bar in Details */
.prof-details-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   Responsive Tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 868px) {
  .prof-summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .prof-summary-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   RESEARCH INTERESTS MULTI-SELECT DROPDOWN
   ========================================================================== */
.interest-multiselect-wrap {
  position: relative;
  width: 100%;
}

.interest-multiselect-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.interest-multiselect-btn:hover {
  border-color: var(--primary);
}

.interest-chevron {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.interest-multiselect-wrap.open .interest-chevron {
  transform: rotate(180deg);
}

.interest-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.interest-search-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.interest-search-header i {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.interest-search-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.interest-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.85rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.btn-text-action:hover {
  text-decoration: underline;
}

.interest-count-pill {
  font-size: 0.74rem;
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.interest-options-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.4rem;
}

.interest-option-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-primary);
  user-select: none;
  transition: background 0.15s ease;
}

.interest-option-label:hover {
  background: var(--bg-primary);
}

.interest-option-label input[type="checkbox"] {
  accent-color: #0a0a0a;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.selected-interests-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.selected-interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #0a0a0a;
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 500;
}

.selected-interest-chip .chip-remove-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  opacity: 0.75;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.15rem;
  line-height: 1;
}

.selected-interest-chip .chip-remove-btn:hover {
  opacity: 1;
}

/* ==========================================================================
   CARD ACTION: MANUAL MAIL (ADD TO DRAFT)
   ========================================================================== */
.btn-card-manual-mail.in-draft {
  background: var(--text-primary) !important;
  color: var(--bg-surface) !important;
  border-color: var(--text-primary) !important;
  pointer-events: none;
  cursor: default;
}

/* ==========================================================================
   CARD ACTION: AUTO MAIL DROPDOWN
   ========================================================================== */
.card-automail-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.card-automail-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 230px;
  max-width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 1050;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.automail-menu-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.automail-menu-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.3rem 0;
}

.automail-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.84rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.automail-menu-item:hover {
  background: var(--bg-primary);
}

.automail-menu-item.is-member {
  font-weight: 600;
  color: #059669;
}

.automail-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.automail-item-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.automail-menu-create-wrap {
  padding: 0.4rem 0.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.automail-menu-create-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: none;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  justify-content: center;
  transition: all 0.15s ease;
}

.automail-menu-create-btn:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
}

.automail-inline-create-form {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem 0;
}

.inline-list-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
}

.inline-list-input:focus {
  border-color: var(--primary);
}

.inline-create-submit-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.btn-card-auto-mail.in-list {
  border-color: #059669 !important;
  color: #059669 !important;
  background: rgba(5, 150, 105, 0.08) !important;
}

/* ==========================================================================
   FIND PROFS FILTERS (components/findProfsFilters.js)
   ========================================================================== */
.fp-ms-btn .fp-ms-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  color: var(--text-secondary);
}

.fp-ms-btn.has-value .fp-ms-label {
  color: var(--text-primary);
  font-weight: 600;
}

.fp-ms-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fp-ms-btn:disabled:hover {
  border-color: var(--border-color);
}

.fp-ms-panel {
  min-width: min(300px, calc(100vw - 2rem));
}

.fp-ms-list {
  max-height: 300px;
}

.fp-ms-option .fp-ms-option-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.fp-ms-option-count {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.fp-ms-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.fp-ms-group + .fp-ms-group {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-color);
}

.fp-ms-group-head {
  font-weight: 700;
}

.fp-ms-group .fp-ms-option {
  padding-left: 1.85rem;
}

.fp-ms-empty {
  padding: 0.85rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* ==========================================================================
   CARD: RECENT PUBLICATIONS
   ========================================================================== */
.prof-pub-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.prof-pub-item {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.prof-pub-title {
  font-weight: 600;
  color: var(--text-primary);
}

a.prof-pub-title:hover {
  color: var(--primary);
  text-decoration: underline;
}

.prof-pub-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* "Report a problem" at the bottom of each professor card */
.prof-card-foot { display: flex; justify-content: flex-end; padding: 0 1rem 0.45rem; }
.prof-report-btn { background: none; border: 0; padding: 0.15rem 0.25rem; font: inherit; font-size: 0.74rem; color: var(--text-muted, #9ca3af); cursor: pointer; border-radius: 4px; }
.prof-report-btn:hover, .prof-report-btn:focus-visible { color: var(--text-secondary); text-decoration: underline; }
.prof-report-btn i { margin-right: 0.2rem; }

.prof-report-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.prof-report-backdrop[hidden] { display: none; }
.prof-report-box { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md, 12px); width: 100%; max-width: 420px; padding: 1.1rem 1.2rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.prof-report-box h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.prof-report-sub { margin: 0 0 0.8rem; font-size: 0.84rem; color: var(--text-secondary); }
.prof-report-reasons { border: 0; margin: 0 0 0.8rem; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.prof-report-reasons legend { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; padding: 0; }
.prof-report-reasons label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.88rem; cursor: pointer; }
.prof-report-reasons input { accent-color: var(--primary); }
.prof-report-details-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.prof-report-details-label span { font-weight: 400; color: var(--text-secondary); }
.prof-report-error { color: var(--danger, #dc2626); font-size: 0.84rem; margin: 0.5rem 0 0; }
.prof-report-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.85rem; }
