/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    Gill Sans,
    sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 20px auto;
}

#search-bar {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  margin-right: 15px;
  width: 200px;
  background-color: #2c2c2c;
  color: #e0e0e0;
}

#search-bar::placeholder {
  color: #a0a0a0;
}

#theme-toggle {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s;
}

#theme-toggle:hover {
  color: #1abc9c;
}

/* Dashboard Section */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.chart-container {
  flex: 1 1 45%;
  background-color: #1f1f1f;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

.chart-container canvas {
  width: 100% !important;
  height: 300px !important;
}

/* Filters Section */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  background-color: #1f1f1f;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-item label {
  margin-bottom: 5px;
  font-weight: 500;
}

.filter-item input[type='range'] {
  width: 200px;
}

.filter-item input[type='number'],
.filter-item select {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background-color: #2c2c2c;
  color: #e0e0e0;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Item Card */
.item-card {
  background-color: #1f1f1f;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.9);
}

.item-card-header {
  background-color: #1abc9c;
  padding: 10px 15px;
  display: flex;
  align-items: center;
}

.item-card-header i {
  margin-right: 8px;
  color: #121212;
}

.item-card-body {
  padding: 15px;
  flex-grow: 1;
}

.item-card-body h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.item-card-body p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.item-card-footer {
  padding: 10px 15px;
  background-color: #2c2c2c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-card-footer span {
  font-weight: 500;
}

.item-card-footer .price {
  color: #1abc9c;
  font-weight: 700;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.pagination button {
  background-color: #1abc9c;
  color: #121212;
  border: none;
  padding: 8px 12px;
  margin: 0 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.pagination button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
  background-color: #16a085;
}

#current-page {
  font-size: 1rem;
  color: #e0e0e0;
  margin: 0 10px;
}

/* Notes */
.note {
  text-align: center;
  margin-top: 10px;
  color: #a0a0a0;
  font-size: 0.9rem;
}

/* Light Mode Overrides */
body.light-mode {
  background-color: #f5f5f5;
  color: #333333;
}

body.light-mode .logo {
  color: #1abc9c;
}

body.light-mode #search-bar {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode #search-bar::placeholder {
  color: #a0a0a0;
}

body.light-mode #theme-toggle {
  color: #1abc9c;
}

body.light-mode #theme-toggle:hover {
  color: #16a085;
}

body.light-mode .dashboard .chart-container {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode .filters {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode .filter-item input[type='number'],
body.light-mode .filter-item select {
  background-color: #f0f0f0;
  color: #333333;
}

body.light-mode .items-grid .item-card {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode .item-card-header {
  background-color: #1abc9c;
  color: #ffffff;
}

body.light-mode .item-card-footer {
  background-color: #e0e0e0;
  color: #333333;
}

body.light-mode .item-card-footer .price {
  color: #16a085;
}

body.light-mode .pagination button {
  background-color: #1abc9c;
  color: #ffffff;
}

body.light-mode .pagination button:hover:not(:disabled) {
  background-color: #16a085;
}

body.light-mode .note {
  color: #666666;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard {
    flex-direction: column;
  }

  .chart-container {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  #search-bar {
    width: 100%;
    margin: 10px 0;
  }

  .filters {
    flex-direction: column;
  }

  .filter-item input[type='range'] {
    width: 100%;
  }

  #profitable-items thead {
    display: none;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
