/**
 * Fluid Wave Gallery 98 — Styles
 * Text Domain: fluid-wave-gallery-98
 */

/* ── Wrapper ── */
.fwg98-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 600px;           /* explicit pixel height — Three.js reads offsetHeight */
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  background-color: #0a1520;
}

@media (max-width: 768px) {
  .fwg98-wrapper { height: 420px; }
}
@media (max-width: 480px) {
  .fwg98-wrapper { height: 300px; }
}

/* ── Canvas: Three.js sets width/height attributes directly; CSS just fills space ── */
.fwg98-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  /* width/height come from renderer.setSize() — do NOT override with CSS 100% */
  cursor: grab;
  touch-action: none;
  z-index: 2;
}
.fwg98-canvas:active {
  cursor: grabbing;
}

/* ── Loading overlay ── */
.fwg98-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1520 0%, #0d2035 100%);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.fwg98-loading-text {
  color: rgba(100, 200, 255, 0.85);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(0.8rem, 2vw, 1rem);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.fwg98-loading-wave {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #00aaff, transparent);
  background-size: 200% 100%;
  animation: fwg98-wave-scan 1.4s ease-in-out infinite;
}

@keyframes fwg98-wave-scan {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Placeholder (no images) ── */
.fwg98-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #0a1520 0%, #0d2035 100%);
  color: rgba(100, 180, 220, 0.7);
  font-family: system-ui, -apple-system, sans-serif;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
}

.fwg98-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
  animation: fwg98-bob 2.4s ease-in-out infinite;
}

@keyframes fwg98-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.fwg98-placeholder p {
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 260px;
  opacity: 0.75;
  margin: 0;
}

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

.fwg98-lightbox:not([hidden]) {
  pointer-events: auto;
}

.fwg98-lightbox--open {
  opacity: 1;
}

.fwg98-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 22, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.fwg98-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fwg98-lightbox--open .fwg98-lightbox-inner {
  transform: scale(1);
}

.fwg98-lightbox-media {
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 170, 255, 0.15);
  cursor: pointer;
}

.fwg98-lightbox-media img,
.fwg98-lightbox-media video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.fwg98-lightbox-caption {
  color: rgba(200, 230, 255, 0.8);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
  padding: 0 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.fwg98-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(0, 100, 180, 0.4);
  border: 1px solid rgba(0, 170, 255, 0.3);
  color: rgba(200, 230, 255, 0.9);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.15s;
}

.fwg98-lightbox-close:hover {
  background: rgba(0, 140, 220, 0.6);
  transform: scale(1.05);
}

/* ── Gyro overlay ── */
.fwg98-gyro-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
}

.fwg98-gyro-btn {
  background: rgba(0, 80, 160, 0.7);
  border: 1px solid rgba(0, 170, 255, 0.4);
  color: rgba(200, 230, 255, 0.9);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s;
}

.fwg98-gyro-btn:hover {
  background: rgba(0, 120, 200, 0.85);
}

/* ── Editor preview placeholder ── */
.fwg98-editor-preview {
  display: flex;
  align-items: stretch;
  min-height: 200px;
}

.fwg98-editor-thumb {
  width: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #0a1520 0%, #0d2f50 50%, #0a1520 100%);
  background-size: 200% 200%;
  animation: fwg98-editor-shift 4s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

@keyframes fwg98-editor-shift {
  0%, 100% { background-position:   0% 50%; }
  50%       { background-position: 100% 50%; }
}

.fwg98-editor-wave-anim {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 18px,
    rgba(0, 170, 255, 0.06) 18px,
    rgba(0, 170, 255, 0.06) 20px
  );
  animation: fwg98-wave-scroll 3s linear infinite;
}

@keyframes fwg98-wave-scroll {
  from { transform: translateY(0);    }
  to   { transform: translateY(20px); }
}

.fwg98-editor-label {
  position: relative;
  z-index: 1;
  color: rgba(150, 210, 255, 0.9);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  margin: 0 0 6px;
}

.fwg98-editor-sub {
  position: relative;
  z-index: 1;
  color: rgba(100, 170, 220, 0.7);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  margin: 0;
  text-align: center;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .fwg98-canvas { display: none; }
  .fwg98-placeholder-icon,
  .fwg98-loading-wave,
  .fwg98-editor-thumb,
  .fwg98-editor-wave-anim { animation: none; }
}
