/*
 * File: vendor/stamina-bundles/studio-bundle/Resources/assets/css/studio-live.css
 * Purpose: « Votre IA travaille » : panneau du journal, remplacement en fondu de l'appli, entrées de menu « nouveau ».
 */

/* La scène : l'appli (iframe) et, le temps d'un remplacement, sa nouvelle version posée par-dessus. */
.studio-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.studio-stage .studio-frame.live-frame-next { position: absolute; inset: 0; width: 100%; opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1); }
.studio-stage .studio-frame.live-frame-next.is-in { opacity: 1; transform: none; }
.studio-stage.is-flash::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--color-primary-500); animation: live-flash 1.4s ease-out forwards; }
@keyframes live-flash { from { opacity: 1; } to { opacity: 0; } }

/* Fine barre en haut de la scène pendant que la nouvelle version se charge. */
.live-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; opacity: 0; transition: opacity .25s; pointer-events: none; }
.live-progress.is-on { opacity: 1; }
.live-progress::before { content: ""; position: absolute; inset: 0 auto 0 -40%; width: 40%; border-radius: var(--radius-pill); background: linear-gradient(90deg, transparent, var(--color-primary-500), transparent); animation: live-sweep 1.1s ease-in-out infinite; }
@keyframes live-sweep { to { left: 100%; } }

.live-toast { position: absolute; top: .875rem; right: 1rem; z-index: 5; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .875rem .5rem .625rem; border-radius: var(--radius-pill); background: rgb(29 21 49 / .94); color: #fff; font-size: .8125rem; font-weight: 600; box-shadow: 0 14px 30px -12px rgb(29 21 49 / .55); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .3s, transform .3s cubic-bezier(.2, .8, .2, 1); }
.live-toast::before { content: "\f00c"; font-family: "Font Awesome 6 Pro", "Font Awesome 5 Pro"; font-weight: 900; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--color-primary-500); font-size: .625rem; }
.live-toast.is-on { opacity: 1; transform: none; }

/*
 * Le journal : panneau latéral droit du layout du ui-bundle (bloc aside_right), même fond et mêmes teintes que le menu
 * de gauche. La largeur, le repli et la pastille viennent du layout ; ici seulement le contenu.
 */
.live-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; color: var(--color-sidebar-ink); }
.live-panel.has-news .live-orb { animation: live-news 1.2s ease-out; }
@keyframes live-news { 0% { box-shadow: 0 0 0 0 rgb(165 180 252 / .55); } 100% { box-shadow: 0 0 0 .75rem rgb(165 180 252 / 0); } }

