/* Lava Mirror Presenter - frontend.css */

.lmp-widget-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  isolation: isolate;
}

.lmp-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: crosshair;
}

/* Spark / bubble overlay canvas */
.lmp-spark-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  display: block;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.lmp-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.lmp-loading-ember {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.lmp-loading-ember span {
  width: 12px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #ffcc00 0%, #ff4400 60%, #aa1100 100%);
  box-shadow: 0 0 12px #ff4400, 0 0 24px #ff220080;
  animation: lmp-flicker 0.8s ease-in-out infinite alternate;
}
.lmp-loading-ember span:nth-child(1) { height: 28px; animation-delay: 0s;    animation-duration: 0.7s; }
.lmp-loading-ember span:nth-child(2) { height: 40px; animation-delay: 0.15s; animation-duration: 0.9s; }
.lmp-loading-ember span:nth-child(3) { height: 32px; animation-delay: 0.3s;  animation-duration: 0.75s; }
.lmp-loading-ember span:nth-child(4) { height: 22px; animation-delay: 0.45s; animation-duration: 0.85s; }

@keyframes lmp-flicker {
  0%   { transform: scaleX(1)    scaleY(1)    translateY(0); opacity: 1; }
  50%  { transform: scaleX(0.85) scaleY(1.12) translateY(-4px); opacity: 0.85; }
  100% { transform: scaleX(1.1)  scaleY(0.92) translateY(2px); opacity: 0.9; }
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lmp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.lmp-lightbox--open {
  opacity: 1;
  pointer-events: auto;
}

.lmp-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 2, 0, 0.93);
  backdrop-filter: blur(6px);
}

.lmp-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: translateY(0) scale(1);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lmp-lightbox:not(.lmp-lightbox--open) .lmp-lightbox-content {
  transform: translateY(40px) scale(0.95);
}

.lmp-lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 80, 0, 0.3),
    0 0 40px rgba(255, 60, 0, 0.3),
    0 24px 80px rgba(0, 0, 0, 0.9);
}

.lmp-lightbox-close {
  position: absolute;
  top: -44px;
  right: -8px;
  background: rgba(180, 40, 0, 0.6);
  border: 1px solid rgba(255, 100, 0, 0.5);
  color: #ffcc99;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
  line-height: 1;
}
.lmp-lightbox-close:hover {
  background: rgba(255, 60, 0, 0.8);
  transform: rotate(90deg);
}

.lmp-lightbox-caption {
  text-align: center;
  color: rgba(255, 200, 150, 0.9);
  max-width: 600px;
  padding: 0 16px;
}
.lmp-lightbox-title {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  margin: 0 0 6px;
  color: #ffcc88;
  text-shadow: 0 0 20px #ff440080;
}
.lmp-lightbox-desc {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  opacity: 0.75;
  margin: 0;
  line-height: 1.55;
}

/* ── Fallback ─────────────────────────────────────────────────────────────── */
.lmp-fallback { padding: 24px; color: rgba(255,180,100,0.8); }
.lmp-fallback-msg { text-align: center; font-size: 0.9rem; opacity: 0.6; margin-bottom: 20px; }
.lmp-fallback-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 12px; }
.lmp-fallback-item { margin: 0; border-radius: 4px; overflow: hidden; background: rgba(80,20,0,0.3); }
.lmp-fallback-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.lmp-fallback-item figcaption { padding: 8px 10px; font-size: 0.8rem; color: rgba(255,180,100,0.7); }
.lmp-fallback-item figcaption strong { display: block; color: #ffaa66; margin-bottom: 2px; }

@media (max-width: 768px) {
  .lmp-lightbox-content { max-width: 95vw; }
  .lmp-lightbox-img { max-height: 60vh; }
  .lmp-lightbox-close { top: -46px; right: 0; }
}
