* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0e0e12;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2rem;
  color: #ff6b00;
  letter-spacing: 1px;
}

.subtitle {
  color: #888;
  margin-top: 6px;
  font-size: 0.95rem;
}

/* Search */
.search-section {
  margin-bottom: 40px;
  position: relative;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #ff6b00;
}

.search-box button,
#refresh-btn {
  padding: 12px 24px;
  background: #ff6b00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-box button:hover,
#refresh-btn:hover {
  background: #e05e00;
}

/* Filters */
.filters-panel {
  margin-top: 10px;
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  color: #888;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}

.filters-toggle:hover {
  color: #ccc;
  border-color: #444;
}

.toggle-icon {
  font-size: 0.7rem;
}

.filters-body {
  margin-top: 10px;
  padding: 16px;
  background: #14141c;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
}

.filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.75rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
  padding: 8px 10px;
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #ff6b00;
}

.filter-group select {
  cursor: pointer;
}

.filter-group select option {
  background: #1a1a24;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #222233;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #252535;
}

.result-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.skin-thumb {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  object-fit: contain;
  background: #222233;
  flex-shrink: 0;
}

.skin-thumb-placeholder {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  background: #222233;
  flex-shrink: 0;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-info .name {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  font-size: 0.78rem;
  color: #666;
}

.search-result-item .price {
  color: #4caf50;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-result-item .add-btn {
  padding: 4px 14px;
  background: #2a2a3a;
  color: #ff6b00;
  border: 1px solid #ff6b00;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item .add-btn:hover {
  background: #ff6b00;
  color: #fff;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: #888;
}

/* Watchlist */
.watchlist-section {
  margin-top: 20px;
}

.watchlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.watchlist-header h2 {
  font-size: 1.3rem;
  color: #ccc;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #555;
  background: #14141c;
  border-radius: 10px;
  border: 1px dashed #2a2a3a;
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  background: #14141c;
  border-radius: 10px;
  overflow: hidden;
}

.watchlist-table thead th {
  background: #1a1a26;
  padding: 14px 16px;
  text-align: left;
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2a2a3a;
}

.watchlist-table thead th:last-child {
  text-align: center;
  width: 60px;
}

.watchlist-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #1e1e2a;
  font-size: 0.95rem;
}

.watchlist-table tbody tr:last-child td {
  border-bottom: none;
}

.watchlist-table tbody tr:hover {
  background: #1a1a26;
}

td.price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

td.price.cheapest {
  color: #4caf50;
}

td.price.not-cheapest {
  color: #999;
}

td.best-price {
  font-weight: 700;
  color: #4caf50;
}

td.price.unavailable {
  color: #555;
  font-weight: 400;
  font-style: italic;
}

.skin-name {
  font-weight: 500;
  cursor: pointer;
  display: inline;
}

.skin-name:hover {
  color: #ff6b00;
}

.skin-filters {
  font-size: 0.78rem;
  color: #666;
  margin-top: 3px;
}

.listing-details {
  font-size: 0.78rem;
  color: #777;
  margin-top: 3px;
  font-weight: 400;
}

.badge-inactive {
  display: inline-block;
  padding: 2px 8px;
  background: #2a2a3a;
  color: #555;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

th .badge-inactive {
  margin-left: 6px;
}

.activate-hint {
  font-size: 0.7rem;
  color: #555;
  font-weight: 400;
  margin-top: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.loading-dots::after {
  content: '';
  animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.remove-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.remove-btn:hover {
  color: #ff4444;
  background: #2a1a1a;
}

/* Scrollbar */
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: #1a1a24;
}

.search-results::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.visible {
  display: flex;
}

.modal-content {
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  position: relative;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: #ff4444;
  background: #2a1a1a;
}

.modal-skin-image {
  width: 200px;
  height: 150px;
  object-fit: contain;
  background: #222233;
  border-radius: 8px;
  margin-bottom: 16px;
}

.modal-skin-placeholder {
  width: 200px;
  height: 150px;
  background: #222233;
  border-radius: 8px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-skin-name {
  font-size: 1.1rem;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.modal-skin-filters {
  font-size: 0.82rem;
  color: #666;
}

.modal-prices {
  margin: 20px 0;
}

.modal-price-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #222233;
}

.modal-price-row:last-child {
  border-bottom: none;
}

.modal-source {
  color: #888;
  font-size: 0.9rem;
}

.modal-price-value {
  color: #4caf50;
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-price-value.unavailable {
  color: #555;
  font-style: italic;
  font-weight: 400;
}

.modal-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-link {
  display: block;
  padding: 10px 16px;
  background: #222233;
  color: #ff6b00;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.modal-link:hover {
  background: #2a2a3a;
}

/* Responsive */
@media (max-width: 600px) {
  .search-box {
    flex-direction: column;
  }

  .filter-row {
    flex-direction: column;
  }

  .watchlist-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .watchlist-table {
    font-size: 0.85rem;
  }

  .watchlist-table thead th,
  .watchlist-table tbody td {
    padding: 10px 8px;
  }
}
