/* Gallery page for "My Works". */
.gallery-view {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  overflow-y: auto;
  background: #0a0a0f;
  color: #fff;
}

.gallery-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(16px);
}

.gallery-title { font-size: 22px; font-weight: 800; }
.gallery-subtitle { margin-top: 4px; color: rgba(255,255,255,0.42); font-size: 13px; }
.gallery-actions { display: flex; align-items: center; gap: 10px; }
.gallery-action-btn,
.gallery-close-btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(168,85,247,0.28);
  background: rgba(168,85,247,0.14);
  color: #e9ddff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.gallery-close-btn { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.78); }

.gallery-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}
.gallery-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.68);
  cursor: pointer;
}
.gallery-filter strong { color: #fff; font-size: 12px; }
.gallery-filter.active {
  border-color: rgba(168,85,247,0.46);
  background: rgba(168,85,247,0.2);
  color: #fff;
}
.gallery-source-filters {
  padding-bottom: 0;
  border-bottom: 0;
}

.gallery-date-search {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 40px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}
.gallery-date-picker {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.gallery-date-search label {
  display: grid;
  gap: 6px;
  color: rgba(255,255,255,0.46);
  font-size: 12px;
}
.gallery-date-search input {
  height: 34px;
  min-width: 150px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(255,255,255,0.055);
  color: rgba(255,255,255,0.88);
  color-scheme: dark;
}
.gallery-date-search button {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(168,85,247,0.28);
  background: rgba(168,85,247,0.14);
  color: #eadfff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.gallery-date-search button.muted {
  border-color: rgba(255,255,255,0.11);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.68);
}

.gallery-content {
  width: 100%;
  padding: 24px 40px 48px;
}
.gallery-day { margin-bottom: 34px; }
.gallery-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.gallery-day-header span { font-size: 18px; font-weight: 800; }
.gallery-day-header em { color: rgba(255,255,255,0.42); font-size: 13px; font-style: normal; }
.gallery-day-toggle {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(168,85,247,0.28);
  background: rgba(168,85,247,0.12);
  color: #e9ddff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
}
.gallery-card {
  width: 240px;
  min-width: 240px;
  max-width: 320px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.075);
  background: rgba(255,255,255,0.045);
}
.gallery-thumb-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  aspect-ratio: 16 / 10;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.gallery-thumb-grid.count-1 { display: block; }
.gallery-thumb-grid.is-multi {
  gap: 1px;
  background: rgba(125,211,252,0.12);
}
.gallery-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}
.gallery-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,0.34));
  opacity: 0;
}
.gallery-thumb-grid.is-multi .gallery-thumb::after { opacity: 1; }
.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gallery-thumb-missing {
  display: grid;
  place-items: center;
  gap: 4px;
  border: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.045) 0 7px, transparent 7px 14px),
    rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.58);
  cursor: default;
}
.gallery-thumb-missing span {
  font-size: 12px;
  font-weight: 800;
}
.gallery-thumb-missing em {
  font-size: 11px;
  font-style: normal;
  color: rgba(255,255,255,0.42);
}
.gallery-multi-badge,
.gallery-partial-badge {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(8,13,20,0.76);
  color: rgba(255,255,255,0.9);
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}
.gallery-multi-badge b {
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.gallery-partial-badge {
  left: 8px;
  right: auto;
  color: #fde68a;
  background: rgba(113,63,18,0.72);
}
.gallery-thumb-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: rgba(255,255,255,0.42);
}


