/* ── Visual CSS Selector & REST API Builder Subpage Styles ── */

@import url("../link-auditor/link-auditor.css");

/* Control panel spacing extensions */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-panel .ws-card {
  padding: 32px !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-panel .ws-card .ws-card-header {
  margin-bottom: 0;
}

.control-panel .control-group {
  margin-bottom: 0;
}

.control-panel label {
  margin-bottom: 8px;
}

/* Dynamic Recipe Rows */
.recipe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  animation: fadeUp 0.3s var(--ease);
  transition: border-color 0.2s, background 0.2s;
}

.recipe-row:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.recipe-input-field {
  flex: 1.1;
  min-width: 0; /* Critical fix to prevent flexbox overflow */
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  color: var(--fg) !important;
  outline: none;
  font-family: inherit;
}

.recipe-input-selector {
  flex: 1.8;
  min-width: 0; /* Critical fix to prevent flexbox overflow */
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  color: var(--fg) !important;
  outline: none;
  font-family: "JetBrains Mono", monospace !important;
}

.recipe-input-field:focus,
.recipe-input-selector:focus {
  border-color: var(--border-hover) !important;
  background: var(--surface-3) !important;
}

.recipe-delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 6px;
  font-size: 0.84rem;
  transition: transform 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recipe-delete-btn:hover {
  color: #f87171;
  transform: scale(1.12);
}

/* Responsive Recipe Rows for Mobile and Tablets */
@media (max-width: 600px) {
  .recipe-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
  }
  
  .recipe-delete-btn {
    align-self: flex-end;
    padding: 4px;
  }
}

/* Browser Simulator Chips */
.simulator-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: "JetBrains Mono", monospace;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
  transition: all 0.25s var(--ease);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.02);
  cursor: default;
}

.simulator-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
}

.simulator-chip.empty {
  background: rgba(255, 255, 255, 0.01);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--fg-40);
  box-shadow: none;
}

/* Group lists */
.simulator-group-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 14px;
  border-radius: 8px;
  animation: fadeUp 0.35s var(--ease);
  transition: border-color 0.25s;
}

.simulator-group-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.simulator-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--fg-40);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.simulator-match-item {
  display: flex;
  align-items: start;
  gap: 10px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}

.simulator-match-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.simulator-match-tag {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: #fbbf24;
}

.simulator-match-val {
  font-family: "JetBrains Mono", monospace;
  color: var(--fg-80);
  word-break: break-all;
}

/* Custom code preview coloring override */
.code-view-container code {
  color: #f472b6; /* elegant rose coding syntax highlight */
}

/* Glassmorphic Copy Code Widget */
#btn-copy-code {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s var(--ease) !important;
}

#btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--fg) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