.live-panel-head { display: flex; align-items: center; gap: .75rem; min-height: 2.5rem; padding: 0 .25rem .875rem; }
.live-orb { position: relative; display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--color-sidebar-hover); color: var(--color-sidebar-soft); }
.live-panel.is-working .live-orb, .live-rail.is-working .live-orb { background: var(--color-primary-500); color: #fff; }
.live-panel.is-working .live-orb::after, .live-rail.is-working .live-orb::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--color-primary-500); opacity: 0; animation: live-ring 1.6s ease-out infinite; }
.live-panel.is-working .live-orb i, .live-rail.is-working .live-orb i { animation: live-twinkle 1.6s ease-in-out infinite; }
@keyframes live-ring { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes live-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
.live-panel-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.live-panel-title strong { color: #fff; font-size: .9375rem; }
.live-panel.is-working .live-panel-title strong::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: live-dots 1.2s steps(4, end) infinite; }
@keyframes live-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.live-panel-title small { overflow: hidden; color: var(--color-sidebar-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }

.live-feed { flex: 1; min-height: 0; margin: 0; padding: 0 .25rem; overflow-y: auto; list-style: none; border-top: 1px solid var(--color-sidebar-hover); }
.live-event { --tone: var(--color-sidebar-muted); --tone-soft: var(--color-sidebar-hover); display: flex; gap: .75rem; padding: .75rem 0; }
.live-event + .live-event { border-top: 1px dashed var(--color-sidebar-hover); }
.live-event.is-new { animation: live-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.live-event.is-new .live-event-icon { animation: live-pop .6s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes live-in { from { opacity: 0; transform: translateY(-14px) scale(.97); background: var(--tone-soft); } 60% { background: var(--tone-soft); } to { opacity: 1; transform: none; background: transparent; } }
@keyframes live-pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
.live-event-icon { display: inline-grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--tone-soft); color: var(--tone); font-size: .75rem; }
.live-event-body { min-width: 0; flex: 1; }
.live-event-text { margin: 0; color: #fff; font-size: .8125rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.live-event[data-kind="status"] .live-event-text { font-weight: 500; font-style: italic; }
.live-event[data-kind="status"] .live-event-text::before { content: "« "; }
.live-event[data-kind="status"] .live-event-text::after { content: " »"; }
.live-event-note { margin: .1875rem 0 0; color: var(--color-sidebar-soft); font-size: .75rem; line-height: 1.35; }
.live-event time { display: block; margin-top: .1875rem; color: var(--color-sidebar-muted); font-size: .6875rem; }
.live-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3125rem; }
.live-chip { padding: .0625rem .5rem; border-radius: var(--radius-pill); background: var(--color-sidebar-hover); color: var(--color-sidebar-soft); font-family: ui-monospace, monospace; font-size: .6875rem; }
.live-chip.is-new { background: var(--color-primary-500); color: #fff; font-family: inherit; font-weight: 700; letter-spacing: .02em; }

/* Teintes éclaircies : elles se lisent sur le fond nuit du panneau. */
.live-tone-info { --tone: #7db3ff; --tone-soft: rgb(96 165 250 / .18); }
.live-tone-success { --tone: #4fdcaa; --tone-soft: rgb(52 211 153 / .17); }
.live-tone-warning { --tone: #f9bf4d; --tone-soft: rgb(251 191 36 / .17); }
.live-tone-teal { --tone: #44d9cb; --tone-soft: rgb(45 212 191 / .17); }
.live-tone-violet { --tone: #b6a1fb; --tone-soft: rgb(167 139 250 / .2); }
.live-tone-primary { --tone: #b3b9ff; --tone-soft: rgb(129 140 248 / .2); }

.live-panel-foot { display: flex; align-items: center; gap: .5rem; padding: .75rem .25rem .125rem; border-top: 1px solid var(--color-sidebar-hover); color: var(--color-sidebar-muted); font-size: .75rem; }
.live-panel.is-working .live-panel-foot i { animation: live-spin 1.2s linear infinite; }
@keyframes live-spin { to { transform: rotate(360deg); } }

/* Rail du panneau replié : l'orbe de l'IA (qui pulse quand elle travaille) et son nom à la verticale ; un clic rouvre. */
.live-rail { display: flex; flex-direction: column; align-items: center; gap: .75rem; width: 100%; padding: 0; border: 0; background: transparent; color: var(--color-sidebar-soft); cursor: pointer; }
.live-rail:hover { color: #fff; }
.live-rail:hover .live-orb { background: rgb(255 255 255 / .14); }
.live-rail.is-working .live-orb { background: var(--color-primary-500); }
.live-rail.has-news .live-orb { animation: live-news 1.2s ease-out; }
.live-rail-label { writing-mode: vertical-rl; font-size: .75rem; font-weight: 600; letter-spacing: .06em; }

/* Entrées de menu ajoutées par l'IA depuis la dernière visite. */
#stamina-ui-nav a[data-live-new] { position: relative; }
#stamina-ui-nav a[data-live-new]::after { content: "nouveau"; margin-left: auto; padding: .0625rem .5rem; border-radius: var(--radius-pill); background: var(--color-primary-500); color: #fff; font-size: .625rem; font-weight: 700; letter-spacing: .02em; }
#stamina-ui-nav a[data-live-new="pop"] { animation: live-menu-pop 1.8s ease-out; }
#stamina-ui-nav a[data-live-new="pop"]::after { animation: live-pop .6s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes live-menu-pop { 0% { background: rgb(99 102 241 / .55); transform: translateX(-10px); opacity: 0; } 25% { transform: none; opacity: 1; } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) { .live-event.is-new, .live-event.is-new .live-event-icon, #stamina-ui-nav a[data-live-new] { animation: none; } .studio-stage .studio-frame.live-frame-next { transition: opacity .2s; transform: none; } }

