* { box-sizing: border-box; }
body { 
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; 
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem 2rem;
  background: #2c3e50;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.section {
  background: transparent;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.section-title h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #2c3e50;
}

.section-emoji {
  font-size: 1.4rem;
}

.section-desc {
  margin: 0 0 1rem 0;
  color: #555;
}

.container {
  display: flex;
  flex: none;
  overflow: hidden;
  height: calc(90vh - 5rem);
  max-height: 800px;
}

.left-panel {
  width: 40%;
  min-width: 400px;
  padding: 2rem;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  background: #f9f9f9;
}

.right-panel {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: white;
  display: flex;
  flex-direction: column;
}

.right-panel .section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea { 
  width: 100%; 
  height: 200px; 
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

button { 
  margin-top: 1.5rem; 
  padding: 0.75rem 2rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: block;
  width: 100%;
}

button:hover:not(:disabled) {
  background: #2980b9;
}

button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

/* Loading Spinner */
.spinner-container {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
}

.spinner-container.active {
  display: flex;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #95a5a6;
  text-align: center;
  padding: 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  color: #7f8c8d;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state h3 {
  color: #7f8c8d;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.empty-state p {
  color: #95a5a6;
  font-size: 1rem;
}

/* Results */
#results {
  display: none;
}

#results.active {
  display: block;
}

/* Map */
#mapContainer {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

#map {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.result-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: #fafafa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.result-header {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.result-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.status-resolved {
  background: #d4edda;
  color: #155724;
}

.result-selected {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 4px;
  border-left: 3px solid #3498db;
}

.result-label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.result-value {
  color: #333;
  margin-top: 0.25rem;
}

.model-info {
  background: #e3f2fd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.model-info-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.error {
  background: #ffebee;
  color: #c62828;
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid #c62828;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.docs {
  padding: 3rem 2rem;
  background: #f7f9fb;
  border-top: 1px solid #e0e6ed;
}

.docs-content {
  max-width: 900px;
  margin: 0 auto;
}

.docs-section {
  margin-bottom: 2.5rem;
}

.docs-section h3 {
  font-size: 1.5rem;
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.docs-section h4 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 600;
}

.docs-section > p {
  color: #555;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.endpoint-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin: 1rem 0;
}

.http-method {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: #10b981;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.endpoint-path {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #1a1a1a;
  font-weight: 500;
}

.params-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin: 1rem 0;
}

.params-table thead {
  background: #f5f7f9;
}

.params-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
  border-bottom: 2px solid #e0e0e0;
}

.params-table td {
  padding: 0.75rem 1rem;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.params-table tbody tr:last-child td {
  border-bottom: none;
}

.params-table code {
  background: #f5f7f9;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

.badge-required {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: #fee;
  color: #c62828;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-optional {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: #e8f4f8;
  color: #2980b9;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .left-panel {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
}
