:root {
  --bg-color: #FFFFFF;
  --primary-color: #931507;
  --primary-hover: #931507;
  --text-color: #333;
  --error-color: #c00;
  --card-bg: #fff;
  --border-color: #ddd;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-color);
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-color);
}

.container {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0px;
}

header {
  text-align: center;
  margin-bottom: 0px;
}

header .header-content {
  margin-top: 0px;
  margin-bottom: 0px 
}

.main-content h1 {
  margin-top: 5px;
  margin-bottom: 0px;
  text-align: center;
  color: #070707;     
  font-size: 20px;  
}

.main-content p {
  margin-top: 0px;
  margin-bottom: 20px;
  text-align: center;
  color: #070707;      
  font-size: 14px;  
}


header h1 {
  margin-top: 5px;
  margin-bottom: 5px;
  text-align: center;
}
header p {
  margin: 5px 0; 
  text-align: center;
}

header img.logo {
  max-width: 200px;
  height: auto;
  margin-top: 0px; 
  margin-bottom: 0px;
}

.top-search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px;
}

.search-form-wrapper {
  width: 100%;
  max-width: 400px;
}

.search-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 14px;
}
.search-form input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  margin-bottom: 10px;
  font-size: 14px;
}

.search-form button {
  padding: 8px 12px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}
.search-form button:hover {
  background-color: var(--primary-hover);
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.molecule-draw {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.molecule-draw label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 14px;
}
#mwe_container,
#jsme_container {
  margin-top: 10px;
}

.error-message {
  color: var(--error-color);
  font-weight: bold;
  text-align: center;
}
.no-match {
  color: #666;
  text-align: center;
}

.results-section {
  margin-top: 20px;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  justify-items: center;
  margin-top: 20px;
}

.result-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.result-card:hover {
  transform: translateY(-2px);
}

.card-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
  text-align: center;
}

.card-body {
  margin-top: 10px;
  flex: 1;
}
.molecule-img {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.molecule-img svg {
  width: 120px;
  height: auto;
}

.descriptor-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.descriptor-table th,
.descriptor-table td {
  padding: 6px 8px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-footer {
  margin-top: 10px;
  text-align: center;
}
.card-footer button {
  padding: 6px 12px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}
.card-footer button:hover {
  background-color: var(--primary-hover);
}

.footer {
  background-color: #f2f2f2;
  color: #555;
  text-align: center;
  padding: 15px;
  border-top: 1px solid #ccc;
  font-size: 13px;
  margin-top: 0;
}

@media (max-width: 768px) {
  .top-search-container {
    flex-direction: column;
    align-items: center;
  }
  .search-form-wrapper,
  .molecule-draw {
    width: 100%;
    max-width: 400px;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
}
