/*
 * Direktangebot in der Musiker-Ansicht.
 * Modal-Grundlage kommt aus modal.css (.modal, .modal-content, .popup-button),
 * Karten-Elemente aus dem Dashboard (.gig-detail-item, .status-badge).
 *
 * Die Antwort-Oberfläche (.direct-offer-respond) teilen sich das Modal im
 * Dashboard und die Detailseite view-tender.html.
 */

/* --- Betrag auf der Dashboard-Karte --- */

.tender-detail-fee {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.direct-offer-fee {
  font-size: 16px;
  font-weight: 700;
  color: #e38722;
}
.direct-offer-fee-label {
  font-size: 12px;
  color: #999;
}
.direct-offer-extras {
  font-size: 13px;
  color: #555;
}

.direct-offer-extra-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.direct-offer-extra-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1.5px solid #e38722;
  background: #fff8f0;
  color: #c56a10;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.direct-offer-extra-badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}
.tender-detail-extras {
  align-items: center;
}
.direct-offer-row-value .direct-offer-extra-badges {
  justify-content: flex-end;
}

.tender-detail-deadline {
  color: #6a4a8c;
  font-weight: 600;
}
.tender-deadline-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  gap: 1px;
}
.tender-deadline-sub {
  font-size: 12px;
  font-weight: 500;
  color: #815da7;
}

/* --- Modal --- */

.direct-offer-modal {
  max-width: 560px;
  text-align: left;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
}
.direct-offer-modal h2 {
  font-size: 20px;
  color: #815da7;
  margin-bottom: 16px;
  padding-right: 32px;
}

