/* Digitana Social - Kommentare / Antworten
   Feinschliff 2026-05-21 V1
   Zweck: zentrale Kommentar-/Antwort-Optik fuer Mein Profil, Central,
   Profilbild-Overlay und spaetere Module.
   Wichtig: reine CSS-Auslagerung ohne bewusste sichtbare Designaenderung.
   Keine Aenderung an Live-, Backend-, Datenbank-, Template- oder Service-Logik. */


/* Aus base.css verschoben: mobile Kommentar-Einrueckung. */
@media (max-width: 860px) {
  .ds-profile-comment-level-1 { margin-left: 8px; }
  .ds-profile-comment-level-2 { margin-left: 14px; }
  .ds-profile-comment-level-3 { margin-left: 18px; }
}


/* --------------------------------------------------------------------------
   Allgemeine Kommentar-/Antwortstruktur aus profile_feed.css
   -------------------------------------------------------------------------- */

/* Kommentar-Textfeldbasis aus profile_feed.css verschoben. */
.ds-profile-comment-field {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(28,31,34,0.98), rgba(0,0,0,0.99));
  color: var(--ds-text);
  font: inherit;
  box-shadow: inset 0 0 0 1px rgba(215,237,255,0.26), inset 0 10px 18px rgba(0,0,0,0.54), 0 0 10px rgba(215,237,255,0.06);
  outline: none;
}

.ds-profile-comment-field:focus {
  box-shadow: inset 0 0 0 1px rgba(235,248,255,0.48), inset 0 10px 18px rgba(0,0,0,0.48), 0 0 12px rgba(215,237,255,0.18);
}

.ds-profile-comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
  margin-top: 9px;
}

.ds-profile-comments header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #9fc6dc;
  font-size: 0.82rem;
}

.ds-profile-comments header a {
  color: #dff5ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 0 7px rgba(32,169,255,0.22);
}

/* Kommentar-/Antwort-Grundstruktur aus profile_feed.css verschoben. */
.ds-profile-comments {
  margin-top: 8px;
  padding-left: 8px;
}

.ds-profile-comment {
  margin-top: 9px;
  padding: 8px 0 8px 10px;
  border-left: 1px solid color-mix(in srgb, var(--ds-profile-accent) 28%, rgba(215,237,255,0.14));
}

.ds-profile-comment-level-1 { margin-left: 14px; }
.ds-profile-comment-level-2 { margin-left: 26px; }
.ds-profile-comment-level-3 { margin-left: 36px; }

.ds-profile-comment > div {
  margin-top: 4px;
  color: #d8f0ff;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ds-profile-comment-form {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.ds-profile-comment-field {
  min-height: 46px;
}

.ds-profile-comment-actions {
  gap: 7px 9px;
}

.ds-profile-action-count {
  color: #dff5ff;
  font-size: 0.74rem;
  min-width: 0.6em;
  margin-left: -5px;
  margin-right: 4px;
  text-shadow: 0 0 7px rgba(215,237,255,0.18);
}

.ds-profile-comment-form {
  position: relative;
}

.ds-profile-comment-form .ds-profile-comment-field {
  padding-right: 46px;
}

.ds-profile-comment-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
}


/* --------------------------------------------------------------------------
   Kommentar-Eingabe-Struktur V1
   --------------------------------------------------------------------------
   Zweck:
   Stabile, wiederverwendbare Struktur fuer Kommentar-/Antwort-Eingaben.
   Das Textfeld bleibt die feste Eingabezelle. Der Senden-Pfeil sitzt unten
   rechts im Textfeldbereich. Zusatzaktionen wie Kommentar-Sichtbarkeit liegen
   darunter in einer eigenen Meta-Zeile und verschieben den Pfeil nicht.
   Gilt als Grundlage fuer Profil, Central und spaetere Module wie Galerie,
   Musik und Projekte.
   -------------------------------------------------------------------------- */

.ds-comment-input-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  display: block;
}

.ds-comment-input-shell .ds-profile-comment-field {
  display: block;
  width: 100%;
  padding-right: 46px;
}

.ds-comment-input-shell .ds-profile-comment-send,
.ds-comment-input-shell > .ds-profile-send-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.ds-comment-compose-meta {
  width: 100%;
  min-height: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  padding-right: 2px;
}

