/* ═══════════════════════════════════════════════════════════════
   CrystalShard10  v2.0  –  Diamond Mosaic 10  |  Frontend Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Canvas wrapper ────────────────────────────────────────────── */
.dm10-canvas-wrap {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background: #000;
  outline: none;
}

.dm10-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Loader ────────────────────────────────────────────────────── */
.dm10-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.6);
  transition: opacity .4s ease;
  z-index: 10;
  pointer-events: none;
}
.dm10-loader-inner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dm10-spin .8s linear infinite;
}
@keyframes dm10-spin { to { transform: rotate(360deg); } }

/* ── Caption ───────────────────────────────────────────────────── */
.dm10-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 20px 14px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  transform: translateY(4px);
  pointer-events: none;
  z-index: 5;
}
.dm10-caption-wrap:hover .dm10-caption,
.dm10-caption[style*="opacity: 1"],
.dm10-caption.dm10-caption--visible {
  transform: translateY(0);
}
.dm10-caption-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.dm10-caption-sub {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,.75);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── Navigation arrows ─────────────────────────────────────────── */
.dm10-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1;
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0.7;
}
.dm10-arrow:hover,
.dm10-arrow:focus {
  background: rgba(0,0,0,.6);
  opacity: 1;
  outline: none;
}
.dm10-arrow--prev { left: 14px; }
.dm10-arrow--next { right: 14px; }
.dm10-arrow:active { transform: translateY(-50%) scale(0.92); }

/* ── Navigation dots ───────────────────────────────────────────── */
.dm10-dots {
  position: absolute;
  bottom: 58px;     /* above caption */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 6;
}
/* Push dots above caption when caption is empty */
.dm10-caption[style*="opacity: 0"] ~ .dm10-dots,
.dm10-dots:last-of-type {
  bottom: 14px;
}
.dm10-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .25s, transform .25s;
}
.dm10-dot.dm10-dot--active {
  background: #fff;
  transform: scale(1.45);
}
.dm10-dot:hover { background: rgba(255,255,255,.75); }
.dm10-dot:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }

/* ── Progress bar ──────────────────────────────────────────────── */
.dm10-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.12);
  z-index: 7;
}
.dm10-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,.65);
  transition: none;
}

/* ── Lightbox ──────────────────────────────────────────────────── */
.dm10-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.dm10-lightbox.dm10-lb--active {
  display: flex;
  animation: dm10-lb-bg .35s ease forwards;
}
@keyframes dm10-lb-bg {
  from { background: rgba(0,0,0,0); }
  to   { background: rgba(0,0,0,.88); }
}
.dm10-lb-inner {
  max-width: 90vw; max-height: 90vh;
  animation: dm10-lb-scale .4s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes dm10-lb-scale {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.dm10-lb-img {
  display: block;
  max-width: 100%; max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 120px rgba(180,220,255,.12);
  animation: dm10-brilliance .7s ease .1s both;
}
@keyframes dm10-brilliance {
  0%   { filter: brightness(2.2) saturate(1.5); }
  100% { filter: brightness(1)   saturate(1);   }
}
.dm10-lb-close {
  position: fixed;
  top: 16px; right: 16px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12);
  color: #fff; font-size: 18px;
  border: none; border-radius: 50%;
  cursor: pointer;
  transition: background .2s, transform .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
}
.dm10-lb-close:hover, .dm10-lb-close:focus {
  background: rgba(255,255,255,.25);
  transform: scale(1.1);
  outline: none;
}

/* ── Scroll lock ───────────────────────────────────────────────── */
.dm10-body-lock { overflow: hidden; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dm10-canvas-wrap { height: 380px; cursor: default; }
}
@media (max-width: 767px) {
  .dm10-canvas-wrap { height: 260px; }
  .dm10-arrow { width: 36px; height: 36px; font-size: 22px; }
  .dm10-arrow--prev { left: 8px; }
  .dm10-arrow--next { right: 8px; }
  .dm10-caption { padding: 10px 14px 10px; }
  .dm10-caption-title { font-size: 0.9rem; }
  .dm10-caption-sub { font-size: 0.75rem; }
  .dm10-dots { bottom: 48px; gap: 6px; }
  .dm10-dot { width: 7px; height: 7px; }
  .dm10-lb-inner { max-width: 96vw; }
  .dm10-lb-close { top: 8px; right: 8px; }
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dm10-loader-inner { animation: none; border-color: rgba(255,255,255,.4); }
  .dm10-lb-inner, .dm10-lb-img { animation: none; }
  .dm10-caption { transition: none; }
  .dm10-arrow, .dm10-dot { transition: none; }
}
