/* ============================================================
   JOBBÖRSE – BASIS / TABELLEN
   ------------------------------------------------------------
   Zweck:
   - Einheitliche vertikale Ausrichtung
   - Verhindert "springende" Tabellenzellen
   ============================================================ */

.jobboerse-index .table td,
.jobboerse-index .table th,
.jobboerse-view .table td,
.jobboerse-view .table th {
  vertical-align: middle;
}


/* ============================================================
   DETAILANSICHT
   ------------------------------------------------------------
   Beschreibungstexte aus Job-Modell
   (nicht Freitext aus Bewerbungen!)
   ============================================================ */

.jobboerse-view .job-description {
  line-height: 1.5;
}


/* ============================================================
   FREITEXT (Bewerbungsnachrichten etc.)
   ------------------------------------------------------------
   BS5-Ersatz für frühere .well-Klasse
   Wichtig:
   - Nur für gespeicherten, unbearbeiteten Freitext
   - Absätze & Zeilenumbrüche müssen erhalten bleiben
   ============================================================ */

.jobboerse-application-view .jobboerse-message {
  white-space: pre-wrap;
  word-break: break-word;
}


/* ============================================================
   BADGES (ALLGEMEIN)
   ------------------------------------------------------------
   Kleine Status-/Info-Kennzeichnungen
   ============================================================ */

.jobboerse-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.15);
}


/* ============================================================
   STATUS-BADGES
   ------------------------------------------------------------
   Farbige Zustände (aktiv / geschlossen / Entwurf)
   ============================================================ */

.jobboerse-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;

  /* bewusst keine Bootstrap-Interaktion */
  border: none;
  box-shadow: none;
}

.jobboerse-status-active  { background: #4caf50; color: #fff; }
.jobboerse-status-closed  { background: #e53935; color: #fff; }
.jobboerse-status-draft   { background: #c7771a; color: #fff; }


/* ============================================================
   GRID / KACHELN
   ------------------------------------------------------------
   Responsives CSS-Grid (ohne Bootstrap-Abhängigkeit)
   ============================================================ */

.jobboerse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 10px;
}


/* ============================================================
   KARTEN – GRUNDLAYOUT
   ------------------------------------------------------------
   Eigene Karten, bewusst NICHT Bootstrap .card
   ============================================================ */

.jobboerse-card {
  position: relative;
  background: #f7f7f7;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  padding: 14px;

  display: flex;
  flex-direction: column;
  height: 100%;

  transition: box-shadow 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.jobboerse-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}


/* ------------------------------------------------------------
   GESCHLOSSENE EINTRÄGE
   ------------------------------------------------------------
   Visuell deaktiviert, aber noch sichtbar
   ------------------------------------------------------------ */

.jobboerse-card--closed {
  opacity: 0.75;
  filter: grayscale(0.15);
  cursor: default;
}

.jobboerse-card--closed:hover {
  transform: none;
  box-shadow: none;
}


/* ------------------------------------------------------------
   KLICK-OVERLAY
   ------------------------------------------------------------
   Macht gesamte Karte klickbar,
   ohne innere Buttons zu blockieren
   ------------------------------------------------------------ */

.jobboerse-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-decoration: none;
}


/* ============================================================
   INHALTSBEREICH
   ============================================================ */

.jobboerse-card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jobboerse-card-title {
  font-size: 16px;
  margin: 0 0 6px 0;
  font-weight: 600;
  line-height: 1.3;
  color: #222;
}

.jobboerse-card-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
}

.jobboerse-card-meta > div {
  margin-bottom: 4px;
}

.jobboerse-card-description {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #444;
}


/* ============================================================
   AKTIONSLEISTE (KARTEN)
   ============================================================ */

.jobboerse-card-actions {
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: 4px;

  display: flex;
  align-items: center;
  gap: 6px;

  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.jobboerse-card-actions form {
  display: inline-flex;
  margin: 0;
}


/* ============================================================
   BUTTONS – KARTEN
   ------------------------------------------------------------
   Nur sekundäre Buttons bewusst gestylt,
   keine globalen Button-Overrides
   ============================================================ */

.jobboerse-card-actions .btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.jobboerse-card-actions .btn-secondary {
  background-color: #eeeeee;
  border-color: #cccccc;
  color: #222;
}

.jobboerse-card-actions .btn-secondary:hover {
  background-color: #e2e2e2;
  border-color: #bdbdbd;
  color: #000;
}

.jobboerse-card-actions .btn:disabled {
  background-color: #e3e3e3;
  border-color: #cfcfcf;
  color: #999;
  cursor: not-allowed;
  opacity: 1;
}


/* ============================================================
   FORMULARE (SUCHE / FILTER)
   ============================================================ */

.jobboerse-index input[type="text"],
.jobboerse-index input[type="search"],
.jobboerse-index select,
.jobboerse-view input[type="text"],
.jobboerse-view select {
  background-color: #ffffff;
  color: #222;
  border: 1px solid #cfcfcf;
}

.jobboerse-index input::placeholder {
  color: #888;
}

.jobboerse-index input:focus,
.jobboerse-index select:focus {
  border-color: #5cb85c;
  box-shadow: 0 0 0 1px rgba(92,184,92,.35);
  outline: none;
}


/* ============================================================
   PRIMÄRE AKTIONEN
   ============================================================ */

.jobboerse-view .btn-success,
.jobboerse-index .btn-success {
  background-color: #4caf50;
  border-color: #4caf50;
  color: #fff;
}

.jobboerse-view .btn-success:hover,
.jobboerse-index .btn-success:hover {
  background-color: #43a047;
  border-color: #43a047;
}


/* ============================================================
   DARK MODE (BS5-KONFORM)
   ------------------------------------------------------------
   Nutzt data-bs-theme von HumHub
   ============================================================ */

html[data-bs-theme="dark"] .jobboerse-card {
  background-color: #1f1f1f;
  border-color: rgba(255,255,255,.08);
}

html[data-bs-theme="dark"] .jobboerse-card,
html[data-bs-theme="dark"] .jobboerse-card p {
  color: #e6e6e6;
}

html[data-bs-theme="dark"] .jobboerse-card-description {
  color: #cfcfcf;
}

html[data-bs-theme="dark"] .jobboerse-card-actions {
  border-top-color: rgba(255,255,255,.12);
}

html[data-bs-theme="dark"] .jobboerse-card-actions .btn-secondary {
  background-color: #3a3a3a;
  border-color: #4a4a4a;
  color: #e0e0e0;
}

html[data-bs-theme="dark"] .jobboerse-card-actions .btn-secondary:hover {
  background-color: #4a4a4a;
  color: #ffffff;
}
