:root {
  --primary-color: #1976d2;
  --primary-dark: #1565c0;
  --accent-color: #03dac6;
  --error-color: #cf6679;
  --success-color: #4caf50;
}

/* Light Theme (Default) */
body {
  background: #fafafa;
  color: #212121;
  transition: background-color 0.3s, color 0.3s;
}

nav {
  background: var(--primary-color) !important;
}

.brand-logo {
  font-weight: 700;
}

.subtle {
  color: #757575;
}

.card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chip {
  background: #e0e0e0;
  color: #424242;
}

.chip.active {
  background: var(--primary-color);
  color: white;
}

.input-field > label {
  color: #757575 !important;
}

.input-field input,
.input-field select {
  color: #212121;
}

.svg-wrap {
  width: 100%;
  height: 350px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.axis-text {
  font-size: 11px;
  fill: #757575;
  font-family: 'Roboto', sans-serif;
}

.axis-line {
  stroke: #e0e0e0;
  stroke-width: 1;
}

.grid-line {
  stroke: #f5f5f5;
  stroke-width: 1;
}

.stat {
  font-size: 0.9rem;
  color: #757575;
  margin-right: 12px;
}

.ok {
  color: var(--success-color);
  font-weight: 700;
}

.bad {
  color: var(--error-color);
  font-weight: 700;
}

.btn-green {
  background: var(--success-color) !important;
  color: white !important;
}

.btn-outline {
  background: transparent !important;
  border: 1px solid #e0e0e0 !important;
  color: var(--primary-color) !important;
}

.divider-thin {
  height: 1px;
  background: #e0e0e0;
  margin: 12px 0;
}

.product-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  padding: 8px;
}

.product-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.product-info {
  flex: 1;
}

.product-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #212121;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success-color);
  margin-bottom: 4px;
}

.product-meta {
  font-size: 0.9rem;
  color: #757575;
  margin-bottom: 8px;
}

.price-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.price-stat {
  text-align: center;
  flex: 1;
}

.price-stat-label {
  font-size: 0.8rem;
  color: #757575;
  display: block;
  margin-bottom: 4px;
}

.price-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
}

.price-stat-value.lowest {
  color: var(--success-color);
}

.price-stat-value.highest {
  color: var(--error-color);
}

.price-stat-value.average {
  color: #ff9800;
}

.search-block {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  margin-bottom: 24px;
}

.search-block .card-title {
  color: white;
  font-weight: 600;
}

.search-block .subtle {
  color: rgba(255, 255, 255, 0.8);
}

.search-block .input-field > label {
  color: rgba(255, 255, 255, 0.8) !important;
}

.search-block .input-field input {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.5) !important;
}

.search-block .input-field input:focus {
  border-bottom-color: white !important;
  box-shadow: 0 1px 0 0 white !important;
}

.search-block .prefix {
  color: rgba(255, 255, 255, 0.8);
}

.assessment-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.assessment-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #212121;
}

.rating-scale {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.rating-bar {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, #f44336, #ff9800, #2196f3, #4caf50);
  border-radius: 4px;
  position: relative;
  margin-bottom: 12px;
}

.rating-indicator {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: #212121;
  border: 2px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
}

.assessment-text {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.product-card {
  margin-bottom: 24px;
}

.product-card .card {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}

.product-card .card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

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

.range-chips {
  margin-bottom: 16px;
}

.chart-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  display: none;
}

.hover-line {
  stroke: #666;
  stroke-width: 1;
  stroke-dasharray: 3,3;
  pointer-events: none;
}

.hover-dot {
  fill: var(--primary-color);
  stroke: white;
  stroke-width: 2;
  pointer-events: none;
}

/* Dark Theme */
[data-theme="dark"] {
  background: #121212;
  color: #e0e0e0;
}

[data-theme="dark"] .card {
  background: #1e1e1e;
  color: #e0e0e0;
}

[data-theme="dark"] .subtle {
  color: #9e9e9e;
}

[data-theme="dark"] .chip {
  background: #333333;
  color: #e0e0e0;
}

[data-theme="dark"] .chip.active {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .input-field > label {
  color: #9e9e9e !important;
}

[data-theme="dark"] .input-field input,
[data-theme="dark"] .input-field select {
  color: #e0e0e0;
}

[data-theme="dark"] .svg-wrap {
  background: #1e1e1e;
  border-color: #333333;
}

[data-theme="dark"] .axis-text {
  fill: #9e9e9e;
}

[data-theme="dark"] .axis-line {
  stroke: #333333;
}

[data-theme="dark"] .grid-line {
  stroke: #2e2e2e;
}

[data-theme="dark"] .btn-outline {
  border-color: #333333 !important;
  color: var(--primary-color) !important;
}

[data-theme="dark"] .divider-thin {
  background: #333333;
}

[data-theme="dark"] .product-img {
  border-color: #333333;
  background: #2e2e2e;
}

[data-theme="dark"] .toast {
  background: #333333 !important;
  color: #e0e0e0 !important;
}

[data-theme="dark"] .chart-tooltip {
  background: rgba(255, 255, 255, 0.9);
  color: #212121;
}

/* System theme detection */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    background: #121212;
    color: #e0e0e0;
  }
  
  [data-theme="system"] .card {
    background: #1e1e1e;
    color: #e0e0e0;
  }
  
  [data-theme="system"] .subtle {
    color: #9e9e9e;
  }
  
  [data-theme="system"] .chip {
    background: #333333;
    color: #e0e0e0;
  }
  
  [data-theme="system"] .chip.active {
    background: var(--primary-color);
    color: white;
  }
  
  [data-theme="system"] .input-field > label {
    color: #9e9e9e !important;
  }
  
  [data-theme="system"] .input-field input,
  [data-theme="system"] .input-field select {
    color: #e0e0e0;
  }
  
  [data-theme="system"] .svg-wrap {
    background: #1e1e1e;
    border-color: #333333;
  }
  
  [data-theme="system"] .axis-text {
    fill: #9e9e9e;
  }
  
  [data-theme="system"] .axis-line {
    stroke: #333333;
  }
  
  [data-theme="system"] .grid-line {
    stroke: #2e2e2e;
  }
  
  [data-theme="system"] .btn-outline {
    border-color: #333333 !important;
    color: var(--primary-color) !important;
  }
  
  [data-theme="system"] .divider-thin {
    background: #333333;
  }
  
  [data-theme="system"] .product-img {
    border-color: #333333;
    background: #2e2e2e;
  }
  
  [data-theme="system"] .toast {
    background: #333333 !important;
    color: #e0e0e0 !important;
  }
  
  [data-theme="system"] .chart-tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: #212121;
  }
}