.ds-comment-compose-meta .ds-profile-post-visibility-picker {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.ds-comment-compose-meta .ds-profile-post-visibility-picker > summary {
  text-align: right;
}

.ds-comment-compose-meta .ds-profile-post-visibility-popover {
  left: auto;
  right: 0;
}

.ds-profile-comment-action-form .ds-comment-input-shell + [data-feed-edit-visibility] {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

/* Alte Reply-Box-Regeln aus profile_feed.css verschoben. */
.ds-profile-reply-box {
  position: relative;
  display: inline-flex;
}
.ds-profile-reply-box summary {
  cursor: pointer;
  color: #8fe2ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  list-style: none;
  text-shadow: 0 0 8px rgba(32, 169, 255, 0.42);
}
.ds-profile-reply-box summary::-webkit-details-marker { display: none; }
.ds-profile-reply-box[open] {
  display: block;
  flex-basis: 100%;
  width: 100%;
}
.ds-profile-comment-text { margin-top: 4px; }

.ds-profile-comments header a {
  color: #f4fbff;
  font-weight: 700;
  text-decoration: none;
  text-shadow:
    0 1px 0 #000000,
    0 0 7px rgba(215, 237, 255, 0.24),
    0 0 12px color-mix(in srgb, var(--ds-profile-accent) 22%, transparent);
}

.ds-profile-comments header a:hover {
  color: #ffffff;
  text-shadow:
    0 1px 0 #000000,
    0 0 10px rgba(215, 237, 255, 0.36),
    0 0 16px color-mix(in srgb, var(--ds-profile-accent) 28%, transparent);
}

.ds-profile-comment-actions {
  align-items: center;
  gap: 7px 9px;
}

.ds-profile-reply-box {
  align-items: center;
}

.ds-profile-reply-box {
  order: 2;
}

.ds-profile-reply-box[open] {
  display: block;
  flex-basis: 100%;
  width: 100%;
  margin-top: 6px;
}

.ds-profile-reply-box[open] {
  order: 8;
}

.ds-profile-comments:has(.ds-profile-reply-box[open]) > .ds-profile-comment-form {
  display: none;
}

/* Kommentar-Aufklappbereich aus profile_feed.css verschoben. */
.ds-profile-comments-toggle {
  border: 0;
  font: inherit;
}

.ds-profile-comments-collapsible[hidden] {
  display: none !important;
}

.ds-profile-comments-collapsible {
  margin-top: 10px;
}

.ds-profile-main-comment-form {
  margin: 8px 0 12px;
}

.ds-profile-comment {
  padding: 9px 10px 9px 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.30), color-mix(in srgb, var(--ds-profile-accent) 7%, rgba(0,0,0,0.10)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-profile-accent) 18%, rgba(215,237,255,0.07));
}

.ds-profile-comments header {
  align-items: center;
}

/* --------------------------------------------------------------------------
   Mein Profil - Kommentar-Aktionsstruktur 2026-05-12
   Saubere Struktur statt CSS-Schieberei:
   links Reaktion/Antwort/Bearbeiten, rechts Löschen, Formular darunter.
   Betrifft nur Kommentar-Aktionszeilen, keine Feed-Post-Aktionszeilen.
   -------------------------------------------------------------------------- */
.ds-profile-comment-actions-structured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 7px;
  align-items: start;
}

.ds-profile-comment-action-left {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 9px;
}

.ds-profile-comment-action-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  min-width: max-content;
}

.ds-profile-comment-actions-structured .ds-profile-inline-report,
.ds-profile-comment-actions-structured .ds-profile-inline-delete {
  margin: 0;
}

