/* ===== GALLERY PAGE STYLES ===== */

/* PAGE HERO */
.page-hero {
  position: relative;
  padding: 140px 0 72px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, #000000 0%, #0d0d0d 50%, #111111 100%);
}

.page-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(230,50,50,0.07), transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(180,0,0,0.05), transparent 60%);
  pointer-events: none;
}

.page-hero-content { position: relative; z-index: 1; padding: 0 24px; }

.page-hero-title {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -2px;
  margin: 12px 0 16px;
}

.page-hero-sub {
  color: var(--text-muted);
  font-size: 16px; max-width: 560px;
  margin: 0 auto 40px; line-height: 1.7;
}

.gallery-stats-row {
  display: flex; justify-content: center;
  gap: 48px; flex-wrap: wrap;
}

.gstat {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 120px;
}
.gstat-val { font-size: 24px; font-weight: 800; color: var(--accent); }
.gstat-lbl { font-size: 12px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; margin-top: 2px; }

/* ===== GALLERY MAIN ===== */
.gallery-main { padding: 48px 0 80px; }

/* TOOLBAR */
.gallery-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toolbar-left { flex: 1; min-width: 240px; }
.toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* SEARCH */
.search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 14px;
  color: var(--text-muted); font-size: 13px; pointer-events: none;
}
.gallery-search {
  width: 100%; padding: 10px 38px 10px 38px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-main);
  font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
.gallery-search::placeholder { color: var(--text-muted); }
.gallery-search:focus { border-color: rgba(230,50,50,0.4); }
.search-clear {
  position: absolute; right: 12px;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 12px; padding: 4px;
  display: none; transition: color 0.2s;
}
.search-clear:hover { color: var(--text-main); }
.search-clear.visible { display: block; }

/* FILTER */
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.gallery-select {
  padding: 8px 32px 8px 12px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-main);
  font-size: 13px; font-family: var(--font);
  outline: none; cursor: pointer; transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b8fa8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.gallery-select:focus { border-color: rgba(230,50,50,0.4); }
.gallery-select option { background: var(--bg-card2); }

/* VIEW TOGGLE */
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.view-btn.active, .view-btn:hover {
  background: rgba(230,50,50,0.12);
  border-color: rgba(230,50,50,0.3);
  color: var(--accent);
}

/* ACTIVE FILTERS */
.active-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; min-height: 0;
}
.filter-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(230,50,50,0.1); border: 1px solid rgba(0,229,160,0.25);
  font-size: 12px; color: var(--accent); font-weight: 600;
}
.filter-tag button {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 11px; padding: 0; line-height: 1;
}

/* RESULTS BAR */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.results-bar span { font-size: 14px; color: var(--text-muted); }

.btn-load-more-top {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  background: rgba(230,50,50,0.1); border: 1px solid rgba(0,229,160,0.25);
  color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.btn-load-more-top:hover { background: rgba(230,50,50,0.2); }

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  transition: all 0.3s;
}
.gallery-grid.list-view {
  grid-template-columns: 1fr;
}

/* ===== NFT CARD ===== */
.nft-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  animation: cardIn 0.4s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nft-card:hover {
  border-color: rgba(230,50,50,0.35);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(230,50,50,0.1);
}

.nft-card-img-wrap {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--bg-card2);
}

.nft-card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.nft-card:hover .nft-card-img-wrap img { transform: scale(1.06); }

.nft-card-skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg-card2) 25%, rgba(255,255,255,0.03) 50%, var(--bg-card2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.nft-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 16px;
}
.nft-card:hover .nft-card-overlay { opacity: 1; }

.nft-card-overlay-btn {
  padding: 8px 20px; border-radius: 8px;
  background: var(--accent); color: #000;
  font-size: 12px; font-weight: 800; letter-spacing: 0.5px;
  border: none; cursor: pointer; font-family: var(--font);
}

