/* Nova Pokemon Marketplace - Shared Styles */

:root {
  --nova-gold: #f7c948;
  --nova-dark: #1a1a2e;
  --nova-card-bg: #16213e;
  --nova-accent: #0f3460;
  --nova-green: #28a745;
  --nova-red: #dc3545;
}

body {
  background-color: #121212;
  color: #ffffff;
}

/* Auth Gate */
.auth-gate {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 2px solid var(--nova-gold);
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(247, 201, 72, 0.2);
}

.auth-card h2 {
  color: var(--nova-gold);
  text-align: center;
  margin-bottom: 24px;
}

/* Pokemon Listing Cards (buy page) */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.listing-card {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.listing-card:hover {
  transform: translateY(-4px);
  border-color: var(--nova-gold);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(247, 201, 72, 0.2);
}

.listing-card .pokemon-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #0d0d0d;
}

.listing-card .pokemon-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
}

.listing-card .bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.99;
  border-radius: 0;
  z-index: 0;
}

.listing-card .img-layer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.listing-card .price-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f7c948, #f0932b);
  color: #1a1a2e;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 10;
}

.listing-card .card-info {
  padding: 10px 12px;
}

.listing-card .pokemon-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
}

.listing-card .pokemon-notes {
  font-size: 0.75rem;
  color: #aaa;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Seller dashboard listing cards */
.seller-listing-card {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}

.seller-listing-card:hover {
  border-color: #555;
}

.seller-listing-card .pokemon-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #0d0d0d;
}

.seller-listing-card .pokemon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
  position: relative;
  z-index: 1;
}

.seller-listing-card .pokemon-thumb .bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.seller-listing-card .listing-info {
  flex: 1;
  min-width: 0;
}

.seller-listing-card .listing-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.seller-listing-card .listing-price {
  font-size: 0.85rem;
  color: var(--nova-gold);
  font-weight: 700;
  margin: 0 0 2px;
}

.seller-listing-card .listing-notes {
  font-size: 0.75rem;
  color: #aaa;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-listing-card .listing-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Pokemon Selector (reused from trade page) */
.pokemon-selector {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 3px solid #3b5ca8;
  border-radius: 20px;
  padding: 25px;
  width: 90vw;
  max-width: 650px;
  max-height: 85vh;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(59, 92, 168, 0.3);
  flex-direction: column;
}

.pokemon-selector[style*="block"] {
  display: flex !important;
}

.pokemon-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 5px;
  margin-top: 15px;
  overflow-y: auto;
  max-height: 50vh;
  flex: 1;
  padding-right: 10px;
}

@media (min-width: 768px) {
  .pokemon-selector-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

.pokemon-option {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pokemon-option:hover {
  transform: scale(1.08) translateY(-2px);
  background: rgba(59, 92, 168, 0.15);
  border-color: rgba(59, 92, 168, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 92, 168, 0.2);
}

.pokemon-option.selected {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.25) 0%, rgba(40, 167, 69, 0.15) 100%);
  border: 2px solid #28a745;
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.4);
  transform: scale(1.02);
}

.pokemon-option.selected::after {
  content: "✓";
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.pokemon-option img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  object-position: center;
  transform: scale(1.2);
  border-radius: 8px;
}

.close-selector {
  background: linear-gradient(135deg, #ff5350 0%, #dc3545 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  width: 35px;
  height: 35px;
  position: absolute;
  top: 15px;
  right: 15px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-selector:hover {
  transform: scale(1.1) rotate(90deg);
}

.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

/* Tag Filter Buttons */
.tag-filters-container {
  display: flex;
  gap: min(6px, 1vw);
  margin-top: 12px;
  margin-bottom: 8px;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.tag-filter-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: min(8px, 2vw);
  color: rgba(255, 255, 255, 0.7);
  padding: min(6px, 1.5vw) min(8px, 2vw);
  font-size: min(11px, 2.8vw);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-filter-btn:hover {
  background: rgba(59, 92, 168, 0.15);
  border-color: rgba(59, 92, 168, 0.5);
  color: #ffffff;
}

.tag-filter-btn.active {
  background: linear-gradient(135deg, rgba(59, 92, 168, 0.3) 0%, rgba(59, 92, 168, 0.2) 100%);
  border-color: #3b5ca8;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(59, 92, 168, 0.3);
}

/* Lazy loading */
.lazy-image {
  transition: opacity 0.3s ease;
}

.lazy-loading {
  opacity: 0.6;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

.lazy-loaded {
  opacity: 1;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 0.8; }
}

/* Pokemon search input */
.pokemon-search {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border: 2px solid #3b5ca8;
  border-radius: 12px;
  color: white;
  padding: 12px 16px;
  width: 100%;
  font-size: 16px;
  transition: all 0.3s ease;
}

.pokemon-search:focus {
  outline: none;
  border-color: #20c997;
  box-shadow: 0 0 20px rgba(32, 201, 151, 0.4);
}

/* Add listing form */
.add-listing-form {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
}

.selected-pokemon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.selected-pokemon-preview .preview-img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #0d0d0d;
}

.selected-pokemon-preview .preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
  position: relative;
  z-index: 1;
}

.selected-pokemon-preview .preview-img .bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

/* Nova gold header accent */
.nova-header {
  border-bottom: 2px solid var(--nova-gold);
  padding-bottom: 8px;
  color: var(--nova-gold);
}

@media (max-width: 576px) {
  .listing-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .tag-filter-btn {
    font-size: 10px;
    padding: 5px 6px;
  }
}
