/* ==========================================================================
   Demo viva "event-design" ("Crea tu evento a tu estilo", /evento): Diseño y
   estilo -> paleta Rosa + Playfair Display -> Guardar -> la invitación cambia.
   Markup: resources/views/web/partials/anim/event-design.blade.php
   Estados en la raíz:
     data-pal      neutral | pink  (paleta marcada)
     data-list     lista de fuentes abierta · data-font fuente Playfair elegida
     data-saving   Guardar con spinner · data-toast toastr "Guardado"
     data-reload   la invitación se recarga · data-applied ya con Rosa + Playfair
     data-cursor   puntero visible
   ========================================================================== */

.lla-evd {
  --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-toast: #51a351;
  --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(236, 72, 153, .16);
  --lla-dot-r: #ff5f57;
  --lla-dot-y: #febc2e;
  --lla-dot-g: #28c840;
  --lla-bezel: #1d2129;
  --lla-bezel-edge: #3a404c;
  --lla-cursor-fill: #1e2022;
  --lla-cursor-edge: #ffffff;
  --lla-cursor-ring: rgba(55, 125, 255, .55);
}

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

.lla-evd { max-width: 680px; margin-inline: auto; color: var(--lla-text); line-height: 1.3; text-align: left; }
.lla .lla-evd__stage { --lla-w: 680; --lla-h: 470; }
.lla-evd :where(b, small, strong, em, i, p) { margin: 0; font-size: inherit; font-style: normal; color: inherit; }
.lla-evd .bi::before { vertical-align: 0; }
.lla-evd__muted { color: var(--lla-muted); }

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

/* ---------- Ventana ---------- */
.lla-evd__win { position: absolute; left: 0; top: 18px; width: 474px; height: 432px; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 14px; background: var(--lla-bg); box-shadow: var(--lla-shadow); }
.lla-evd__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-evd__dots { display: flex; flex: none; gap: 5px; }
.lla-evd__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--lla-dot-r); }
.lla-evd__dots i:nth-child(2) { background: var(--lla-dot-y); }
.lla-evd__dots i:nth-child(3) { background: var(--lla-dot-g); }
.lla-evd__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-evd__url > span { overflow: hidden; text-overflow: ellipsis; }
.lla-evd__url .bi { flex: none; font-size: 8.5px; color: var(--lla-success); }