.rarity-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase;
}
.rarity-legendary { background: rgba(255,193,7,0.9); color: #000; }
.rarity-rare      { background: rgba(230,50,50,0.85); color: #fff; }
.rarity-common    { background: rgba(255,255,255,0.15); color: #fff; }

.nft-card-body {
  padding: 14px 16px 16px;
}
.nft-card-name {
  font-size: 14px; font-weight: 700; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nft-card-id { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.nft-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.nft-card-price {
  font-size: 14px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}
.nft-card-price i { font-size: 11px; }
.nft-card-like {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 4px;
  transition: color 0.2s; display: flex; align-items: center; gap: 4px;
}
.nft-card-like:hover, .nft-card-like.liked { color: #e74c3c; }
.nft-card-like span { font-size: 11px; }

/* ===== LIST VIEW CARD ===== */
.gallery-grid.list-view .nft-card {
  display: flex; flex-direction: row; align-items: center;
}
.gallery-grid.list-view .nft-card-img-wrap {
  width: 90px; height: 90px; flex-shrink: 0;
  aspect-ratio: unset; border-radius: 0;
}
.gallery-grid.list-view .nft-card-overlay { display: none; }
.gallery-grid.list-view .nft-card-body {
  flex: 1; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.gallery-grid.list-view .nft-card-name { font-size: 15px; margin-bottom: 2px; }
.gallery-grid.list-view .nft-card-id { margin-bottom: 0; }

/* EMPTY STATE */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
.gallery-empty i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.gallery-empty h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.gallery-empty p { font-size: 14px; }

/* LOAD MORE */
.load-more-wrap {
  text-align: center; padding: 40px 0 0;
}
.btn-load-more {
  padding: 14px 48px; border-radius: 10px;
  background: rgba(230,50,50,0.1); border: 1px solid rgba(230,50,50,0.3);
  color: var(--accent); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
  display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.5px;
}
.btn-load-more:hover { background: rgba(230,50,50,0.2); }
.btn-load-more:disabled { opacity: 0.4; cursor: not-allowed; }
.load-more-info { font-size: 13px; color: var(--text-muted); margin-top: 12px; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(5,7,12,0.96);
  backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  color: var(--text-main); font-size: 18px; cursor: pointer;
  transition: all 0.2s; z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.15); }

.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text-main); font-size: 16px; cursor: pointer;
  transition: all 0.2s; z-index: 10;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(230,50,50,0.15); border-color: rgba(230,50,50,0.3); color: var(--accent); }

.lightbox-inner {
  display: flex; gap: 40px; align-items: flex-start;
  max-width: 960px; width: 100%; max-height: 90vh;
  overflow-y: auto;
}

.lightbox-img-wrap {
  position: relative; flex-shrink: 0; width: 400px;
  border-radius: 20px; overflow: hidden;
}
.lightbox-img-wrap img {
  width: 100%; display: block; border-radius: 20px;
}
.lightbox-rarity-badge {
  position: absolute; top: 14px; left: 14px;
  padding: 4px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
}

.lightbox-info { flex: 1; padding-top: 4px; }

.lbx-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 3px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.lightbox-info h2 {
  font-size: 32px; font-weight: 900; margin-bottom: 20px;
}
.lbx-price-row {
  display: flex; gap: 24px; margin-bottom: 24px;
}
.lbx-price, .lbx-rank {
  display: flex; flex-direction: column;
  padding: 14px 20px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 10px; flex: 1;
}
.lbx-price-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 4px; }
.lbx-price-val { font-size: 20px; font-weight: 800; color: var(--accent); }

.lbx-traits {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.trait-tag {
  padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.trait-tag span { color: var(--text-main); margin-left: 4px; }

.lbx-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.lbx-buy { padding: 12px 28px; }
.lbx-opensea { padding: 12px 20px; font-size: 13px; }

.lbx-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.lbx-meta span { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.lbx-meta i { color: var(--accent); }

/* ===== ADD IMAGE MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(5,7,12,0.85);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 540px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-header h3 i { color: var(--accent); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text-main); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.form-group .required { color: #e74c3c; }
.form-group input, .form-group select {
  padding: 10px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-main);
  font-size: 14px; font-family: var(--font); outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: rgba(230,50,50,0.4); }
.form-group input::placeholder { color: var(--text-muted); }
.form-group select option { background: var(--bg-card2); }

.modal-preview {
  border-radius: 12px; overflow: hidden;
  border: 1px dashed var(--border); min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2);
}
.modal-preview img { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.preview-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); padding: 24px; }
.preview-placeholder i { font-size: 28px; opacity: 0.3; }
.preview-placeholder span { font-size: 13px; }
.modal-error { font-size: 13px; color: #e74c3c; min-height: 0; }

.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.btn-cancel {
  padding: 10px 22px; border-radius: 8px;
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all 0.2s;
}
.btn-cancel:hover { border-color: rgba(255,255,255,0.2); color: var(--text-main); }
.btn-add-nft {
  padding: 10px 22px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #cc0000);
  border: none; color: #000; font-size: 14px; font-weight: 800;
  cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; gap: 7px; transition: all 0.2s;
}
.btn-add-nft:hover { box-shadow: 0 6px 24px rgba(230,50,50,0.3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .lightbox-inner { flex-direction: column; align-items: center; }
  .lightbox-img-wrap { width: 100%; max-width: 380px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
@media (max-width: 640px) {
  .gallery-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-wrap: wrap; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .page-hero-title { letter-spacing: -1px; }
  .gallery-stats-row { gap: 12px; }
  .gstat { min-width: 100px; padding: 12px 16px; }
  .form-row { flex-direction: column; }
  .lbx-price-row { flex-direction: column; gap: 12px; }
}
