/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * HOLLOWCORE DISCOVERY PANEL
 * Advanced discovery system with filters, sorting, and grid layout
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.discovery-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  background: linear-gradient(135deg,
    rgba(20, 20, 35, 0.98) 0%,
    rgba(30, 25, 40, 0.98) 50%,
    rgba(25, 20, 35, 0.98) 100%);
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 16px;
  box-shadow:
    0 0 60px rgba(139, 92, 246, 0.3),
    0 0 120px rgba(139, 92, 246, 0.15),
    inset 0 0 80px rgba(139, 92, 246, 0.05);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: discovery-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes discovery-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ━━━ HEADER ━━━ */
.discovery-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.discovery-panel-title {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.discovery-panel-close {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discovery-panel-close:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(220, 38, 38, 0.6);
  transform: scale(1.05);
}

/* ━━━ CONTENT LAYOUT ━━━ */
.discovery-panel-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ━━━ SIDEBAR (FILTERS) ━━━ */
.discovery-sidebar {
  width: 300px;
  background: rgba(15, 15, 25, 0.5);
  border-right: 1px solid rgba(139, 92, 246, 0.2);
  overflow-y: auto;
  padding: 20px;
}

.discovery-sidebar::-webkit-scrollbar {
  width: 6px;
}

.discovery-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.discovery-sidebar::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 3px;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-section-title::before {
  content: '';
  width: 4px;
  height: 12px;
  background: linear-gradient(180deg, #a78bfa 0%, transparent 100%);
  border-radius: 2px;
}

/* Search input */
.filter-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  color: #e9d5ff;
  font-size: 14px;
  font-family: 'Roboto Mono', monospace;
  transition: all 0.2s ease;
}

.filter-search-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.filter-search-input::placeholder {
  color: rgba(233, 213, 255, 0.4);
}

/* Select dropdowns */
.filter-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  color: #e9d5ff;
  font-size: 13px;
  font-family: 'Roboto Mono', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.filter-select:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

.filter-select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* Range inputs */
.filter-range-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-range-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  color: #e9d5ff;
  font-size: 12px;
  font-family: 'Roboto Mono', monospace;
  text-align: center;
  transition: all 0.2s ease;
}

.filter-range-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
}

.filter-range-label {
  font-size: 11px;
  color: rgba(233, 213, 255, 0.6);
  margin-bottom: 4px;
  font-family: 'Roboto Mono', monospace;
}

/* Clear filters button */
.filter-clear-btn {
  width: 100%;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #fca5a5;
  padding: 10px;
  border-radius: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

.filter-clear-btn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.5);
}

/* ━━━ MAIN CONTENT (GRID & RESULTS) ━━━ */
.discovery-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar (Sort & View Controls) */
.discovery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(15, 15, 25, 0.3);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.discovery-results-info {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: rgba(233, 213, 255, 0.7);
}

.discovery-results-count {
  color: #a78bfa;
  font-weight: 600;
}

.discovery-sort-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discovery-sort-label {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: rgba(233, 213, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.discovery-sort-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  padding: 8px 14px;
  color: #e9d5ff;
  font-size: 12px;
  font-family: 'Roboto Mono', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.discovery-sort-select:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

.discovery-sort-select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
}

/* Grid Container */
.discovery-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.discovery-grid-container::-webkit-scrollbar {
  width: 8px;
}

.discovery-grid-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.discovery-grid-container::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 4px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  animation: grid-fade-in 0.4s ease;
}

@keyframes grid-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ━━━ HOLLOWCORE CARDS ━━━ */
.hollowcore-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.9) 0%, rgba(40, 35, 55, 0.9) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.hollowcore-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow:
    0 8px 32px rgba(139, 92, 246, 0.3),
    0 0 60px rgba(139, 92, 246, 0.15);
}

.hollowcore-card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.hollowcore-card-content {
  padding: 16px;
}

.hollowcore-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hollowcore-card-name {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #e9d5ff;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.hollowcore-card-stage {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.hollowcore-card-prime {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.prime-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prime-badge.trace {
  background: rgba(147, 197, 253, 0.15);
  border-color: rgba(147, 197, 253, 0.4);
  color: #93c5fd;
}

.prime-badge.pulse {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fb923c;
}

.prime-badge.fade {
  background: rgba(156, 163, 175, 0.15);
  border-color: rgba(156, 163, 175, 0.4);
  color: #9ca3af;
}

.prime-badge.branch {
  background: rgba(167, 243, 208, 0.15);
  border-color: rgba(167, 243, 208, 0.4);
  color: #a7f3d0;
}

.prime-badge.echo {
  background: rgba(196, 181, 253, 0.15);
  border-color: rgba(196, 181, 253, 0.4);
  color: #c4b5fd;
}

.prime-badge.null {
  background: rgba(30, 30, 50, 0.5);
  border-color: rgba(75, 85, 99, 0.5);
  color: #9ca3af;
}

.hollowcore-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-item {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  color: rgba(233, 213, 255, 0.7);
}

.stat-value {
  color: #a78bfa;
  font-weight: 600;
}

.hollowcore-card-care {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
  margin-bottom: 10px;
}

.hollowcore-card-care.optimal {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.hollowcore-card-care.stable {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.hollowcore-card-care.anxious {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fdba74;
}

.hollowcore-card-care.rusty {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.hollowcore-card-owner {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: rgba(233, 213, 255, 0.5);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  padding-top: 10px;
}

.hollowcore-card-owner-name {
  color: #a78bfa;
}

/* Birth badge */
.birth-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(167, 243, 208, 0.2);
  border: 1px solid rgba(167, 243, 208, 0.4);
  color: #a7f3d0;
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

/* ━━━ PAGINATION ━━━ */
.discovery-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(15, 15, 25, 0.3);
}

.pagination-btn {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: rgba(233, 213, 255, 0.7);
}

.pagination-page-number {
  color: #a78bfa;
  font-weight: 600;
}

/* ━━━ LOADING STATE ━━━ */
.discovery-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: rgba(233, 213, 255, 0.7);
}

/* ━━━ EMPTY STATE ━━━ */
.discovery-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 12px;
}

.empty-icon {
  font-size: 64px;
  opacity: 0.3;
}

.empty-text {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  color: rgba(233, 213, 255, 0.6);
}

.empty-subtext {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  color: rgba(233, 213, 255, 0.4);
}

/* ━━━ RESPONSIVE ━━━ */
@media (max-width: 1200px) {
  .discovery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .discovery-panel {
    width: 95vw;
    height: 90vh;
  }

  .discovery-sidebar {
    width: 250px;
  }

  .discovery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .discovery-panel-content {
    flex-direction: column;
  }

  .discovery-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  }

  .discovery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
