:root {
  --max: 900px;
  --gap: 8px;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 24px 16px 16px 16px !important;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

.search-container {
  max-width: var(--max);
  margin: 0 auto 16px auto;
  background: #1a1a1a;
  padding: 1px 16px 8px 16px !important;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}

.results-container {
  max-width: var(--max);
  margin: 0 auto;
  background: #1a1a1a;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}

/* STR specific container styling */
#str-wrapper {
  padding: 8px;
}

/* Make STR panel much narrower on all screen sizes */
#str-wrapper {
  max-width: 33.33vw;
  margin: 0 auto;
}

h1 { 
  color: #ffffff; 
  margin-bottom: 8px !important; 
  text-align: center;
  font-size: 1.4rem !important;
  font-weight: 700;
}

form {
  display: flex;
  gap: var(--gap);
  margin-bottom: 12px;
  justify-content: center;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 14px;
}

input::placeholder {
  color: #888;
}

button {
  padding: 8px 12px;
  border: 0;
  background: #4caf50;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

button:hover { background: #45a049; }

#status { color: #888; margin: 8px 0; }

.results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-item {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  transition: box-shadow 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.result-title {
  font-weight: 600;
  color: #4fc3f7;
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.2;
  flex: 1;
  margin-right: 12px;
}

.result-title:hover {
  text-decoration: underline;
}

.result-meta {
  color: #888;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  text-align: right;
}

.condition {
  color: #888;
}

.price {
  color: #ffffff;
  font-weight: 600;
}

.results-container {
  margin-top: 16px;
}

.view-listings-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 12px auto;
  display: block;
}

.view-listings-btn:hover {
  background: #45a049;
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analytics-panel {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  flex: 1;
  min-width: 280px;
  max-width: 350px;
}

.analytics-panels-container {
  margin-bottom: 16px;
}

.total-results-header {
  text-align: center;
  margin-bottom: 16px;
}

.total-results-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

.panels-wrapper {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 900px;
  margin: 0 auto;
}

/* Removed analytics-header styles since we no longer use headers */

.analytics-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #444;
}

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

/* Sellthrough Rate (STR) Styles */
#str-wrapper .str-header h2 {
  color: #ffffff;
  margin: 0 0 2px 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

#str-wrapper .str-content {
  text-align: center;
  padding: 4px;
}

#str-wrapper .str-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#str-wrapper .str-calculation {
  color: #888;
  font-size: 0.75rem;
  font-weight: 500;
}

/* STR Color Classes */
.str-red {
  color: #ff4444;
}

.str-orange {
  color: #ff8800;
}

.str-yellow {
  color: #ffdd00;
}

.str-green {
  color: #44ff44;
}

.str-rainbow {
  background: linear-gradient(45deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff, #ff0088);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 2s ease-in-out infinite alternate;
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.analytics-label {
  color: #888;
  font-weight: 500;
  font-size: 0.85rem;
}

.analytics-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .search-container,
  .results-container {
    padding: 12px 16px 16px 16px;
  }
  
  .panels-wrapper {
    flex-direction: column;
    gap: 12px;
  }
  
  .analytics-panel {
    min-width: unset;
    max-width: unset;
    flex: none;
  }
  
  .str-value {
    font-size: 2.5rem;
  }
  
  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .result-title {
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  .result-meta {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .search-container,
  .results-container {
    padding: 8px 12px 12px 12px;
  }
  
  form {
    flex-direction: row;
    gap: 6px;
  }
  
  .str-value {
    font-size: 2rem;
  }
  
  /* Force mobile layout with maximum specificity */
  #results-wrapper .analytics-panels-container,
  #sold-results-wrapper .analytics-panels-container {
    flex-direction: row !important;
    gap: 6px !important;
  }
  
  #results-wrapper .panels-wrapper,
  #sold-results-wrapper .panels-wrapper {
    flex-direction: row !important;
    gap: 6px !important;
  }
  
  /* Make other elements smaller for mobile */
  h1 {
    font-size: 1.2rem !important;
  }
  
  input[type="text"] {
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
    flex: 1;
  }
  
  button[type="submit"] {
    font-size: 0.6rem !important;
    padding: 4px 8px !important;
    flex-shrink: 0;
  }
  
  .view-listings-btn {
    font-size: 0.6rem !important;
    padding: 3px 6px !important;
    margin: 4px 0 !important;
    text-align: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  #status {
    font-size: 0.7rem !important;
    padding: 4px 0 !important;
  }
  
  .total-results-header h2 {
    font-size: 0.7rem !important;
  }
  
  .result-item {
    padding: 4px 8px !important;
  }
  
  .result-title {
    font-size: 0.6rem !important;
  }
  
  .result-meta {
    font-size: 0.6rem !important;
    justify-content: flex-end !important;
    text-align: right !important;
  }
  
  /* Analytics cards - more readable but still compact */
  #results-wrapper .analytics-panel,
  #sold-results-wrapper .analytics-panel {
    padding: 6px !important;
    margin: 0 !important;
    flex: 1 !important;
    min-width: unset !important;
    max-width: unset !important;
  }
  
  #results-wrapper .analytics-header h3,
  #sold-results-wrapper .analytics-header h3 {
    font-size: 0.7rem !important;
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
  }
  
  #results-wrapper .analytics-content,
  #sold-results-wrapper .analytics-content {
    gap: 2px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  #results-wrapper .analytics-item,
  #sold-results-wrapper .analytics-item {
    padding: 2px 0 !important;
    margin: 0 !important;
  }
  
  #results-wrapper .analytics-label,
  #sold-results-wrapper .analytics-label {
    font-size: 0.6rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #results-wrapper .analytics-value,
  #sold-results-wrapper .analytics-value {
    font-size: 0.7rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Disclaimer Footer */
.disclaimer {
  max-width: var(--max);
  margin: 32px auto 16px auto;
  padding: 16px;
  background: #1a1a1a;
  border-radius: 8px;
  border: 1px solid #333;
}

.disclaimer p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #b0b0b0;
  text-align: center;
}

.disclaimer strong {
  color: #e0e0e0;
}

/* Mobile disclaimer */
@media (max-width: 480px) {
  .disclaimer {
    margin: 16px auto 8px auto;
    padding: 12px;
  }
  
  .disclaimer p {
    font-size: 0.7rem;
    line-height: 1.3;
  }
}

/* eBay Search Links */
.ebay-search-link {
  background: transparent !important;
  border: none !important;
  margin-bottom: 12px !important;
  padding: 4px 0 !important;
  text-align: center !important;
}

.ebay-search-link a {
  color: #5a8cc7 !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  font-size: 0.8rem !important;
  display: inline-block !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
}

.ebay-search-link a:hover {
  color: #7ba3d4 !important;
  background: #2a2a2a !important;
  text-decoration: none !important;
}

/* Filter Controls */
.filter-controls {
  background: transparent !important;
  border: none !important;
  margin-bottom: 8px !important;
  padding: 4px 0 !important;
  text-align: right !important;
}

.filter-options {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-options label {
  color: #b0b0b0 !important;
  font-size: 0.7rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.filter-options input[type="radio"] {
  margin: 0 !important;
  accent-color: #5a8cc7 !important;
  transform: scale(0.8);
}

.filter-options label:hover {
  color: #d0d0d0 !important;
}

/* Mobile filter controls */
@media (max-width: 480px) {
  .filter-options {
    gap: 6px;
  }
  
  .filter-options label {
    font-size: 0.65rem !important;
  }
}