.direct-offer-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
}
.direct-offer-close:hover { color: #666; }

.direct-offer-table {
  border-top: 1px solid #eee;
  margin-bottom: 4px;
}
.direct-offer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 14px;
}
.direct-offer-row-label { color: #888; }
.direct-offer-row-value { color: #333; font-weight: 600; text-align: right; }

/* --- Aktionen: im Modal drei volle Zeilen, auf der Detailseite Kopfzeile --- */

.direct-offer-respond { margin-top: 20px; }

.direct-offer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.direct-offer-actions:empty { display: none; }

.direct-offer-actions .popup-button,
.direct-offer-panel .popup-button,
.direct-offer-send {
  margin: 0;
  width: 100%;
  min-height: 48px;
  padding: 0 20px !important;
  border-radius: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.direct-offer-actions .popup-button:hover,
.direct-offer-panel .popup-button:hover {
  transform: none;
}

/* --- Wizard: Übersicht (Schritt 1) und Antwortformular (Schritt 2) --- */

.direct-offer-step[hidden] { display: none; }

.direct-offer-step--answer {
  animation: directOfferStepIn 0.18s ease-out;
}
@keyframes directOfferStepIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.direct-offer-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: none;
  background: none;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #815da7;
  cursor: pointer;
}
.direct-offer-back:hover { color: #6a4a8c; }
.direct-offer-back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Gegenvorschlag und Absage --- */

.direct-offer-panel:empty { display: none; }
.direct-offer-panel-title {
  font-size: 16px;
  color: #815da7;
  font-weight: 600;
  margin-bottom: 6px;
}
.direct-offer-panel-hint {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 14px;
}

.direct-offer-field-row {
  display: flex;
  gap: 12px;
}
.direct-offer-field-row .direct-offer-field { flex: 1 1 0; min-width: 0; }

.direct-offer-field { margin-bottom: 13px; }
.direct-offer-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 5px;
}
.direct-offer-field input,
.direct-offer-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Montserrat', Arial, sans-serif;
  color: #333;
}
.direct-offer-field input:focus,
.direct-offer-field textarea:focus { outline: none; border-color: #815da7; }
.direct-offer-field textarea { min-height: 76px; resize: vertical; }

.direct-offer-label-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Info-Icon und Tooltip exakt wie im Profil-Wizard (create-profile-artists):
   grauer Kreis mit "?", dunkler Tooltip zentriert unter dem Icon, Pfeil oben. */
.direct-offer-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #A0A0A0;
  border-radius: 50%;
  background: transparent;
  color: #A0A0A0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.direct-offer-info-btn::before { content: '?'; font-style: normal; }
.direct-offer-info-tip {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 8px;
  transform: translateX(-50%);
  width: 180px;
  background: #4A4A4A;
  color: #E5E5E5;
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
  line-height: normal;
  padding: 8px;
  border-radius: 5px;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
  z-index: 1100;
}
.direct-offer-info-tip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #4A4A4A transparent;
}
.direct-offer-info-btn:hover .direct-offer-info-tip,
.direct-offer-info-btn.is-open .direct-offer-info-tip {
  visibility: visible;
  opacity: 1;
}

.direct-offer-reasons { margin-bottom: 14px; }
.direct-offer-reason {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  font-size: 14px;
  color: #444;
  cursor: pointer;
}
.direct-offer-reason input { margin-top: 3px; flex-shrink: 0; }
.direct-offer-respond .go-decline-chips { margin-bottom: 14px; }

.direct-offer-send {
  width: 100%;
  margin-top: 4px;
}

/* Folgt der Absage-Knopf direkt auf ein freiwilliges Häkchen, klebte der
   Hinweistext auf schmalen Displays am Knopf. */
.direct-offer-consent-check--optional + .direct-offer-send { margin-top: 14px; }

/* Der Antwort-Bereich sitzt auf der Detailseite unter den Eckdaten und
   braucht dort eine eigene Trennlinie. Der Rest der frueheren .do-detail-*-
   Ebene liegt jetzt in gig-offer.css. Die drei Knoepfe selbst liegen in der
   Kopfzeile (.go-topbar-actions); hier oeffnet sich nur das Formular. */
.go-detail .direct-offer-respond {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #eee;
}
.go-detail .direct-offer-respond--toolbar[hidden],
.go-detail .direct-offer-respond--toolbar:not(:has(.direct-offer-step--answer:not([hidden]))) {
  display: none;
}
/* Auf der Detailseite: Gegenvorschlag (gefuellt) und Absagen (nur umrandet)
   nebeneinander, darunter gross und breit "Interessiert" als Hauptaktion. */
.go-detail .direct-offer-actions {
  max-width: none;
  flex-direction: row;
  flex-wrap: wrap;
}
.go-detail .direct-offer-actions .popup-button {
  flex: 1 1 140px;
  width: auto;
}
.go-detail .direct-offer-actions .btn-brand { order: 1; }
.go-detail .direct-offer-actions .btn-danger {
  order: 2;
  background: #fff;
  color: #d92d20;
  border: 1px solid #d92d20;
  box-shadow: none;
}
.go-detail .direct-offer-actions .btn-danger:hover {
  background: #fdf1f0;
}
.go-detail .direct-offer-actions .direct-offer-action--accept {
  order: 3;
  flex: 1 1 100%;
  min-height: 56px;
  font-size: 17px;
}

@media (max-width: 600px) {
  .direct-offer-modal { max-width: 100%; }
  .direct-offer-field-row { flex-direction: column; gap: 0; }
}

/* Zusage auf einen von mehreren angebotenen Terminen */
.direct-offer-panel .go-date-tiles { margin-bottom: 16px; }

.direct-offer-panel-lead {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px;
}
.direct-offer-date-choice {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.direct-offer-date-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
}
.direct-offer-date-option:has(input:checked) {
  border-color: #e38722;
  background: #fdf3e8;
  font-weight: 600;
}
.direct-offer-date-option input { accent-color: #e38722; }

/* Bestätigung des Kontaktaustauschs */
.direct-offer-consent {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
}
.direct-offer-consent-details { margin: 0 0 6px; }
.direct-offer-consent-details[open] { margin-bottom: 10px; }
.direct-offer-consent-summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #815da7;
  list-style: none;
}
.direct-offer-consent-summary::-webkit-details-marker { display: none; }
.direct-offer-consent-summary:hover { color: #6b46c1; }
.direct-offer-consent-lead {
  font-size: 12.5px;
  color: #777;
  line-height: 1.5;
  margin: 8px 0 6px;
}
.direct-offer-consent-note {
  font-size: 11.5px;
  color: #999;
  line-height: 1.45;
  margin: 0 0 16px;
}
/* Im Popup schlaegt ".modal-content p" (15 px, dunkel) die Klassen oben,
   deshalb hier mit staerkerer Spezifitaet dezent halten. */
.direct-offer-modal .direct-offer-consent-lead {
  font-size: 12.5px;
  color: #777;
  line-height: 1.5;
  margin: 8px 0 6px;
}
.direct-offer-modal .direct-offer-consent-note {
  font-size: 11.5px;
  color: #999;
  line-height: 1.45;
  margin: 0 0 16px;
}
.direct-offer-modal .artist-set-picker-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.direct-offer-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}
.direct-offer-consent-check input {
  margin-top: 2px;
  accent-color: #e38722;
  flex-shrink: 0;
}

/* Freiwilliges Häkchen für die Telefonnummer */
.direct-offer-consent-check--optional {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  font-weight: 500;
}
.direct-offer-consent-check--optional em {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: #888;
  margin-top: 2px;
}

/* Hinweis zur letzten Runde, im Dashboard-Modal unter der Preis-Kette.
   Der frueher eigene Kasten "Das finale Angebot" ist entfallen: die Kette
   nennt Betrag, Runde und Rang bereits, ein zweiter Block darunter waere
   dieselbe Zahl ein zweites Mal. */
.direct-offer-final-hint {
  margin: 12px 0 16px;
  font-size: 13px;
  color: #8a6a45;
  line-height: 1.55;
}
