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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

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

header {
  background: #161b22;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  border: 1px solid #30363d;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.header-text {
  flex: 1;
}

header h1 {
  font-size: 28px;
  color: #58a6ff;
  margin-bottom: 5px;
  font-weight: 600;
}

header p {
  color: #8b949e;
  font-size: 14px;
}

.main-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

@media (max-width: 968px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Filter Panel */
.filter-panel {
  background: #161b22;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  height: fit-content;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  border: 1px solid #30363d;
}

.filter-panel h2 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #c9d1d9;
}

.reset-btn {
  width: 100%;
  padding: 10px;
  background: #238636;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 20px;
  transition: background 0.3s;
  font-weight: 500;
}

.reset-btn:hover {
  background: #2ea043;
}

.filter-group {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #30363d;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #c9d1d9;
  font-size: 14px;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
  background: #0d1117;
  color: #c9d1d9;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #58a6ff;
  background: #161b22;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-inputs input {
  flex: 1;
}

.range-inputs span {
  color: #8b949e;
  font-size: 13px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
  margin: 0;
  color: #c9d1d9;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
  accent-color: #58a6ff;
}

/* Scrollbar styling for dark theme */
.filter-panel::-webkit-scrollbar,
.gemstone-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.filter-panel::-webkit-scrollbar-track,
.gemstone-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: #0d1117;
  border-radius: 4px;
}

.filter-panel::-webkit-scrollbar-thumb,
.gemstone-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.filter-panel::-webkit-scrollbar-thumb:hover,
.gemstone-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* Gemstone Panel */
.gemstone-panel {
  background: #161b22;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid #30363d;
}

.gemstone-panel h2 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #c9d1d9;
}

#matchCount {
  color: #58a6ff;
  font-weight: bold;
}

.search-container {
  margin-bottom: 15px;
}

.search-input {
  width: 100%;
  padding: 10px 15px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 14px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #58a6ff;
  background: #161b22;
}

.search-input::placeholder {
  color: #8b949e;
}

.gemstone-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 5px;
}

.gemstone-item {
  background: #0d1117;
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid #30363d;
}

.gemstone-item:hover {
  background: #161b22;
  border-color: #58a6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.gemstone-item.match {
  order: -1;
}

.gemstone-item.no-match {
  opacity: 0.3;
  order: 1;
}

.gemstone-item h3 {
  font-size: 16px;
  color: #58a6ff;
  margin-bottom: 6px;
  font-weight: 600;
}

.gemstone-item .variety {
  font-size: 12px;
  color: #8b949e;
  font-style: italic;
  margin-bottom: 8px;
}

.gemstone-item .quick-info {
  font-size: 12px;
  color: #8b949e;
  margin-top: 8px;
  line-height: 1.8;
}

.gemstone-item .info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.gemstone-item .info-label {
  color: #8b949e;
  font-weight: 500;
}

.gemstone-item .info-value {
  color: #c9d1d9;
  font-weight: 400;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #161b22;
  margin: 50px auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid #30363d;
}

.close {
  color: #8b949e;
  float: right;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
  transition: color 0.3s;
}

.close:hover {
  color: #c9d1d9;
}

.gem-detail h2 {
  color: #58a6ff;
  font-size: 28px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #30363d;
}

.gem-detail .property {
  margin-bottom: 15px;
  padding: 12px;
  background: #0d1117;
  border-radius: 6px;
  border: 1px solid #30363d;
}

.gem-detail .property strong {
  color: #c9d1d9;
  display: inline-block;
  min-width: 200px;
}

.gem-detail .property-value {
  color: #8b949e;
}

.gem-detail .section-title {
  font-size: 18px;
  color: #58a6ff;
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}