/* =========================================================
 * GOOGLE FONTS (Für Cover Message)
 * =======================================================*/
@import url('https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do:wght@400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@400;600;700&display=swap');


/* =========================================================
 * BASIS-CONTAINER & FLEXBOX FIXES
 * =======================================================*/

.luca-msgs__inner {
  position: relative;
  overflow: hidden !important; /* Scrollen passiert nur im Feed */
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Der Feed selbst: Flexibel, scrollbar */
.luca-feed {
  flex-grow: 1 !important;      /* Nimmt allen Platz */
  flex-shrink: 1 !important;    /* Schrumpft, wenn Promo kommt */
  min-height: 0 !important;     /* Wichtig für Firefox Flex-Scroll */
  overflow-y: auto !important;  /* Scrollbalken NUR hier */
  overflow-x: hidden;
  height: auto !important;
  padding-bottom: 20px !important; /* Kleiner Abstand zum Rand/Promo */
}

.luca-feed.luca-feed-has-promo{
  /* Padding wird jetzt dynamisch durch Flexbox geregelt, aber sicherheitshalber */
  padding-bottom: 10px; 
}

/* =========================================================
 * PROMO SLOT LAYOUT
 * =======================================================*/

.luca-chat-promo-slot {
  position: relative !important; /* Normaler Fluss, nicht absolut! */
  flex: 0 0 auto !important;     /* Fixe Höhe basierend auf Inhalt */
  width: 100% !important;
  margin: 0 !important;
  z-index: 50 !important;
  
  /* Box-Design */
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 0;
  
  /* Schatten nach oben zur Trennung */
  box-shadow: 0 -5px 20px rgba(0,0,0,0.15);

  display: flex;
  align-items: flex-end;

  /* Padding (Desktop) */
  padding: 18px 22px 26px;

  /* Animation */
  opacity: 0;
  transform: translateY(20px); /* Leichter Slide von unten */
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Hard override: Promo-Slot soll NIE sticky sein */
.luca-chat-promo-slot{
  position: static !important;
  top: auto !important;
  bottom: auto !important;
}

/* Promo in .luca-feed auf volle Panel-Breite ziehen - Fallback */
.luca-feed .luca-chat-promo-slot{
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
}

.luca-chat-promo-slot--visible{
  opacity: 1;
  transform: translateY(0);
}

.luca-chat-promo-slot--expired{
  opacity: 0;
  transform: translateY(20px);
  transition: transform .4s ease, opacity .4s ease;
  pointer-events: none;
}

.luca-chat-promo-inner{
  width: 100%;
  max-width: 980px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  gap: 12px;

  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

/* Countdown-Zeile */
.luca-chat-promo-countdown{
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.luca-chat-promo-countdown-label{ opacity: .82; }
.luca-chat-promo-countdown-time{ font-weight: 700; }

/* Body: Bild + Text – jetzt wie Mobile: alles untereinander */
.luca-chat-promo-body{
  display: flex;
  align-items: stretch;  /* volle Breite für Kinder */
  flex-direction: column;
  gap: 10px;
}

/* =========================================================
 * COVER IMAGE WRAPPER
 * =======================================================*/

.luca-chat-promo-cover{
  flex: 0 0 auto;
  width: 100%;
  /* MASTER ASPECT RATIO: Skaliert Cover perfekt */
  aspect-ratio: 16 / 9; 
  border-radius: 16px;
  overflow: hidden;
  max-height: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  position: relative; /* für Overlay-Buttons & Personal Message */
}

.luca-chat-promo-cover img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
 * PERSONAL MESSAGE OVERLAY (16:9 Scaling System)
 * =======================================================*/

.luca-promo-overlay {
  position: absolute;
  top: 0;
  left: 0;

  width: 1000px;       /* virtuelle Breite */
  height: 562.5px;     /* virtuelle Höhe (1000 × 9/16) */

  transform-origin: top left;
  /* Scale wird per JS gesetzt! */
  pointer-events: none;
  z-index: 10;
}

/* Basistypo – wird nur skaliert */
.luca-promo-cover-text {
  position: absolute;
  transform: rotate(-10deg);
  transform-origin: left top;

  line-height: 1.15;
  letter-spacing: 0.03em;

  pointer-events: none;
  user-select: none;

  word-wrap: break-word;
  white-space: normal;

  z-index: 5;
}


/* =========================================================
 * VARIANTE 1 – „artifact“ => PACIFICO / NOTHING YOU COULD DO
 * =======================================================*/

.luca-promo-cover-text--artifact {
  top: 18%;
  left: 4%;
  max-width: 50%;

  /* Base Size for 1000px container (+30%) */
  font-size: 42px;

  /* Font */
  font-family: "Nothing You Could Do", cursive, -apple-system, system-ui, sans-serif;

  /* Farbe */
  color: #f3f6f4;

  /* Blur / Glow */
  --cover-blur-artifact: 4px;

text-shadow:
  0px 2px var(--cover-blur-artifact) rgba(0,0,0,0.5),
  0px 5px calc(var(--cover-blur-artifact) * 1.5) rgba(0,0,0,0.5),
  0px 8px calc(var(--cover-blur-artifact) * 2) rgba(0,0,0,0.5);
}


/* =========================================================
 * VARIANTE 2 – „harting“ => SPECIAL ELITE
 * =======================================================*/

.luca-promo-cover-text--harting {
  top: 22%;
  left: 6%;
  max-width: 45%;

  /* Base Size for 1000px container (+30%) */
  font-size: 36px;

  font-family: "Special Elite", "Courier New", monospace;
  color: #ffffff;

  letter-spacing: 0.12em;
  text-transform: uppercase;

  --cover-blur-harting: 15px;

  text-shadow:
    0px 2px var(--cover-blur-harting) rgba(0,0,0,0.99),
    0px 2px calc(var(--cover-blur-harting) * 1.5) rgba(0,0,0,0.99),
    0px 2px calc(var(--cover-blur-harting) * 2) rgba(0,0,0,0.99);
}


/* =========================================================
 * VARIANTE 3 – „ibm_plex“ => BOLDONSE (FALLBACK LEXEND DECA)
 * =======================================================*/

.luca-promo-cover-text--ibm_plex {
  top: 18%;
  left: 5%;
  max-width: 45%;

  /* Base Size for 1000px container (+30%) */
  font-size: 39px;

  font-family: "Boldonse", "Lexend Deca", -apple-system, systemui, sans-serif;
  font-weight: 600;

  color: #F80E98;

  --cover-blur-ibm: 8px;

   text-shadow:
    0px 2px var(--cover-blur-ibm) rgba(0,0,0,0.25),
    0px 2px calc(var(--cover-blur-ibm) * 1.5) rgba(0,0,0,0.25),
    0px 2px calc(var(--cover-blur-ibm) * 2) rgba(0,0,0,0.25);
}


/* =========================================================
 * TEXT & MEDIA INFOS
 * =======================================================*/

/* Titel + Media-Icons nebeneinander */
.luca-chat-promo-copy{
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.luca-chat-promo-title{
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  flex: 1 1 auto; /* nimmt den verfügbaren Platz links ein */
}

/* Description komplett ausgeblendet (wird nur im Sneak Peek genutzt) */
.luca-chat-promo-description{
  display: none;
}

/* Media-Info (Images / Videos / Audios) */
.luca-promo-media-row{
  display: flex;
  align-items: center;
  gap: 6px;                   
  margin-top: 0;
  margin-left: auto;          /* schiebt Icons nach rechts */
  font-size: 14px;            
  font-weight: 500;
}

.luca-promo-media-item{ display: inline-flex; align-items: center; }
.luca-promo-media-icon{ display: block; width: 26px; height: auto; }
.luca-promo-media-count{ margin-left: 4px; font-weight: 600; }
.luca-promo-media-separator{ margin: 0 1px; font-weight: 600; opacity: 0.9; }

/* Desktop: Abstand vom rechten Rand nur für > 900px */
@media (min-width: 901px){
  .luca-promo-media-row{ margin-right: 18px; }
}


/* =========================================================
 * SNEAK PEEK / COLLECTION BUTTONS
 * =======================================================*/

.luca-chat-promo-peek-wrap{ margin-top: 8px; }

/* Desktop: Sneak Peek – Overlay unten rechts auf dem Promo-Bild */
.luca-chat-promo-cover .luca-chat-promo-peek-wrap--desktop{
  position: absolute;
  bottom: 12px;
  right: 12px;
  margin: 0;
  transform: scale(0.9);
  transform-origin: right bottom;
  z-index: 20; /* Über dem Text-Overlay */
}

/* Desktop: Collection – Overlay unten links auf dem Promo-Bild */
.luca-chat-promo-cover .luca-chat-promo-collection-wrap--desktop{
  position: absolute;
  bottom: 12px;
  left: 12px;
  margin: 0;
  transform: scale(0.9);
  transform-origin: left bottom;
  z-index: 20;
}

/* Wenn KEIN Sneak-Peek-Button vorhanden ist, Collection-Button nach rechts schieben (Desktop) */
.luca-chat-promo-cover:not(:has(.luca-chat-promo-peek-wrap--desktop))
  .luca-chat-promo-collection-wrap--desktop{
  left: auto;
  right: 12px;
  transform-origin: right bottom;
}

.luca-chat-promo-peek-wrap--mobile{ display: none; }
.luca-chat-promo-collection-wrap--mobile{ display: none; }

.luca-chat-promo-peek-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 7px !important;
  min-height: 0;
  line-height: 1.0;
  font-size: 12px;
  white-space: nowrap;
  box-sizing: border-box;
  
  /* Glassmorphism */
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  color: #ffffff;
}

.luca-chat-promo-peek-btn .hfl-label{
  padding: 0 !important;
  margin: 0;
  line-height: 1.0;
  display: inline-block;
  color: #ffffff;
  text-shadow:
    0 0 34px rgba(235,51,255,1),
    0 0 34px rgba(46,126,255,1),
    0 0 34px rgba(255,123,46,1) !important;
}


/* =========================================================
 * RESPONSIVE (MOBILE)
 * =======================================================*/

@media (max-width: 900px){
  .luca-chat-promo-slot{
    padding: 10px 10px 40px;
    box-shadow: 0 -10px 26px rgba(0,0,0,.35);
  }

  .luca-chat-promo-body{
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .luca-chat-promo-cover{
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    border-radius: 16px;
  }

  .luca-chat-promo-copy{
    flex-direction: row;
    align-items: center;
    width: 100%;
  }

  .luca-chat-promo-title{ font-size: 18px; flex: 1 1 auto; }
  .luca-chat-promo-description{ display: none; }

  .luca-promo-media-row{
    font-size: 13px;
    gap: 6px;
    margin-top: 0;
    margin-left: auto;
    margin-right: 4px;
    align-self: auto;
  }
  .luca-promo-media-icon{ width: 22px; }

  .luca-chat-promo-cover .luca-chat-promo-peek-wrap--desktop{ display: none; }
  .luca-chat-promo-cover .luca-chat-promo-collection-wrap--desktop{ display: none; }

  .luca-chat-promo-cover .luca-chat-promo-peek-wrap--mobile{
    display: block;
    position: absolute;
    bottom: 8px;
    right: 8px;
    left: auto;
    margin: 0;
    transform: scale(0.75);
    transform-origin: right bottom;
    z-index: 20;
  }

  .luca-chat-promo-cover .luca-chat-promo-collection-wrap--mobile{
    display: block;
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: auto;
    margin: 0;
    transform: scale(0.75);
    transform-origin: left bottom;
    z-index: 20;
  }

  .luca-chat-promo-cover:not(:has(.luca-chat-promo-peek-wrap--mobile))
    .luca-chat-promo-collection-wrap--mobile{
    left: auto;
    right: 8px; 
    transform-origin: right bottom;
  }

  .luca-chat-promo-peek-btn{
    font-size: 11px;
    padding: 1px 6px !important;
    line-height: 1.0;
  }
}


/* =========================================================
 * SNEAK PEEK OVERLAY & REACTION BUBBLES
 * =======================================================*/

html.luca-promo-peek-open{ overflow: hidden; }

.luca-promo-peek-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(10,10,14,.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000000;
}
.luca-promo-peek-backdrop.is-open{ display: flex; }

.luca-promo-peek-modal{
  max-width: min(92vw, 1080px);
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grid Layout für Bubble + Bild */
.luca-promo-peek-inner{
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 12px;
  align-items: start;
  justify-items: center;
  width: fit-content;
  max-width: 100%;
}

.luca-promo-peek-img{
  grid-row: 2;
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0,0,0,.55);
  filter: blur(24px);
  will-change: filter, transform;
}

.luca-promo-peek-img.is-unblurred{ animation: lucaPromoUnblur 3s ease-out forwards; }
@keyframes lucaPromoUnblur{ 0%{ filter: blur(24px); } 100%{ filter: blur(0px); } }

/* OLD CLOSE BUTTON REMOVED - NEW STYLING BELOW */
.luca-promo-peek-close{
  display: none !important; /* Safety hide */
}

/* ===== REACTION BUBBLE STYLES (Phase 1) ===== */

.hfl-peek-bubble{
  --hfl-bub-line: 24px;
  grid-row: 1;
  justify-self: start;
  display: none; 

  background: linear-gradient(135deg, #007aff, #0a84ff);
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  padding: 12px 18px; border-radius: 18px;
  min-width: 60px;
  max-width: calc(100% - 8px);
  font-size: 16px; 
  line-height: var(--hfl-bub-line); 
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  letter-spacing: .01em; pointer-events: none;

  opacity: 1; transform: translateX(-60vw);
  will-change: transform;
}

@media (min-width:769px){
  .hfl-peek-bubble{ max-width: calc(100% - 10px); }
}

.hfl-peek-bubble__text{ word-break: break-word; }

/* Tail (Zipfel) LINKS */
.hfl-peek-bubble::after{
  content: ""; position: absolute; left: -10px; bottom: 7px; width: 16px; height: 14px;
  background: linear-gradient(135deg, #007aff, #0a84ff);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  box-shadow: -2px 2px 5px rgba(0,0,0,0.25);
}

/* Slide-In Animation */
.hfl-peek-bubble.is-sliding{ animation: hfl-bubble-slide-in-left .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes hfl-bubble-slide-in-left{
  0%   { transform: translateX(-60vw); }
  100% { transform: translateX(0); }
}

/* ===== VOICE MODE (PNG BUBBLE) ===== */
.hfl-peek-bubble.is-voice{
  width: 286px; 
  max-width: 286px; 
  height: 50px;
  padding: 0; 
  background: transparent; 
  border: 0; 
  box-shadow: none; 
  border-radius: 0;
  justify-self: start;
  position: relative;
  pointer-events: auto;
}

/* Kein CSS-Tail im Voice-Mode */
.hfl-peek-bubble.is-voice::after{ display:none; }

/* Overlay exakt über dem PNG */
.hfl-peek-bubble.is-voice .hfl-peek-voice{
  position: absolute !important;
  inset: 0; 
  display: flex; 
  align-items: center;
  padding: 14px 10px 14px 18px;
  z-index: 3; 
  pointer-events: auto;
}

/* Inline-Fortschritt + Base/Dark fillwrap */
/* Z-Index 2 für PNG -> damit liegt es über dem Fill (Z=1) */
.hfl-voice-bubble-img{
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  display: block;
  position: relative; 
  z-index: 2;
}

/* Z-Index 1 für Fill -> damit liegt es HINTER dem PNG */
.hfl-voice-fillwrap{ 
  position:absolute; inset:0; z-index:1; pointer-events:none; 
}
.hfl-voice-fill-base,
.hfl-voice-fill-dark{
  height: 100%; 
  position: absolute; 
  top: 0; 
  border-radius: 6px;
}

/* Play/Pause Button */
.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;
}
.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;
}
.hfl-voice__btn.is-playing::before{ opacity: 0; }
.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;
}

/* Zeitangabe */
.hfl-voice__time{
  font-weight: 800; font-size: 14px; color: #fff; opacity: .95; white-space: nowrap;
  margin-left: auto; min-width: 3.6em; text-align: right; flex: 0 0 auto;
}

/* Im Voice-PNG-Modus: Standard-Progressbar ausblenden */
.hfl-peek-bubble.is-voice .hfl-voice__bar,
.hfl-peek-bubble.is-voice .hfl-voice__prog{
  display: none !important;
}

/* HTML5-Audioelement nie anzeigen */
.hfl-peek-voice .hfl-voice__el{
  display: none !important;
}


/* =========================================================
 * NEW GLASS CLOSE BAR & HALO (Phase 1 Style)
 * =======================================================*/

.hfl-peek-closebar{
  position: fixed !important;
  left: 50% !important;
  bottom: clamp(18px, 12vh, 40px) !important;
  transform: translateX(-50%) !important;
  z-index: 10000003 !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  padding: 14px 28px;
  border-radius: 9999px;

  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .2px;
  text-shadow: 
      0 2px 10px rgba(0,0,0,.35),
      0 0 14px rgba(255,255,255,.18);

  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);

  box-shadow:
      inset 0 1px 0 rgba(255,255,255,.35),
      inset 0 -1px 0 rgba(255,255,255,.12),
      0 10px 20px rgba(0,0,0,.18);

  -webkit-backdrop-filter: blur(10px) saturate(160%);
  backdrop-filter: blur(10px) saturate(160%);

  /* Fade-In nach Bild-Deblur */
  opacity: 0;
  visibility: hidden;
  animation: hfl-close-reveal 1.5s ease forwards;
  animation-delay: 3s;
  pointer-events: auto;
  cursor: pointer;
}

@keyframes hfl-close-reveal{
  0%   { opacity:0; visibility:hidden; }
  1%   { visibility:visible; }
  100% { opacity:1; visibility:visible; }
}

/* Alte Pseudo-Verzierungen sicher entfernen */
.hfl-peek-closebar::before,
.hfl-peek-closebar::after{
  content:none !important;
}

/* Falls innen ein <button> oder <a> liegt → erbt Stil komplett */
.hfl-peek-closebar button,
.hfl-peek-closebar a{
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-shadow: inherit;
}

/* Mobile: gleicher Smart-Bottom-Wert */
@media (max-width: 768px){
  .hfl-peek-closebar{
    bottom: clamp(18px, 12vh, 40px) !important;
  }
}

/* ✨ 200px Touch-Radius rund um den Close-Button */
.hfl-close-halo{
  position: fixed !important;
  left: 50% !important;
  bottom: clamp(18px, 12vh, 40px) !important;
  transform: translateX(-50%) !important;

  width: 400px;
  height: 400px;
  margin: 0; 
  padding: 0;
  border-radius: 9999px;

  z-index: 10000002 !important; /* unter Closebar */
  pointer-events: auto;
  background: transparent;

  /* erscheint synchron mit Button */
  opacity: 0;
  visibility: hidden;
  animation: hfl-close-reveal 1.5s ease forwards;
  animation-delay: 3s;

  -webkit-tap-highlight-color: transparent;
}


/* =========================================================
 * SHIMMER EFFECT
 * =======================================================*/

.luca-chat-promo-slot {
    position: relative !important;
    overflow: hidden !important;
}

.luca-chat-promo-slot::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.08) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 60;
    animation: none;
}

.luca-chat-promo-slot.luca-chat-promo-slot--visible::after {
    animation: shimmerEffect 10s infinite;
}

@keyframes shimmerEffect {
    0% { left: -150%; }
    50% { left: 150%; }
    100% { left: 150%; }
}