/* ==========================================================================
   Demo viva "event-guests" ("Envía tus invitaciones y controla la asistencia",
   /evento): agregar invitada -> WhatsApp -> confirma en su celular -> se reabre
   la lista y aparece confirmada.
   Markup: resources/views/web/partials/anim/event-guests.blade.php
   Estados en la raíz:
     data-modal     open | loading | (sin atributo = cerrado)
     data-focus     first                       (campo enfocado)
     data-added     Laura ya está en la lista · data-confirmed ya confirmó (al recargar)
     data-bubble    el mensaje llegó al chat · data-phone chat | invite
     data-inv-*     confirmación en la invitación (ver event-invite.css)
     data-cursor    puntero visible
   ========================================================================== */

.lla-evg {
  --lla-bg: #ffffff;
  --lla-surface: #f8f9fa;
  --lla-panel-bg: #f5f7fb;
  --lla-text: #1e2022;
  --lla-muted: #677788;
  --lla-border: #e7eaf3;
  --lla-border-2: #d0d7e2;
  --lla-primary: #377dff;
  --lla-primary-soft: rgba(55, 125, 255, .1);
  --lla-success: #198754;
  --lla-shadow: 0 32px 64px -24px rgba(22, 34, 58, .38), 0 10px 24px -10px rgba(22, 34, 58, .18);
  --lla-glow-a: rgba(55, 125, 255, .14);
  --lla-glow-b: rgba(25, 135, 84, .14);
  --lla-dot-r: #ff5f57;
  --lla-dot-y: #febc2e;
  --lla-dot-g: #28c840;
  --lla-bezel: #1d2129;
  --lla-bezel-edge: #3a404c;
  --lla-chat-bg: #eef1f6;
  --lla-cursor-fill: #1e2022;
  --lla-cursor-edge: #ffffff;
  --lla-cursor-ring: rgba(55, 125, 255, .55);
}

html[data-theme="dark"] .lla-evg {
  --lla-bezel-edge: #535b6a;
  --lla-glow-a: rgba(77, 159, 255, .12);
  --lla-glow-b: rgba(74, 217, 145, .1);
  --lla-shadow: 0 32px 64px -24px rgba(0, 0, 0, .8), 0 10px 24px -10px rgba(0, 0, 0, .55);
}

.lla-evg { max-width: 680px; margin-inline: auto; color: var(--lla-text); line-height: 1.3; text-align: left; }
.lla .lla-evg__stage { --lla-w: 680; --lla-h: 474; }
.lla-evg :where(b, small, strong, em, i) { margin: 0; font-size: inherit; font-style: normal; color: inherit; }
.lla-evg .bi::before { vertical-align: 0; }
.lla-evg__muted { color: var(--lla-muted); }
.lla-evg__green { color: var(--lla-success); }

.lla-evg__glow { position: absolute; border-radius: 50%; pointer-events: none; }
.lla-evg__glow--a { left: -40px; top: 0; width: 440px; height: 440px; background: radial-gradient(closest-side, var(--lla-glow-a), transparent); }
.lla-evg__glow--b { left: 380px; top: 40px; width: 360px; height: 420px; background: radial-gradient(closest-side, var(--lla-glow-b), transparent); }

/* ---------- Ventana ---------- */
.lla-evg__win { position: absolute; left: 0; top: 30px; width: 480px; height: 414px; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 14px; background: var(--lla-bg); box-shadow: var(--lla-shadow); }
.lla-evg__chrome { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--lla-border); background: var(--lla-surface); }
.lla-evg__dots { display: flex; flex: none; gap: 5px; }
.lla-evg__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--lla-dot-r); }
.lla-evg__dots i:nth-child(2) { background: var(--lla-dot-y); }
.lla-evg__dots i:nth-child(3) { background: var(--lla-dot-g); }
.lla-evg__url { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; padding: 3px 9px; border-radius: 6px; background: var(--lla-bg); color: var(--lla-muted); font-size: 10.5px; white-space: nowrap; }
.lla-evg__url > span { overflow: hidden; text-overflow: ellipsis; }
.lla-evg__url .bi { flex: none; font-size: 8.5px; color: var(--lla-success); }