.gallery-card-body { padding: 12px 14px 14px; }
.gallery-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.gallery-time { color: rgba(255,255,255,0.52); font-size: 12px; }
.gallery-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.76);
  font-size: 12px;
  font-weight: 700;
}
.status-completed .gallery-status { background: rgba(16,185,129,0.14); color: #78f0bd; }
.status-active .gallery-status { background: rgba(59,130,246,0.14); color: #93c5fd; }
.status-partial .gallery-status { background: rgba(250,204,21,0.14); color: #fde68a; }
.status-failed .gallery-status { background: rgba(239,68,68,0.14); color: #fca5a5; }

.gallery-prompt {
  height: 42px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.gallery-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168,85,247,0.13);
  color: #d9c2ff;
  font-size: 11px;
}
.gallery-meta .gallery-source-chip {
  background: rgba(45,212,191,0.14);
  color: #99f6e4;
}
.gallery-retention {
  margin-top: 9px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  line-height: 1.4;
}
.gallery-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.gallery-card-actions button {
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.gallery-card-actions button:hover { background: rgba(168,85,247,0.18); border-color: rgba(168,85,247,0.34); }

.gallery-loading,
.gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
  color: rgba(255,255,255,0.48);
}

@media (max-width: 760px) {
  .gallery-topbar,
  .gallery-filters,
  .gallery-date-search,
  .gallery-content { padding-left: 18px; padding-right: 18px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card { width: 100%; }
  .gallery-day-header { align-items: flex-start; flex-direction: column; }
}

/* ReactBits-inspired dark skin */
.gallery-view {
  background:
    linear-gradient(135deg, rgba(82,39,255,0.18), transparent 36%),
    linear-gradient(225deg, rgba(120,209,225,0.09), transparent 42%),
    var(--rb-bg);
  color: var(--rb-text);
}

.gallery-topbar {
  background: rgba(18,15,23,0.9);
  border-bottom-color: var(--rb-line);
  box-shadow: 0 16px 48px rgba(0,0,0,0.26);
}

.gallery-title,
.gallery-day-header span {
  color: var(--rb-text);
}

.gallery-subtitle,
.gallery-day-header em,
.gallery-time,
.gallery-retention,
.gallery-loading,
.gallery-empty {
  color: var(--rb-muted);
}

.gallery-filters,
.gallery-date-search {
  border-color: rgba(218,209,246,0.09);
}

.gallery-action-btn,
.gallery-close-btn,
.gallery-date-search button,
.gallery-day-toggle,
.gallery-card-actions button {
  background: rgba(82,39,255,0.15);
  border-color: rgba(139,92,246,0.3);
  color: #dad1f6;
}

.gallery-close-btn,
.gallery-date-search button.muted {
  background: rgba(255,255,255,0.055);
  border-color: var(--rb-line);
  color: rgba(218,209,246,0.74);
}

.gallery-action-btn:hover,
.gallery-close-btn:hover,
.gallery-date-search button:hover,
.gallery-day-toggle:hover,
.gallery-card-actions button:hover {
  background: rgba(82,39,255,0.26);
  border-color: rgba(139,92,246,0.58);
  color: #fff;
  box-shadow: 0 0 24px rgba(82,39,255,0.22);
}

.gallery-filter {
  background: rgba(255,255,255,0.045);
  border-color: var(--rb-line);
  color: var(--rb-muted);
}

.gallery-filter strong {
  color: var(--rb-text);
}

.gallery-filter.active {
  background: rgba(82,39,255,0.22);
  border-color: rgba(139,92,246,0.58);
  color: #fff;
  box-shadow: 0 0 24px rgba(82,39,255,0.18);
}

.gallery-date-search label {
  color: var(--rb-muted);
}

.gallery-date-search input {
  background: rgba(6,0,16,0.46);
  border-color: var(--rb-line);
  color: var(--rb-text);
}

.gallery-date-search input:focus {
  outline: none;
  border-color: var(--rb-line-strong);
  box-shadow: 0 0 24px rgba(82,39,255,0.18);
}

.gallery-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.058), rgba(255,255,255,0.026)),
    rgba(18,15,23,0.76);
  border-color: var(--rb-line);
  box-shadow: 0 16px 42px rgba(0,0,0,0.28);
}

.gallery-thumb-grid {
  background: rgba(6,0,16,0.5);
}

.gallery-thumb-grid.is-multi {
  background: rgba(120,209,225,0.14);
}

.gallery-thumb::after {
  background: linear-gradient(180deg, transparent 54%, rgba(6,0,16,0.62));
}

.gallery-thumb-missing {
  background:
    repeating-linear-gradient(45deg, rgba(218,209,246,0.06) 0 7px, transparent 7px 14px),
    rgba(22,16,38,0.72);
  color: var(--rb-muted);
}

.gallery-thumb-missing em {
  color: rgba(180,151,207,0.7);
}

.gallery-multi-badge,
.gallery-partial-badge {
  border-color: rgba(218,209,246,0.18);
  background: rgba(18,15,23,0.78);
  color: #fff;
}

.gallery-partial-badge {
  color: #fde68a;
  background: rgba(113,63,18,0.62);
}

.gallery-status {
  background: rgba(255,255,255,0.07);
  color: rgba(245,245,245,0.78);
}

.status-completed .gallery-status {
  background: rgba(52,211,153,0.14);
  color: #a7f3d0;
}

.status-active .gallery-status {
  background: rgba(120,209,225,0.14);
  color: #bdeef6;
}

.status-partial .gallery-status {
  background: rgba(250,204,21,0.14);
  color: #fde68a;
}

.status-failed .gallery-status {
  background: rgba(244,63,94,0.14);
  color: #fda4af;
}

.gallery-prompt {
  color: rgba(245,245,245,0.92);
}

.gallery-meta span {
  background: rgba(82,39,255,0.14);
  color: #dad1f6;
}

.gallery-meta .gallery-source-chip {
  background: rgba(120,209,225,0.14);
  color: #bdeef6;
}

/* Minimal black pass with subtle ReactBits-style polish */
.gallery-view {
  background:
    radial-gradient(circle at 16% 0%, rgba(88,28,135,0.12), transparent 30%),
    #050506;
}

.gallery-topbar {
  background: rgba(5,5,6,0.9);
  border-bottom-color: rgba(255,255,255,0.08);
}

.gallery-subtitle,
.gallery-day-header em,
.gallery-time,
.gallery-retention,
.gallery-loading,
.gallery-empty {
  color: var(--rb-muted);
}

.gallery-filters,
.gallery-date-search {
  border-color: rgba(255,255,255,0.07);
}

.gallery-action-btn,
.gallery-close-btn,
.gallery-date-search button,
.gallery-day-toggle,
.gallery-card-actions button,
.gallery-filter {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.09);
  color: rgba(244,244,245,0.78);
}

