:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

#app {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

h1, h2 {
  text-align: center;
  margin-bottom: 1rem;
}

section {
  margin-bottom: 2rem;
}

.auction-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.auction-list.loading {
  display: block;
  text-align: center;
  font-style: italic;
  color: #aaa;
}

.auction-item {
  background-color: #333;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out;
  overflow: hidden;
}

.auction-item:hover {
  transform: translateY(-3px);
}

.auction-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.auction-item h2 {
  font-size: 1.3em;
  margin-bottom: 0.5rem;
  color: #eee;
  text-align: left;
}

.auction-item p {
  font-size: 0.95em;
  margin: 0.2rem 0;
  color: #ccc;
}

.auction-item .original-title {
  font-size: 0.85em;
  color: #999;
  font-style: italic;
  margin-top: -0.3rem;
}

.auction-item .summary {
  font-style: italic;
  color: #bbb;
}

.auction-item .price {
  font-weight: bold;
  color: #d0d0d0;
}

.auction-item a {
  display: inline-block;
  background-color: #5a5afc;
  color: white;
  padding: 0.6em 1.2em;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
  text-align: center;
}

.auction-item a:hover {
  background-color: #4848d8;
}

.auction-item .processed-at,
.auction-item .auction-id {
  font-size: 0.75em;
  color: #888;
  margin-top: 0.8rem;
}

.summary {
  font-style: italic;
  margin-bottom: 1rem;
}

.price-change {
  color: #ff6b6b;
  font-weight: bold;
}

.last-updated {
  font-size: 0.8em;
  color: #888;
  margin-top: 1rem;
}

.auction-image.single-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 0;
}

.auction-image-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #444;
  color: #888;
  font-style: italic;
  border-bottom: 1px solid #555;
}

.image-gallery {
  position: relative;
  width: 100%;
  height: 180px;
  background-color: #2c2c2c;
}

.image-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.image-gallery button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 0.6em 0.9em;
  cursor: pointer;
  z-index: 10;
  border-radius: 4px;
  font-size: 1.1em;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s;
}

.image-gallery button:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.8);
}

.image-gallery .gallery-prev {
  left: 8px;
}

.image-gallery .gallery-next {
  right: 8px;
}

.image-gallery .gallery-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25em 0.6em;
  font-size: 0.8em;
  border-radius: 3px;
  z-index: 10;
}

body.light-theme .image-gallery {
  background-color: #e9ecef;
}

body.light-theme .image-gallery button {
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
}

body.light-theme .image-gallery button:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

body.light-theme .image-gallery .gallery-counter {
  background-color: rgba(255, 255, 255, 0.8);
  color: #333;
}

body.light-theme .auction-image-placeholder {
  background-color: #e9ecef;
  color: #6c757d;
  border-bottom: 1px solid #dee2e6;
}

body.light-theme {
  color-scheme: light;
  color: #212529;
  background-color: #f8f9fa;
}

body.light-theme .auction-item {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.light-theme h1,
body.light-theme h2 {
   color: #343a40;
}

body.light-theme .auction-item h2 {
   color: #343a40;
}

body.light-theme .auction-item p {
  color: #495057;
}

body.light-theme .auction-item .original-title { color: #6c757d; }
body.light-theme .auction-item .summary { color: #6c757d; }
body.light-theme .auction-item .price { color: #343a40; font-weight: bold;}
body.light-theme .auction-item .auction-id { color: #6c757d; }

body.light-theme .auction-item a {
   background-color: #007bff;
   color: white;
 }

 body.light-theme .auction-item a:hover {
   background-color: #0056b3;
 }

 body.light-theme .auction-list.loading {
  color: #6c757d;
 }

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Tab Navigation Styles */
.tab-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  border-bottom: 2px solid #444;
}

.tab-button {
  padding: 0.8em 1.5em;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 1.1em;
  color: #ccc;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tab-button:hover {
  color: #fff;
}

.tab-button.active {
  color: #eee;
  font-weight: 600;
  border-bottom-color: #5a5afc;
}

/* Tab Content Styles */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

section h2 {
  margin-top: 1.5rem;
}

/* --- Light Theme Adjustments --- */
body.light-theme .tab-nav {
  border-bottom-color: #dee2e6;
}

body.light-theme .tab-button {
  color: #6c757d;
}

body.light-theme .tab-button:hover {
  color: #343a40;
}

body.light-theme .tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
}