.lla-evd__body { position: relative; display: flex; flex-direction: column; gap: 9px; height: calc(100% - 32px); padding: 12px 36px 12px 12px; background: var(--lla-panel-bg); font-size: 10.5px; }
.lla-evd__card { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(22, 34, 58, .1); }
.lla-evd__head { flex-direction: row; align-items: center; justify-content: space-between; }
.lla-evd__head > span:first-child { display: flex; flex-direction: column; }
.lla-evd__head b { font-size: 13.5px; font-weight: 700; }
.lla-evd__head small { color: var(--lla-muted); font-size: 9.5px; }
.lla-evd__btn { position: relative; display: inline-flex; flex: none; align-items: center; padding: 5px 10px; border-radius: 6px; background: var(--lla-primary); color: #fff; font-size: 10px; font-weight: 600; transition: transform .15s var(--lla-ease); }
.lla-evd__btn.is-pressed { transform: scale(.94); }
.lla-evd__save-a, .lla-evd__save-b { display: inline-flex; align-items: center; gap: 4px; }
.lla-evd__save-b { display: none; }
.lla-evd__save-b .lla-spinner { width: 10px; height: 10px; }
.lla-evd[data-saving] .lla-evd__save-a { display: none; }
.lla-evd[data-saving] .lla-evd__save-b { display: inline-flex; }

.lla-evd__h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.lla-evd__h .bi { color: var(--lla-primary); }

.lla-evd__palettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 3px; }
.lla-evd__pal { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 1px solid #6c757d55; border-radius: 6px; transition: border-color .2s var(--lla-ease), box-shadow .2s var(--lla-ease), transform .15s var(--lla-ease); }
.lla-evd__pal.is-pressed { transform: scale(.95); }
.lla-evd__sw { display: flex; gap: 3px; }
.lla-evd__sw i { width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 3px; }
.lla-evd__pal b { font-size: 9.5px; font-weight: 600; }
.lla-evd[data-pal="neutral"] .lla-evd__pal--neutral,
.lla-evd[data-pal="pink"] .lla-evd__pal--pink { border-color: var(--lla-primary); box-shadow: 0 2px 6px rgba(55, 125, 255, .2); }

.lla-evd__row { display: flex; align-items: center; gap: 10px; }
.lla-evd__row > small { width: 80px; flex: none; color: var(--lla-muted); font-size: 10px; }
.lla-evd__font-wrap { position: relative; flex: 1; }
.lla-evd__select { display: flex; align-items: center; justify-content: space-between; height: 26px; padding: 0 9px; border: 1px solid var(--lla-border-2); border-radius: 6px; font-size: 10.5px; transition: border-color .2s var(--lla-ease), transform .15s var(--lla-ease); }
.lla-evd__select .bi { font-size: 8px; color: var(--lla-muted); }
.lla-evd__select.is-pressed { transform: scale(.98); border-color: var(--lla-primary); }
.lla-evd__font-b { display: none; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; }
.lla-evd[data-font] .lla-evd__font-a { display: none; }
.lla-evd[data-font] .lla-evd__font-b { display: inline; }
.lla-evd__list { position: absolute; top: 28px; left: 0; right: 0; z-index: 3; display: none; flex-direction: column; padding: 3px 0; border: 1px solid var(--lla-border-2); border-radius: 6px; background: #fff; box-shadow: 0 8px 20px rgba(22, 34, 58, .18); }
.lla-evd[data-list] .lla-evd__list { display: flex; }
.lla-evd__list span { padding: 4px 9px; font-size: 11px; transition: background-color .15s var(--lla-ease); }
.lla-evd__list span.is-pressed,
.lla-evd__list span:hover { background: var(--lla-primary-soft); }
.lla-evd__pangram { margin-top: 2px !important; color: var(--lla-muted); font-family: Inter, system-ui, sans-serif; font-size: 13px; line-height: 1.35; transition: font-family .2s; }
.lla-evd[data-font] .lla-evd__pangram { font-family: 'Playfair Display', Georgia, serif; }
.lla-evd__scale { display: inline-flex; }
.lla-evd__scale i { padding: 3px 8px; border: 1px solid #6c757d; color: #6c757d; font-size: 9.5px; }
.lla-evd__scale i:first-child { border-radius: 5px 0 0 5px; }
.lla-evd__scale i:last-child { border-radius: 0 5px 5px 0; }
.lla-evd__scale i + i { margin-left: -1px; }
.lla-evd__scale .is-on { border-color: var(--lla-primary); background: var(--lla-primary); color: #fff; }

.lla-evd__toast { position: absolute; top: 10px; right: 40px; z-index: 4; display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 4px; background: var(--lla-toast); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); color: #fff; font-size: 11px; font-weight: 600; opacity: 0; transform: translateX(16px); transition: opacity .3s var(--lla-ease), transform .3s var(--lla-ease); }
.lla-evd[data-toast] .lla-evd__toast { opacity: 1; transform: none; }

/* ---------- Celular con la invitación ---------- */
.lla-evd__phone { position: absolute; left: 452px; top: 2px; z-index: 2; 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-evd__screen { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; border-radius: 29px; background: #fff; }
.lla-evd__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-evd__urlbar { display: flex; flex: none; align-items: center; justify-content: center; gap: 4px; margin: 30px 10px 4px; padding: 3px 0; border-radius: 8px; background: #eef0f3; color: var(--lla-muted); font-size: 8px; }
.lla-evd__urlbar > .bi { color: var(--lla-success); font-size: 7px; }
.lla-evd__reload { display: inline-flex; margin-right: 2px; }
.lla-evd[data-reload] .lla-evd__reload { animation: lla-ed-spin .7s linear infinite; }
.lla-evd__vp { position: relative; flex: 1; min-height: 0; overflow: hidden; transition: opacity .3s var(--lla-ease); }
.lla-evd[data-reload] .lla-evd__vp { opacity: .15; }

/* Tema de la invitación: Neutro + Inter antes de guardar; Rosa + Playfair después */
.lla-evd { --inv-p: #374151; --inv-p2: #6b7280; --inv-soft: #f9fafb; --inv-font: Inter, system-ui, sans-serif; }
.lla-evd[data-applied] .lla-inv { --inv-p: #ec4899; --inv-p2: #f472b6; --inv-soft: #fdf2f8; --inv-font: 'Playfair Display', Georgia, serif; }

/* ---------- Puntero ---------- */
.lla-evd__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-evd[data-cursor] .lla-evd__cursor { opacity: 1; }
.lla-evd__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-evd__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-evd__cursor.is-tap svg { animation: lla-ed-press .3s var(--lla-ease); }
.lla-evd__cursor.is-tap .lla-evd__cursor-ring { animation: lla-ed-ripple .5s var(--lla-ease); }

@container (max-width: 479px) {
  .lla .lla-evd__stage { --lla-w: 440; --lla-h: 900; }
  .lla-evd__win { top: 0; width: 440px; }
  .lla-evd__body { padding-right: 12px; }
  .lla-evd__toast { right: 12px; }
  .lla-evd__phone { left: 107px; top: 442px; }
  .lla-evd__glow--b { left: 40px; top: 440px; }
}

@keyframes lla-ed-spin { to { transform: rotate(360deg); } }
@keyframes lla-ed-press { 50% { transform: scale(.85); } }
@keyframes lla-ed-ripple {
  0% { opacity: .9; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
