/* Interviewee-Tabelle als Karten-Liste (Mock A).
   Die kompilierte React-Tabelle bleibt im DOM; Layout wird per CSS in Karten umgeformt. */

/* Spaltenkopf + colgroup ausblenden -- die Karte trägt ihre Bedeutung visuell. */
table.interviews thead,
table.interviews colgroup {
  display: none !important;
}

/* Tabelle als Container, tbody als Flex-Stack. */
table.interviews {
  display: block !important;
  background: transparent !important;
  width: 100%;
  border-collapse: separate;
  table-layout: auto !important;
}
table.interviews tbody {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  background: transparent !important;
}

/* Zeile -> Karte. Grid-Layout mit 7 Spalten, 2 Zeilen. */
table.interviews tbody tr {
  display: grid !important;
  grid-template-columns: 6px 96px minmax(200px, 1.8fr) minmax(170px, 1.4fr) minmax(160px, 1.2fr) 140px 24px;
  grid-template-rows: auto auto;
  column-gap: 18px;
  row-gap: 2px;
  align-items: center;
  background: #fff !important;
  border: 1px solid var(--border, #e6e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 2px #1018280a;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
table.interviews tbody tr:active { transform: translateY(0); }
table.interviews tbody tr:nth-child(odd) { background: #fff !important; }
table.interviews tbody tr:hover {
  background: #fff !important;
  border-color: var(--accent-2, #ff4f8a);
  box-shadow: 0 4px 12px #ff1f6712;
}

/* Status-Balken links via ::before */
table.interviews tbody tr::before {
  content: "";
  grid-column: 1 / 2;
  grid-row: 1 / -1;
  align-self: stretch;
  background: var(--row-status, #cbd5e1);
  border-radius: 4px;
  min-height: 36px;
}
table.interviews tbody tr.status-to_be_requested { --row-status: #475569; }
table.interviews tbody tr.status-requested      { --row-status: #d97706; }
table.interviews tbody tr.status-scheduled      { --row-status: #0369a1; }
table.interviews tbody tr.status-completed      { --row-status: #047857; }

/* Original-Insetschatten der ersten td deaktivieren -- wir haben den Balken oben. */
table.interviews tbody tr[class^="status-"] td:first-child {
  box-shadow: none !important;
}

/* Chevron rechts via ::after */
table.interviews tbody tr::after {
  content: "›";
  grid-column: 7;
  grid-row: 1 / -1;
  justify-self: end;
  align-self: center;
  color: var(--muted, #5c6880);
  font-size: 22px;
  font-weight: 700;
  transition: transform .2s ease;
  line-height: 1;
}
table.interviews tbody tr.row-expanded::after { transform: rotate(90deg); }

/* Alle td neutralisieren */
table.interviews tbody tr td {
  border: none !important;
  padding: 0 !important;
  display: block;
  background: transparent !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* Cell-Positionierung via data-col */
table.interviews tbody tr td[data-col="id"] {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #1b2130;
  line-height: 1.3;
}
table.interviews tbody tr td[data-col="name"] {
  grid-column: 3; grid-row: 1;
  font-size: 14.5px;
  font-weight: 700;
  color: #151b28;
}
table.interviews tbody tr td[data-col="role"] {
  grid-column: 3; grid-row: 2;
  font-size: 12.5px;
  color: var(--muted, #5c6880);
  line-height: 1.35;
}
table.interviews tbody tr:not(.row-expanded) td[data-col="role"] {
  white-space: nowrap;
  text-overflow: ellipsis;
}
table.interviews tbody tr td[data-col="org"] {
  grid-column: 4; grid-row: 1;
  font-size: 13.5px;
  font-weight: 600;
}
table.interviews tbody tr td[data-col="orgType"] {
  grid-column: 4; grid-row: 2;
  font-size: 12px;
  color: var(--muted, #5c6880);
}
table.interviews tbody tr td[data-col="email"] {
  grid-column: 5; grid-row: 1;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.interviews tbody tr td[data-col="phone"] {
  grid-column: 5; grid-row: 2;
  font-size: 12px;
  color: var(--muted, #5c6880);
}
table.interviews tbody tr td[data-col="status"] {
  grid-column: 6; grid-row: 1;
  align-self: center;
  font-size: 12px;
}
table.interviews tbody tr td[data-col="scheduled"] {
  grid-column: 6; grid-row: 2;
  font-size: 11.5px;
  color: var(--muted, #5c6880);
}

/* transcription + notes: nur sichtbar wenn expandiert */
table.interviews tbody tr td[data-col="transcription"],
table.interviews tbody tr td[data-col="notes"] {
  display: none;
}

table.interviews tbody tr.row-expanded {
  grid-template-rows: auto auto auto;
  outline: 2px solid var(--accent, #ff1f67);
  outline-offset: -2px;
}
table.interviews tbody tr.row-expanded td[data-col="role"] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
table.interviews tbody tr.row-expanded td[data-col="notes"] {
  display: block;
  grid-column: 2 / 7;
  grid-row: 3;
  margin-top: 10px;
  padding-top: 10px !important;
  border-top: 1px dashed var(--border, #e6e8f0);
  font-size: 12.5px;
  color: #1b2130;
  line-height: 1.5;
  white-space: pre-wrap;
}
table.interviews tbody tr.row-expanded td[data-col="transcription"] {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-column: 6 / 8;
  grid-row: 3;
  margin-top: 10px;
  padding-top: 10px !important;
  border-top: 1px dashed var(--border, #e6e8f0);
  font-size: 12px;
  color: var(--muted, #5c6880);
  justify-self: end;
}
table.interviews tbody tr.row-expanded td[data-col="transcription"]::before {
  content: "Transcription:";
  font-weight: 600;
}

/* "Keine Interviews"-Zeile abfangen (td colspan=11) */
table.interviews tbody tr td[colspan] {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  padding: 16px !important;
  text-align: center;
}

/* Vertikalen Status-Hit-Bar (Tooltip-Bar links) verbergen -- ::before macht's jetzt. */
table.interviews .status-bar-hit { display: none !important; }

/* Drag-Handle in id-Zelle: kleines Padding rechts */
table.interviews tbody tr td[data-col="id"] .drag-handle { margin-left: 4px; }

/* Action-Buttons (Upload Summary / Summary / Eject) und Drag-Handle in der id-Zelle
   im kollabierten Zustand verbergen -- die id-Zelle bleibt schlank.
   Subtiler "Summary vorhanden"-Indikator via :has() */
table.interviews tbody tr:not(.row-expanded) td[data-col="id"] > div,
table.interviews tbody tr:not(.row-expanded) td[data-col="id"] > .drag-handle {
  display: none !important;
}

/* Hinweis-Icon "Summary verfügbar" */
table.interviews tbody tr:not(.row-expanded) td[data-col="id"]:has(.btn-red) {
  position: relative;
}
table.interviews tbody tr:not(.row-expanded) td[data-col="id"]:has(.btn-red)::after {
  content: "✓ summary";
  display: block;
  margin-top: 4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #047857;
  letter-spacing: .2px;
}

/* Hinweis "Summary fehlt" wenn Status = completed aber kein Summary */
table.interviews tbody tr.status-completed:not(.row-expanded) td[data-col="id"]:not(:has(.btn-red))::after {
  content: "⬆ no summary";
  display: block;
  margin-top: 4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #b45309;
  letter-spacing: .2px;
}

/* Im expandierten Zustand: Buttons und Drag-Handle als kompakte horizontale Leiste */
table.interviews tbody tr.row-expanded td[data-col="id"] {
  align-self: start;
  padding-top: 2px !important;
}
table.interviews tbody tr.row-expanded td[data-col="id"] > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px !important;
}
table.interviews tbody tr.row-expanded td[data-col="id"] > .drag-handle {
  display: inline-block;
  margin-top: 8px;
  opacity: .55;
}

/* Status-Pille innerhalb status-Zelle: kompakter Stil */
table.interviews tbody tr td[data-col="status"] .row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
}
table.interviews tbody tr.status-to_be_requested td[data-col="status"] .row { background: #dde3ec; color: #1b2130; }
table.interviews tbody tr.status-requested      td[data-col="status"] .row { background: #ffdf94; color: #7a4e00; }
table.interviews tbody tr.status-scheduled      td[data-col="status"] .row { background: #cdeeff; color: #003850; }
table.interviews tbody tr.status-completed      td[data-col="status"] .row { background: #c6f6e1; color: #064e3b; }

/* Drag-State (während Reordering) sichtbar lassen */
table.interviews tbody tr.is-dragging { opacity: .6; }
table.interviews tbody tr.drop-target { outline: 2px dashed var(--accent, #ff1f67); outline-offset: -2px; }

/* Schmalere Viewports -- Karten umlegen */
@media (max-width: 960px) {
  table.interviews tbody tr {
    grid-template-columns: 6px 1fr 1fr 28px;
    grid-template-rows: auto auto auto auto;
  }
  table.interviews tbody tr td[data-col="id"]      { grid-column: 2; grid-row: 1; }
  table.interviews tbody tr td[data-col="status"]  { grid-column: 3; grid-row: 1; justify-self: end; }
  table.interviews tbody tr td[data-col="name"]    { grid-column: 2 / 4; grid-row: 2; }
  table.interviews tbody tr td[data-col="role"]    { grid-column: 2 / 4; grid-row: 3; }
  table.interviews tbody tr td[data-col="org"]     { grid-column: 2; grid-row: 4; }
  table.interviews tbody tr td[data-col="orgType"] { grid-column: 3; grid-row: 4; justify-self: end; }
  table.interviews tbody tr td[data-col="email"],
  table.interviews tbody tr td[data-col="phone"],
  table.interviews tbody tr td[data-col="scheduled"] { display: none; }
  table.interviews tbody tr::after { grid-column: 4; grid-row: 1 / -1; }
}
