/* ═══════════════════════════════════════════════════════════════
   DIPPIN DOTS - Gallery Page
═══════════════════════════════════════════════════════════════ */

.gallery-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.gallery-header {
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: var(--velvet-mid);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.gallery-header-text { flex: 1; }
.gallery-header h1 { font-size: clamp(1.6rem, 5vw, 2.5rem); }
.gallery-header p  { margin-top: var(--sp-1); }

.gallery-container {
  flex: 1;
  padding: var(--sp-5);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Cards ── */
.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8) 0;
  color: var(--ink-dim);
}
.gallery-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(123,79,212,0.2);
  border-top-color: var(--amethyst);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
}
.gallery-empty-icon { font-size: 4rem; opacity: 0.3; }
.gallery-empty h2 { color: var(--ink-dim); }
.gallery-empty p { max-width: 320px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
}
.gallery-card {
  background: var(--velvet-mid);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(123,79,212,0.35);
  box-shadow: var(--glow-amethyst), var(--shadow-md);
}
.gallery-thumb {
  aspect-ratio: 4/3;
  background: var(--velvet);
  position: relative;
  overflow: hidden;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s var(--ease-out);
}
.gallery-card:hover .gallery-thumb img { transform: scale(1.04); }
.gallery-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 3rem;
  opacity: 0.15;
}
.gallery-pct {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: rgba(22,13,42,0.8);
  color: var(--ink-dim);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px var(--sp-2);
  border-radius: var(--r-md);
  backdrop-filter: blur(4px);
}
.gallery-pct.done { color: var(--emerald); }

.gallery-info { padding: var(--sp-3) var(--sp-4) var(--sp-2); }
.gallery-prompt {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--sp-2);
}
.gallery-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.gallery-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amethyst), var(--rose));
  border-radius: 2px;
  transition: width 0.5s var(--ease-out);
}

.gallery-actions {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
  margin-top: auto;
}
.gallery-actions .btn-small { flex: 1; justify-content: center; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .gallery-container { padding: var(--sp-4); }
}
