/* ============================================
   Bulk Import & Analysis Styles
   ============================================ */

/* Tab Content - tabs are now in header */
.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content:not(.active) {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide old standalone tab navigation if it exists */
.tab-navigation {
  display: none !important;
}

/* Bulk Analysis Container */
.bulk-analysis {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Marketplace Search Buttons */
.bulk-search-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.marketplace-search-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.marketplace-search-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.marketplace-search-btn:not(:disabled):hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(112, 255, 189, 0.2);
}

.marketplace-search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.marketplace-icon {
  font-size: 48px;
}

.marketplace-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.marketplace-desc {
  font-size: 14px;
  color: var(--muted);
}

.or-divider {
  position: relative;
  margin: 32px 0;
  text-align: center;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.or-divider span {
  position: relative;
  background: var(--background);
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--foreground);
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 24px;
  border-top: 1px solid var(--border);
}

.config-group {
  margin-bottom: 24px;
}

.config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .config-row {
    grid-template-columns: 1fr;
  }
}

.config-label {
  display: block;
}

.label-text {
  display: block;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
  font-size: 14px;
}

.label-hint {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.config-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
}

.config-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(112, 255, 189, 0.1);
}

.config-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
}

.config-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.config-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.slider-value {
  margin-top: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

/* Upload Zone */
.bulk-upload-container {
  margin-bottom: 24px;
}

.bulk-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  cursor: pointer;
}

.bulk-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.bulk-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(112, 255, 189, 0.1);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.upload-icon {
  width: 64px;
  height: 64px;
  color: var(--accent);
  stroke-width: 1.5;
}

.upload-placeholder h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.upload-placeholder p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.upload-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(112, 255, 189, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.progress-bar {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

#bulk-upload-status {
  margin-top: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: rgba(112, 255, 189, 0.1);
  border: 1px solid rgba(112, 255, 189, 0.3);
  color: var(--accent);
}

.alert-error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #ff6b6b;
}

/* Bulk Controls */
.bulk-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 24px;
}

.bulk-search-input {
  flex: 1;
  min-width: 250px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
}

.bulk-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(112, 255, 189, 0.1);
}

.bulk-sort-select {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
}

.bulk-sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

.bulk-stats {
  display: flex;
  gap: 16px;
  margin-left: auto;
  font-size: 13px;
}

.stat-item {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--muted);
}

.stat-buy {
  background: rgba(112, 255, 189, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.stat-review {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  font-weight: 600;
}

.stat-pass {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  font-weight: 600;
}

/* Bulk Listings Container - inherits styles from main feed */
.bulk-listings-container {
  /* Default list view - no grid styles here */
  /* Grid styles are applied via .grid-view class from app.js */
}

/* Grid view styles - only applied when .grid-view class is present */
.bulk-listings-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.listing-content {
  padding: 16px;
}

.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.listing-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
}

.ai-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-badge.ai-buy {
  background: rgba(112, 255, 189, 0.2);
  color: var(--accent);
}

.ai-badge.ai-review {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.ai-badge.ai-pass {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
}

.listing-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin: 8px 0;
}

.listing-seller,
.listing-marketplace,
.listing-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.empty-state p {
  font-size: 16px;
  margin: 8px 0;
}

.empty-state-hint {
  font-size: 14px;
  opacity: 0.7;
}

/* Search Progress */
.search-progress {
  text-align: center;
  padding: 60px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.search-progress h3 {
  font-size: 24px;
  color: var(--foreground);
  margin: 24px 0 8px;
}

.search-progress p {
  color: var(--muted);
  margin: 8px 0;
}

.progress-stages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 32px 0;
  text-align: left;
}

.stage {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.3s ease;
}

.stage.active {
  background: rgba(112, 255, 189, 0.15);
  border: 1px solid rgba(112, 255, 189, 0.3);
  color: var(--accent);
  font-weight: 600;
}

.stage.complete {
  background: rgba(112, 255, 189, 0.1);
  color: var(--foreground);
}

.progress-hint {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0a1929;
}

.btn-primary:hover {
  background: #6bffd0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(112, 255, 189, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  margin-top: 12px;
  display: inline-block;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tab-navigation {
    padding: 12px;
  }

  .bulk-analysis {
    padding: 16px;
  }

  .bulk-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-search-input {
    min-width: 100%;
  }

  .bulk-stats {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .bulk-listings-container.grid-view {
    grid-template-columns: 1fr;
  }
}