.lla-evg__panel { position: relative; height: calc(100% - 32px); padding: 12px 40px 12px 12px; background: var(--lla-panel-bg); font-size: 10px; }
.lla-evg__card { overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(22, 34, 58, .1); }
.lla-evg__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--lla-border); }
.lla-evg__head b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.lla-evg__head b .bi { color: var(--lla-primary); }
.lla-evg__btn { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 4px; padding: 4px 9px; border: 1px solid var(--lla-primary); border-radius: 5px; background: var(--lla-primary); color: #fff; font-size: 9.5px; font-weight: 600; white-space: nowrap; transition: transform .15s var(--lla-ease); }
.lla-evg__btn.is-pressed { transform: scale(.94); }
.lla-evg__btn--outline { border-color: #6c757d; background: #fff; color: #6c757d; }
.lla-evg__btn--gray { border-color: #6c757d; background: #6c757d; }

.lla-evg__etr { display: grid; grid-template-columns: 2fr .8fr 1fr .8fr 1.2fr; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--lla-border); }
.lla-evg__etr--head { background: var(--lla-surface); color: var(--lla-muted); font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.lla-evg__end { text-align: right; }
.lla-evg__ev { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lla-evg__ev > .bi { display: flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 5px; background: var(--lla-surface); color: var(--lla-muted); }
/* Portada del evento (misma foto que la invitación) */
.lla-evg__ev-img { display: block; flex: none; width: 28px; height: 28px; border-radius: 5px; object-fit: cover; background: var(--lla-surface); }
.lla-evg__ev > span { display: flex; flex-direction: column; min-width: 0; }
.lla-evg__ev b { font-size: 10px; font-weight: 600; }
.lla-evg__ev small { overflow: hidden; color: var(--lla-muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

.lla-evg__badge { display: inline-block; padding: 2px 6px; border-radius: 4px; color: #fff; font-size: 8.5px; font-weight: 600; white-space: nowrap; }
.lla-evg__badge--ok { background: var(--lla-success); }
.lla-evg__badge--no { background: #dc3545; }
.lla-evg__badge--pend { background: #ffc107; color: #1e2022; }

.lla-evg__acts { display: flex; justify-content: flex-end; }
.lla-evg__acts .bi { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 19px; margin-left: -1px; border: 1px solid #6c757d; color: #6c757d; font-size: 9px; transition: transform .15s var(--lla-ease), background-color .2s var(--lla-ease), color .2s var(--lla-ease); }
.lla-evg__acts .bi:first-child { border-radius: 4px 0 0 4px; }
.lla-evg__acts .bi:last-child { border-radius: 0 4px 4px 0; }
.lla-evg__acts .lla-evg__a--primary { border-color: var(--lla-primary); color: var(--lla-primary); }
.lla-evg__acts .lla-evg__a--success { border-color: var(--lla-success); color: var(--lla-success); }
.lla-evg__acts .lla-evg__a--danger { border-color: #dc3545; color: #dc3545; }
.lla-evg__acts .bi.is-pressed { transform: scale(.86); background: var(--lla-success); color: #fff; }

/* Modal */
.lla-evg__backdrop { position: absolute; inset: 0; z-index: 4; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .3s var(--lla-ease); }
.lla-evg[data-modal] .lla-evg__backdrop { opacity: 1; }
.lla-evg__modal { position: absolute; top: 6px; left: 8px; right: 34px; bottom: 6px; z-index: 5; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .3s var(--lla-ease), transform .35s var(--lla-ease); }
.lla-evg[data-modal] .lla-evg__modal { opacity: 1; transform: none; }
.lla-evg__mhead { display: flex; flex: none; align-items: flex-start; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--lla-border); }
.lla-evg__mhead > span:first-child { display: flex; flex-direction: column; }
.lla-evg__mhead b { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.lla-evg__mhead b .bi { color: var(--lla-primary); }
.lla-evg__mhead small { color: var(--lla-muted); font-size: 9px; }
.lla-evg__x { color: var(--lla-muted); font-size: 16px; line-height: 1; }
.lla-evg__mbody { flex: 1; min-height: 0; overflow: hidden; }
.lla-evg__mfoot { display: flex; flex: none; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--lla-border); }
.lla-evg__loading { display: none; flex: 1; align-items: center; justify-content: center; gap: 6px; color: var(--lla-muted); }
.lla-evg__loading .lla-spinner { width: 12px; height: 12px; }
.lla-evg[data-modal="loading"] .lla-evg__loading { display: flex; }
.lla-evg[data-modal="loading"] .lla-evg__mbody { display: none; }

.lla-evg__stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--lla-border); }
.lla-evg__stats > span { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 5px; background: var(--lla-surface); text-align: center; }
.lla-evg__stats b { font-size: 14px; font-weight: 700; }
.lla-evg__stats small { color: var(--lla-muted); font-size: 7px; line-height: 1.15; }
.lla-evg__c-primary { color: var(--lla-primary); }
.lla-evg__c-secondary { color: #6c757d; }
.lla-evg__c-success { color: var(--lla-success); }
.lla-evg__c-danger { color: #dc3545; }
.lla-evg__c-warning { color: #ffc107; }
.lla-evg__stats b.is-bump { animation: lla-eg-bump .5s var(--lla-ease); }

.lla-evg__add { display: flex; align-items: flex-end; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--lla-border); background: var(--lla-surface); }
.lla-evg__add > span:not(.lla-evg__btn) { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.lla-evg__add > .lla-evg__add-sm { flex: 0 0 34px; }
.lla-evg__add small { font-size: 8px; }
.lla-evg__in { display: flex; align-items: center; height: 20px; padding: 0 5px; overflow: hidden; border: 1px solid var(--lla-border-2); border-radius: 4px; background: #fff; font-size: 9px; white-space: nowrap; transition: border-color .2s var(--lla-ease); }
.lla-evg[data-focus="first"] [data-ref="f-first"] { border-color: var(--lla-primary); box-shadow: 0 0 0 2px var(--lla-primary-soft); }
.lla-evg__btn--add { height: 20px; padding: 0 8px; }

.lla-evg__gtr { display: grid; grid-template-columns: 1.4fr 1.1fr .55fr .75fr .95fr 1fr; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--lla-border); font-size: 9px; }
.lla-evg__gtr b { font-weight: 600; }
.lla-evg__gtr--head { background: var(--lla-surface); color: var(--lla-muted); font-size: 8px; font-weight: 600; }
.lla-evg__c { text-align: center; justify-content: center; }
.lla-evg__gtr--new { display: none; }
.lla-evg[data-added] .lla-evg__gtr--new { display: grid; animation: lla-eg-arrive 2s var(--lla-ease) both; }
.lla-evg__conf { display: none; }
.lla-evg[data-confirmed] .lla-evg__pend { display: none; }
.lla-evg[data-confirmed] .lla-evg__conf { display: inline-block; }

/* ---------- Celular ---------- */
/* z-index 6: el celular queda por encima del fondo oscuro del modal (el velo no lo alcanza) */
.lla-evg__phone { position: absolute; left: 452px; top: 4px; z-index: 6; width: 226px; height: 466px; padding: 8px; border-radius: 36px; background: var(--lla-bezel); box-shadow: inset 0 0 0 1.5px var(--lla-bezel-edge), var(--lla-shadow); }
.lla-evg__screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 29px; background: #fff; font-size: 10px; }
.lla-evg__notch { position: absolute; top: 7px; left: 50%; z-index: 4; width: 64px; height: 16px; border-radius: 999px; background: var(--lla-bezel); transform: translateX(-50%); }
.lla-evg__content { position: absolute; inset: 0; }
.lla-evg__chat,
.lla-evg__invite { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 28px; transition: opacity .4s var(--lla-ease), transform .45s var(--lla-ease); }
.lla-evg__chat { background: var(--lla-chat-bg); }
.lla-evg__invite { background: #fff; opacity: 0; transform: translateX(30%); }
.lla-evg[data-phone="invite"] .lla-evg__chat { opacity: 0; transform: translateX(-30%); }
.lla-evg[data-phone="invite"] .lla-evg__invite { opacity: 1; transform: none; }

.lla-evg__chat-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--lla-border); }
.lla-evg__chat-top > span:last-child { display: flex; flex-direction: column; }
.lla-evg__chat-top b { font-size: 11px; font-weight: 700; }
.lla-evg__chat-top small { color: var(--lla-muted); font-size: 8.5px; }
.lla-evg__chat-av { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #ec4899; color: #fff; font-size: 9.5px; font-weight: 700; }
.lla-evg__chat-body { flex: 1; padding: 14px 10px; }
.lla-evg__bubble { display: flex; flex-direction: column; gap: 6px; max-width: 92%; padding: 8px; border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); opacity: 0; transform: translateY(10px) scale(.96); transform-origin: top left; transition: opacity .35s var(--lla-ease), transform .4s var(--lla-ease); }
.lla-evg[data-bubble] .lla-evg__bubble { opacity: 1; transform: none; }
.lla-evg__wa b { font-weight: 700; }
.lla-evg__preview { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-left: 3px solid #ec4899; border-radius: 6px; background: var(--lla-surface); transition: background-color .2s var(--lla-ease); }
.lla-evg__preview-img { display: block; flex: none; width: 40px; height: 40px; border-radius: 5px; object-fit: cover; background: #e5e7eb; }
.lla-evg__preview-txt { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.lla-evg__preview.is-pressed { background: #fce7f3; }
.lla-evg__preview b { font-family: 'Playfair Display', Georgia, serif; font-size: 11px; font-weight: 700; }
.lla-evg__preview small { color: var(--lla-muted); font-size: 9px; }
.lla-evg__preview em { display: flex; align-items: center; gap: 2px; overflow: hidden; color: var(--lla-primary); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.lla-evg__chat-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px 18px; background: #fff; }
.lla-evg__chat-input span { flex: 1; height: 26px; border-radius: 999px; background: var(--lla-chat-bg); }
.lla-evg__chat-input .bi { color: #ec4899; font-size: 15px; }

.lla-evg__urlbar { display: flex; flex: none; align-items: center; justify-content: center; gap: 4px; margin: 0 10px 4px; padding: 3px 0; border-radius: 8px; background: #eef0f3; color: var(--lla-muted); font-size: 8px; }
.lla-evg__urlbar .bi { color: var(--lla-success); font-size: 7px; }
.lla-evg__vp { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.lla-evg__scroll { transition: transform 1s var(--lla-ease); }
.lla-evg .lla-inv { --inv-p: #ec4899; --inv-p2: #f472b6; --inv-soft: #fdf2f8; --inv-font: 'Playfair Display', Georgia, serif; }

/* ---------- Puntero ---------- */
.lla-evg__cursor { position: absolute; top: 0; left: 0; z-index: 10; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(240px, 440px); transition: transform .6s var(--lla-ease), opacity .3s var(--lla-ease); will-change: transform, opacity; }
.lla-evg[data-cursor] .lla-evg__cursor { opacity: 1; }
.lla-evg__cursor svg { position: relative; display: block; width: 22px; height: 22px; fill: var(--lla-cursor-fill); stroke: var(--lla-cursor-edge); stroke-width: 1.4; stroke-linejoin: round; }
.lla-evg__cursor-ring { position: absolute; left: -10px; top: -12px; width: 28px; height: 28px; border: 2px solid var(--lla-cursor-ring); border-radius: 50%; opacity: 0; }
.lla-evg__cursor.is-tap svg { animation: lla-eg-press .3s var(--lla-ease); }
.lla-evg__cursor.is-tap .lla-evg__cursor-ring { animation: lla-eg-ripple .5s var(--lla-ease); }

@container (max-width: 479px) {
  .lla .lla-evg__stage { --lla-w: 480; --lla-h: 900; }
  .lla-evg__win { top: 0; }
  .lla-evg__panel { padding-right: 12px; }
  .lla-evg__modal { right: 8px; }
  .lla-evg__phone { left: 127px; top: 426px; }
  .lla-evg__glow--b { left: 60px; top: 440px; }
}

@keyframes lla-eg-arrive {
  0% { transform: translateY(-8px); background-color: #fff7d6; }
  15% { transform: none; }
  70% { background-color: #fff7d6; }
  100% { background-color: transparent; }
}
@keyframes lla-eg-bump { 50% { transform: scale(1.25); } }
@keyframes lla-eg-press { 50% { transform: scale(.85); } }
@keyframes lla-eg-ripple {
  0% { opacity: .9; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
