body.theme-selenium {
  --highlight: #00ae00;
}

body.theme-firefox {
  --highlight: #ff7a3a;
}

body.theme-purple {
  --highlight: #4c268f;
}

html {
  font-family: Arial;
}

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

h3 {
  background: var(--highlight);
  margin: 0;
  padding: 20px;
  color: white;
  font-size: 30px;
}

.separator {
  background: var(--highlight);
  width: 100%;
  height: 3px;
}

button {
  border: 0;
  background: var(--highlight);
  border-radius: 2px;
  height: 22px;
  padding: 0 10px;
  color: white;
  cursor: pointer;
}

button[disabled] {
  background: #b9b9b9;
  cursor: default;
}

#url {
  width: 300px;
}

#connect {
  width: 100px;
  text-align: center;
}

#connection-help {
  margin-top: 10px;
  font-size: 0.8em;
}

#connection-help span {
  background-color: #aaa;
  color: white;
  padding: 3px 6px;
  border-radius: 2px;
}

.wrapper {
  padding: 0 20px 20px 20px;
}

#commands-list {
  height: 300px;
  overflow: auto;
  border: 1px solid gray;
}

.command {
  display: grid;
  grid-template-columns: max-content 260px max-content auto max-content;
  column-gap: 10px;
  border-block: 1px solid gray;
  border-bottom-width: 0;
  height: 30px;
  align-items: center;
  padding: 0 5px;
}

.command:hover {
  background-color: rgb(200, 245, 200);
}

.command:first-child {
  border-top-width: 0px;
}

.command:last-child {
  border-bottom-width: 0px;
}

.command-send {
  justify-self: end;
}

.command-delete {
  background: #dc3545;
  color: white;
  border: 0;
  border-radius: 2px;
  height: 22px;
  width: 22px;
  padding: 0;
  font-size: 18px;
  line-height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.command-delete:hover {
  background: #c82333;
}

.command-info {
  font-size: 0.8em;
  padding: 4px 7px;
  border-radius: 3px;
  color: #555;
  background: #eee;
}

.command-method,
.command-params {
  font-family: monaco;
  font-size: 0.8em;
  overflow: hidden;
  flex-grow: 1;
  text-overflow: ellipsis;
}

#add-command-button {
  margin-top: 10px;
}

.input-error {
  border: 2px solid #dc3545 !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.container-header {
  display: flex;
  align-items: center;
}

.container-header button {
  margin-left: 10px;
}

.log {
  min-height: 30px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 70px auto;
  align-content: center;
  font-size: 0.8em;
  column-gap: 20px;
  border-bottom: 1px solid #eee;
}

.log:first-child {
  border-top: 1px solid #eee;
}

.log.event {
  grid-template-columns: 30px auto 200px;
  border: 1px solid #ddd;
  border-width: 1px 0 0 0;
}

.log.event:last-child {
  border-width: 1px 0 1px 0;
}

.log-text,
.log-id {
  margin: 6px 0;
}

.log-text {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-family: monaco;
  font-size: 1.1em;
}

.expanded .log-text {
  white-space: pre;
  max-height: 200px;
  overflow: auto;
}

.log-id {
  justify-self: start;
  line-height: 18px;
  border-radius: 3px;
  color: #555555;
  background: #eeeeee;
  padding: 0 5px;
  width: 70px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.log-id::after {
  content: "▶︎";
  font-size: 8px;
  display: inline-block;
  width: 12px;
  right: 0;
  position: absolute;
}

.expanded .log-id::after {
  content: "▼";
}

#fake-event,
#fake-request {
  grid-template-columns: auto;
}

.log.event .log-id {
  width: 32px;
  border-radius: 3px;
  color: #555;
  background: #eee;
}

.log-time {
  justify-self: end;
  line-height: 20px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 0;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}

.tab-button {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s;
  height: 35px;
}

.tab-button:hover {
  background: #e8e8e8;
}

.tab-button.active {
  background: white;
  color: var(--highlight);
  border-bottom: 2px solid white;
  margin-bottom: -2px;
}

.tab-panels {
  border: 1px solid #ddd;
  border-top: none;
}

.tab-panel {
  display: none;
}

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

.commands-list {
  height: 300px;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Enhanced command display */
.command {
  display: grid;
  grid-template-columns: max-content 260px max-content auto max-content max-content;
  column-gap: 10px;
  border-block: 1px solid gray;
  border-bottom-width: 0;
  height: 30px;
  align-items: center;
  padding: 0 5px;
  overflow: visible;
}

.custom-command {
  grid-template-columns: max-content 260px max-content auto max-content max-content max-content;
}

.command-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.command-spec-link {
  font-size: 1em;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.command-spec-link:hover {
  opacity: 1;
}

.command-hint-button {
  background: #f0f0f0;
  color: #666;
  font-size: 0.8em;
  padding: 2px 8px;
  height: 20px;
  border-radius: 3px;
  cursor: help;
  position: relative;
}

.command-hint-button:hover {
  background: #e0e0e0;
}

.command-hint-button.no-params {
  background: #f8f8f8;
}

.command-hint-button.no-params .hint-icon {
  opacity: 0.4;
  color: #999;
}

.command-hint-button.no-params:hover {
  background: #f0f0f0;
}

.command-hint-button.no-params:hover .hint-icon {
  opacity: 0.6;
}

/* Tooltip for parameter hints */
.command-hint {
  display: none;
  position: fixed;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  white-space: pre-line;
  min-width: 250px;
  max-width: 400px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  pointer-events: none;
  text-align: left;
}

.command-hint strong {
  font-weight: bold;
  color: #fff;
}

.command-hint em {
  font-style: italic;
  color: #ccc;
}
