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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.6;
}

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

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

h1 {
  color: #2563eb;
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.subtitle {
  color: #64748b;
  font-size: 1.1rem;
}

.info-box {
  background: #e0f2fe;
  border-left: 4px solid #0284c7;
  padding: 15px;
  margin: 20px auto;
  max-width: 700px;
  border-radius: 4px;
  text-align: left;
}

.info-box h3 {
  color: #0284c7;
  margin-bottom: 8px;
}

.input-section {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.input-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

#smiles-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  resize: vertical;
  min-height: 60px;
}

#smiles-input:focus {
  outline: none;
  border-color: #2563eb;
}

#enumerate-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  transition: background 0.2s;
}

#enumerate-btn:hover {
  background: #1d4ed8;
}

#enumerate-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.examples {
  margin-top: 20px;
}

.examples p {
  margin-bottom: 10px;
}

.example-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.example-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.limitations {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.limitations ul {
  list-style: none;
  padding-left: 0;
}

.limitations li {
  padding: 4px 0;
  font-size: 14px;
  color: #475569;
}

.limitations li::before {
  content: "• ";
  color: #64748b;
}

.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-message {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.results-section {
  margin-top: 30px;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 25px;
  margin-bottom: 25px;
}

.summary-card h2 {
  color: #2563eb;
  margin-bottom: 20px;
}

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.stat label {
  font-weight: 600;
  min-width: 160px;
}

.stat code {
  font-family: 'Courier New', monospace;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  word-break: break-all;
}

.icon-btn {
  background: #e2e8f0;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: #cbd5e1;
}

.info-message {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 12px;
  margin: 15px 0;
  border-radius: 4px;
  color: #92400e;
}

.tautomers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tautomer-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s;
}

.tautomer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.tautomer-card.canonical {
  border-color: #10b981;
  border-width: 3px;
  background: #f0fdf4;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rank {
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.badge-canonical {
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.structure {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  min-height: 200px;
  align-items: center;
}

.structure svg {
  max-width: 100%;
  height: auto;
}

.details {
  margin-top: 15px;
}

.smiles-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.smiles {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 4px;
  flex: 1;
  word-break: break-all;
}

.copy-btn {
  background: #e2e8f0;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #cbd5e1;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-row label {
  font-size: 13px;
  color: #64748b;
}

.score {
  font-weight: 600;
  color: #0f172a;
}

.score-note {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.export-section {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.export-section button {
  background: #475569;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.export-section button:hover {
  background: #334155;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
  
  .tautomers-grid {
    grid-template-columns: 1fr;
  }
  
  .stat {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .stat label {
    min-width: auto;
  }
}
