/*!
 * HFL – Luca DM Voice Bubbles (Phase 3 hook) – v4
 * - Audio in .luca-feed wie Messenger-Voice-Bubbles
 * - DM-Version ohne weiße Standard-Progresslinie
 */

/* 1) Luca-Audio-Bubbles: Hintergrund der Chatbubble transparent machen */
.luca-feed .luca-msg-bubble.hfl-has-voice {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Text-Container ohne Extra-Padding, Inhalt kommt komplett aus dem Voice-Bubble */
.luca-feed .luca-msg-bubble.hfl-has-voice .luca-msg-text {
  display: block;
  padding: 0;
}

/* Wrapper um die eigentliche PNG-Bubble */
.luca-feed .hfl-dm-voice-shell {
  display: inline-block;
  max-width: 100%;
}

/* Feste Größe analog Voice-Bubble (286×50) */
.luca-feed .hfl-dm-voice-bubble {
  position: relative;
  display: flex;
  align-items: center;
  width: 286px;
  max-width: 286px;
  height: 50px;
  box-sizing: border-box;
}

/* PNG-Bubble oben drüber */
.luca-feed .hfl-dm-voice-bubble .hfl-voice-bubble-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  z-index: 2;
  pointer-events: none;
}

/* Füll-Layer unterhalb der PNG-Bubble (hell + dunkel) */
.luca-feed .hfl-dm-voice-bubble .hfl-voice-fillwrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.luca-feed .hfl-dm-voice-bubble .hfl-voice-fill-base,
.luca-feed .hfl-dm-voice-bubble .hfl-voice-fill-dark {
  height: 100%;
  position: absolute;
  top: 0;
  border-radius: 6px;
}

/* UI-Layer oben drauf (Play-Button, Zeit) */
.luca-feed .hfl-dm-voice-ui {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 10px 14px 18px;
}

/* Play/Pause Button */
.luca-feed .hfl-voice__btn {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  position: relative;
  cursor: pointer;
}
.luca-feed .hfl-voice__btn::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 0;
  height: 0;
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: opacity .18s ease, transform .18s ease;
}
.luca-feed .hfl-voice__btn.is-playing::before {
  opacity: 0;
}
.luca-feed .hfl-voice__btn.is-playing::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 10px;
  height: 12px;
  background: linear-gradient(
    90deg,
    #fff 0 40%,
    transparent 40% 60%,
    #fff 60% 100%
  );
  border-radius: 2px;
}

/* Fortschrittsleiste – DM: DEAKTIVIERT, wir nutzen nur die Füllstreifen unter dem PNG */
.luca-feed .hfl-voice__bar {
  display: none; /* weiße Linie + Knopf komplett weg */
}

/* Zeitangabe */
.luca-feed .hfl-voice__time {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  opacity: .95;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 9px;   /* nochmal 3px weiter nach links */
  min-width: 3.6em;
  text-align: right;
}

/* Grundfarben der Füllstreifen (werden per JS in Breite/Position angepasst) */
.luca-feed .hfl-dm-voice-bubble .hfl-voice-fill-base {
  background: #efffff;
}
.luca-feed .hfl-dm-voice-bubble .hfl-voice-fill-dark {
  background: #8a8a8a;
  width: 0;
}

/* NEU: Fix für die Zeit-Position nur bei Voice Messages */
/* Wir nutzen den Nachbar-Selektor (+) statt :has(), damit der Editor nicht meckert */
.luca-feed .luca-msg-bubble.hfl-has-voice + .luca-msg-meta-outside {
  margin-top: 4px !important;
  position: relative;
  z-index: 2;
}