.ds-profile-comment-actions-structured .ds-profile-action-details {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.ds-profile-comment-actions-structured .ds-profile-action-details[open] {
  display: contents;
}

.ds-profile-comment-actions-structured .ds-profile-action-details > summary,
.ds-profile-comment-actions-structured .ds-profile-glow-link-button {
  white-space: nowrap;
}

.ds-profile-comment-actions-structured .ds-profile-comment-action-form {
  flex: 0 0 100%;
  width: 100%;
  max-width: 760px;
  margin: 7px 0 0;
  display: grid;
  gap: 8px;
}

.ds-profile-comment-actions-structured .ds-profile-comment-action-form .ds-profile-comment-field {
  min-height: 48px;
}

@media (max-width: 820px) {
  .ds-profile-comment-actions-structured {
    column-gap: 10px;
    row-gap: 6px;
  }

  .ds-profile-comment-action-left {
    gap: 6px 8px;
  }

  .ds-profile-comment-actions-structured .ds-profile-comment-action-form {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Mein Profil - stabiler Aktionsblock 2026-05-12
   Strukturbaustein für Kommentare/Unterkommentare:
   links Reaktion/Antworten/Bearbeiten, rechts Melden/Löschen,
   Antwort-/Bearbeitenfeld darunter. Keine neue Linkoptik.
   -------------------------------------------------------------------------- */
.ds-profile-action-block {
  width: 100%;
  margin-top: 9px;
}

.ds-profile-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  width: 100%;
}

.ds-profile-action-left,
.ds-profile-action-right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 9px;
  min-width: 0;
}

.ds-profile-action-right {
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

.ds-profile-action-block .ds-profile-inline-report,
.ds-profile-action-block .ds-profile-inline-delete {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.ds-profile-action-block .ds-profile-glow-link-button {
  white-space: nowrap;
}

.ds-profile-action-panel {
  width: 100%;
  margin-top: 8px;
}

.ds-profile-action-panel[hidden] {
  display: none !important;
}

.ds-profile-action-panel .ds-profile-comment-action-form {
  width: min(760px, 100%);
  display: grid;
  gap: 8px;
  margin: 0;
}

.ds-profile-action-panel .ds-profile-comment-field {
  min-height: 48px;
}

@media (max-width: 640px) {
  .ds-profile-action-row {
    align-items: flex-start;
  }

  .ds-profile-action-right {
    gap: 7px;
  }
}

/* Aus base.css verschoben: alte Zeilen 5735-5741 */
.ds-profile-action-left {
  flex: 1 1 auto;
}

.ds-profile-action-right {
  flex: 0 0 auto;
}


/* Kommentar-/Antwortfelder: Senden-Pfeil unten rechts aus profile_feed.css verschoben. */
.ds-profile-comment-form,
.ds-profile-comment-action-form {
  position: relative;
  display: block;
}

.ds-profile-comment-form .ds-profile-comment-field,
.ds-profile-comment-action-form .ds-profile-comment-field {
  width: 100%;
  margin: 0;
  padding-right: 52px;
}

.ds-profile-comment-form > .ds-profile-send-icon,
.ds-profile-comment-action-form > .ds-profile-send-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
}

.ds-profile-action-panel .ds-profile-comment-action-form {
  display: block;
}


/* --------------------------------------------------------------------------
   Central-Kommentare aus central.css
   -------------------------------------------------------------------------- */
/* Kommentare und Antworten auf Central sauber getrennt und einrueckbar. */
.ds-central-comments {
  margin-top: 10px;
  padding-top: 8px;
  overflow: visible;
}

.ds-central-comments .ds-profile-main-comment-form,
.ds-central-comments .ds-central-comment-action-form {
  position: relative;
  margin: 9px 0 12px;
}

.ds-central-comments .ds-profile-comment {
  position: relative;
  margin: 11px 0 0;
  padding: 10px 12px 9px;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(32,169,255,0.11), transparent 46%),
    linear-gradient(135deg, rgba(8, 22, 34, 0.94), rgba(0, 0, 0, 0.98) 54%, rgba(0,0,0,1));
  border: 1px solid rgba(86, 185, 238, 0.30);
  box-shadow:
    0 0 12px rgba(32,169,255,0.11),
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 -14px 22px rgba(0,0,0,0.28);
  overflow: visible;
}

.ds-central-comments .ds-profile-comment::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 26%;
  top: -8px;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      transparent,
      rgba(32,169,255,0.36),
      rgba(215,237,255,0.70),
      rgba(32,169,255,0.32),
      transparent);
  box-shadow:
    0 0 8px rgba(32,169,255,0.46),
    0 0 14px rgba(215,237,255,0.12);
  pointer-events: none;
}

.ds-central-comments .ds-profile-comment-level-1 {
  margin-left: 28px;
}

.ds-central-comments .ds-profile-comment-level-2 {
  margin-left: 52px;
}

.ds-central-comments .ds-profile-comment-level-3,
.ds-central-comments .ds-profile-comment-level-4,
.ds-central-comments .ds-profile-comment-level-5 {
  margin-left: 74px;
}

.ds-central-comments .ds-profile-comment header {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 7px;
}


/* Central - Datum/Uhrzeit bei Kommentaren und Antworten rechts ausrichten.
   Nur Kommentar-Header auf Central. Keine Feed-, Profil- oder Overlay-Aenderung. */
.ds-central-comments .ds-profile-comment header .ds-profile-date {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

.ds-central-comments .ds-profile-comment-text {
  margin: 0 0 8px;
  line-height: 1.45;
}

.ds-central-comments .ds-profile-action-block {
  position: relative;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(215,237,255,0.13);
  box-shadow: inset 0 1px 0 rgba(32,169,255,0.10);
}

.ds-central-comments .ds-profile-action-row {
  align-items: center;
}


@media (max-width: 720px) {
  .ds-central-comments .ds-profile-comment-level-1 {
    margin-left: 18px;
  }

  .ds-central-comments .ds-profile-comment-level-2,
  .ds-central-comments .ds-profile-comment-level-3,
  .ds-central-comments .ds-profile-comment-level-4,
  .ds-central-comments .ds-profile-comment-level-5 {
    margin-left: 30px;
  }
}


/* --------------------------------------------------------------------------
   Profilbild-Overlay-Kommentare aus profile_image_overlay.css
   -------------------------------------------------------------------------- */
.ds-profile-image-comments {
  flex: 1 1 180px;
  min-height: 0;
  max-height: min(42vh, 430px);
  max-height: min(42dvh, 430px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 28px;
  scroll-padding-bottom: 32px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ds-profile-image-comments[hidden] {
  display: none !important;
}

.ds-profile-image-comments::after {
  content: "";
  display: block;
  height: 46px;
  min-height: 46px;
}


.ds-profile-image-comments .ds-profile-comment-field {
  min-height: 46px;
}

.ds-profile-image-comments .ds-profile-comment:last-child {
  margin-bottom: 30px;
}


@media (max-width: 820px) {
  .ds-profile-image-comments {
    flex-basis: 160px;
    max-height: min(40vh, 360px);
    max-height: min(40dvh, 360px);
    padding-bottom: 34px;
    scroll-padding-bottom: 38px;
  }

  .ds-profile-image-comments::after {
    height: 38px;
    min-height: 38px;
  }
}
