body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
}

.header {
  background-color: #2c3e50;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.version-info {
  font-size: 14px;
  font-weight: normal;
  color: #a0b3c7;
  margin-left: 12px;
  opacity: 0.9;
}

.header-nav {
  display: flex;
  gap: 20px;
}

.header-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.header-nav a:hover {
  opacity: 0.8;
}

#preloader {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.preloader-content {
  width: min(420px, calc(100% - 40px));
  text-align: center;
  background: #111827;
  padding: 32px 40px;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.preloader-text {
  font-size: 18px;
  margin-bottom: 18px;
  color: #f9fafb;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
}

.progress-percent {
  font-size: 14px;
  font-weight: 600;
  color: #a7f3d0;
}

.app-container {
  display: flex;
  height: calc(100vh - 110px); /* Account for header and status banner height */
  overflow: hidden;
}

.sidebar {
  width: 450px;
  background-color: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.network-toggle {
  padding: 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.network-toggle label {
  margin-right: 15px;
  font-weight: 500;
  color: #333;
}

.network-indicator {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 3px;
  margin-left: 10px;
  font-size: 0.9em;
  font-weight: bold;
}

.network-indicator.testnet {
  background-color: #ff9800;
  color: white;
}

.network-indicator.mainnet {
  background-color: #4caf50;
  color: white;
}

.proof-toggle {
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-toggle label {
  font-weight: 500;
  color: #333;
  margin: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Style for SDK config details */
details.sdk-config summary::-webkit-details-marker {
  display: none;
}

details.sdk-config[open] summary span:last-child {
  transform: rotate(180deg);
  transition: transform 0.2s;
}

details.sdk-config summary span:last-child {
  transition: transform 0.2s;
}


.query-container {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.query-selector {
  margin-bottom: 20px;
}

.query-selector select {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  margin-bottom: 10px;
}

.query-inputs {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.input-group input[type="text"],
.input-group input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.query-inputs h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1em;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-size: 0.9em;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.input-group input[type="checkbox"] {
  width: auto;
  margin-right: 5px;
}

.input-group input[type="number"] {
  -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-inner-spin-button,
.input-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.optional-label {
  color: #888;
  font-size: 0.85em;
  font-style: italic;
}

.execute-button {
  width: 100%;
  padding: 12px;
  background-color: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

.execute-button:hover {
  background-color: #1565c0;
}

.execute-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.result-container {
  flex: 1;
  background-color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.result-split-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.result-data-section,
.result-proof-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid #e0e0e0;
}

.result-proof-section {
  border-bottom: none;
  background-color: #f8f9fa;
}

.section-header {
  padding: 10px 20px;
  background-color: #e3f2fd;
  border-bottom: 1px solid #ccc;
  font-weight: 600;
  color: #1976d2;
  font-size: 14px;
}

.result-proof-section .section-header {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.result-header {
  padding: 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.3em;
}

.result-actions button {
  margin-left: 10px;
  padding: 8px 16px;
  border: 1px solid #ddd;
  background-color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.result-actions button:hover {
  background-color: #f5f5f5;
}

.result-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.result-content.empty {
  color: #888;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.status-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  z-index: 999;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.status-banner.success {
  background-color: #4caf50;
  color: white;
}

.status-banner.error {
  background-color: #f44336;
  color: white;
}

.status-banner.loading {
  background-color: #ff9800;
  color: white;
}

.error-result {
  color: #d32f2f;
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  padding: 10px;
}

.credits-value {
  color: #1976d2;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  position: relative;
}

.credits-value:hover {
  background-color: #e3f2fd;
  border-radius: 3px;
  padding: 0 2px;
}

.credits-value::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 5px;
  z-index: 1000;
}

.credits-value:hover::after {
  opacity: 1;
}

.nonce-value {
  color: #9c27b0;
  cursor: help;
  position: relative;
}

.nonce-value:hover {
  background-color: #f3e5f5;
  border-radius: 3px;
  padding: 0 2px;
}

/* Enhanced tooltip for nonce with better formatting */
.nonce-value::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  white-space: pre;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 5px;
  z-index: 1000;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nonce-value:hover::after {
  opacity: 1;
}

.json-key {
  color: #d73a49;
  font-weight: 500;
}

.result-content pre {
  margin: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.mode-selector {
  margin-bottom: 15px;
  display: none;
}

.array-input-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background-color: #fafafa;
}

.array-item {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
}

.array-item input {
  flex: 1;
}

.array-item button {
  padding: 5px 10px;
  background-color: #ff5252;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.add-array-item {
  padding: 5px 15px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 5px;
}

.query-description {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #e3f2fd;
  border-radius: 4px;
  line-height: 1.4;
}

.action-button {
  padding: 8px 16px;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.action-button:hover {
  background-color: #1976d2;
}

.dynamic-fields-container {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fafafa;
}

.field-group {
  margin-bottom: 10px;
  padding: 8px;
  background-color: white;
  border-radius: 4px;
}

.field-group label {
  display: inline-block;
  width: 150px;
  font-weight: 500;
}

.where-field-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operator-select {
  width: 80px;
  background-color: white;
  color: #333;
  padding: 8px 35px 8px 10px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
}

.operator-select.has-value {
  background-image: none;
  padding-right: 10px;
}

.operator-select option {
  background-color: white;
  color: #333;
}

.operator-select option:checked {
  background-color: #007bff;
  color: white;
}

.where-value-input {
  flex: 1;
  min-width: 200px;
}

/* New styles for improved where clause UI */
.index-property-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85em;
  margin-left: 5px;
  font-weight: 500;
}

.index-property-first {
  background-color: #4caf50;
  color: white;
}

.index-property-second {
  background-color: #2196f3;
  color: white;
}

.index-property-third {
  background-color: #ff9800;
  color: white;
}

.compound-index-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 0.9em;
}

.query-preview {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  margin-top: 15px;
  font-family: monospace;
  font-size: 0.9em;
}

.query-preview h5 {
  margin-top: 0;
  color: #333;
}

.operator-help {
  font-size: 0.85em;
  color: #666;
  margin-left: 5px;
  cursor: help;
}

.range-group {
  border: 1px solid #e0e0e0;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  background-color: #f9f9f9;
}

.range-group-header {
  font-weight: 500;
  margin-bottom: 8px;
  color: #1976d2;
}

.add-range-button {
  padding: 4px 12px;
  background-color: #1976d2;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85em;
  margin-left: 10px;
}

.add-range-button:hover {
  background-color: #1565c0;
}

.between-info {
  background-color: #e3f2fd;
  padding: 8px;
  border-radius: 3px;
  margin-top: 8px;
  font-size: 0.85em;
  color: #1565c0;
}

.validation-error {
  color: #d32f2f;
  font-size: 0.85em;
  margin-top: 5px;
}

.field-type-indicator {
  font-size: 0.8em;
  color: #666;
  margin-left: 5px;
  font-style: italic;
}