.gallery-filter.active,
.gallery-action-btn:hover,
.gallery-close-btn:hover,
.gallery-date-search button:hover,
.gallery-day-toggle:hover,
.gallery-card-actions button:hover {
  background: rgba(139,92,246,0.11);
  border-color: rgba(139,92,246,0.32);
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,0.12);
}

.gallery-date-search input {
  background: rgba(3,3,5,0.64);
  border-color: rgba(255,255,255,0.08);
}

.gallery-card {
  position: relative;
  background:
    radial-gradient(circle at 22% 0%, rgba(139,92,246,0.065), transparent 36%),
    rgba(10,10,13,0.86);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 16px 42px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.035);
}

.gallery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(139,92,246,0);
  pointer-events: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.gallery-card:hover::before {
  border-color: rgba(139,92,246,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.gallery-thumb-grid {
  background: rgba(3,3,5,0.76);
}

.gallery-thumb-grid.is-multi {
  background: rgba(139,92,246,0.1);
}

.gallery-multi-badge,
.gallery-partial-badge {
  background: rgba(5,5,7,0.78);
  border-color: rgba(255,255,255,0.14);
}

.gallery-status {
  background: rgba(255,255,255,0.055);
}

.gallery-meta span {
  background: rgba(139,92,246,0.09);
  color: rgba(226,220,239,0.9);
}

.gallery-meta .gallery-source-chip {
  background: rgba(139,92,246,0.08);
  color: rgba(226,220,239,0.86);
}

/* UI polish layer: premium cards without changing gallery behavior. */
.gallery-card {
  border-radius: 18px;
  border-color: rgba(255,255,255,0.1);
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 16px 36px rgba(0,0,0,0.16);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196,181,253,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 24px 48px rgba(0,0,0,0.24);
}

.gallery-topbar,
.gallery-filters,
.gallery-date-search {
  backdrop-filter: blur(18px);
}

.gallery-action-btn,
.gallery-close-btn,
.gallery-date-search button,
.gallery-day-toggle,
.gallery-card-actions button,
.gallery-filter {
  transition: border-color 0.22s ease, background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-action-btn:hover,
.gallery-date-search button:hover,
.gallery-day-toggle:hover,
.gallery-card-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124,58,237,0.16);
}

.gallery-close-btn:hover,
.gallery-filter:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}

.gallery-filter.active {
  box-shadow: 0 10px 24px rgba(124,58,237,0.14);
}

.gallery-date-search input:focus-visible {
  border-color: rgba(167,139,250,0.62);
  background: rgba(255,255,255,0.08);
}
