/* Shared styles for all tools */
.converter-container, .tool-container {
  max-width: 900px;
  margin: 30px auto;
}

textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 20px;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.button-grid button, .button-row button, .btn-primary, .btn-secondary {
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.button-grid button:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--brand);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: #234a8a;
}

.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--panel);
}

.stats, .message {
  padding: 15px;
  background: var(--panel);
  border-radius: 6px;
  text-align: center;
  color: var(--muted);
}

.typeahead {
  position: fixed; /* Changed from absolute - positioned via JS */
  z-index: 9999; /* High z-index to appear above everything */
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
  padding: 6px 0; /* inner vertical spacing */
}

/* Ensure solid background in light theme */
:root .typeahead {
  background-color: #ffffff;
}

/* Ensure solid background in dark theme */
[data-theme="dark"] .typeahead {
  background-color: #161b26;
}
.typeahead-item {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  transition: background 0.1s ease, transform 0.05s ease;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.typeahead-item:last-child {
  border-bottom: none;
}
.typeahead-item.highlight,
.typeahead-item:hover {
  background: var(--panel);
  box-shadow: inset 3px 0 0 var(--brand); /* strong visual cue */
}
.typeahead-item:active {
  background: var(--accent);
  color: #ffffff;
  transform: scale(0.98);
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.tab-content {
  display: none;
  padding: 20px;
  background: var(--panel);
  border-radius: 0 8px 8px 8px;
}

.tab-content.active {
  display: block;
}

.file-input-area {
  margin: 20px 0;
  padding: 20px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}

.file-input-area input[type="file"] {
  margin-top: 10px;
}

.info-box, .features-box {
  margin: 30px 0;
  padding: 20px;
  background: var(--panel);
  border-left: 4px solid var(--brand);
  border-radius: 4px;
}

.info-box h3, .features-box h3 {
  margin-top: 0;
  color: var(--text);
}

.json-output, .hex-output, pre {
  width: 100%;
  padding: 15px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text);
  overflow-x: auto;
  min-height: 200px;
  margin-bottom: 15px;
  white-space: pre;
}

.json-output.formatted {
  white-space: pre-wrap;
}

