/* Reusable UI components: buttons, cards, forms, tree nodes, outputs, and status boxes. */

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  background: var(--app-primary);
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: var(--app-radius-xs);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover,
button:hover {
  background: var(--app-primary-hover);
  border-color: #ffffff;
  color: #000000;
}

.button-secondary {
  background: var(--app-secondary-bg);
  color: var(--app-text);
  border-color: #ffffff;
}

.button-secondary:hover {
  background: var(--app-secondary-hover);
  border-color: #ffffff;
  color: var(--app-text);
}

.button-success {
  background: var(--app-success);
  border-color: #ffffff;
  color: #ffffff;
}

.button-success:hover {
  background: var(--app-success-hover);
  border-color: #ffffff;
  color: #ffffff;
}

.button-danger {
  background: var(--app-danger);
  border-color: #ffffff;
  color: #ffffff;
}

.button-danger:hover {
  background: var(--app-danger-hover);
  border-color: #ffffff;
  color: #ffffff;
}

.header-actions .button {
  min-height: 34px;
  padding: 7px 14px;
  background: transparent;
  color: var(--app-muted-strong);
  border-color: #ffffff;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
}

.header-actions .button:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
  border-color: #ffffff;
}

.choice-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 132px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(180deg, #181818 0%, #0f0f0f 100%);
  color: var(--app-text);
  border: 2px solid #ffffff;
  border-radius: var(--app-radius);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 44px rgba(0, 0, 0, 0.35);
}

.choice-card:hover {
  background: linear-gradient(180deg, #202020 0%, #121212 100%);
  border-color: #ffffff;
  color: var(--app-text);
}

.choice-card:hover strong {
  color: var(--app-text);
}

.choice-card:hover span {
  color: var(--app-muted-strong);
}

.choice-card strong {
  color: var(--app-text);
  font-size: 17px;
  text-align: center;
}

.choice-card span {
  max-width: 320px;
  color: var(--app-muted-strong);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.guidance-card,
.file-status-box,
.advisor-suggestion-box,
.folder-tree-preview,
.archive-result-box,
.structure-output,
.examples-box,
.fixed-type {
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
}

.guidance-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px;
  margin-bottom: 14px;
  text-align: center;
}

.safety-warning {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: var(--app-radius-sm);
  background: rgba(245, 158, 11, 0.1);
  color: var(--app-text);
  text-align: center;
}

.safety-warning strong {
  color: #fbbf24;
}

.safety-warning span {
  color: var(--app-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.main-backup-panel {
  width: min(760px, 100%);
  margin: 8px auto 0;
  padding: 10px 14px;
  border-color: var(--app-border-soft);
  background: var(--app-surface-soft);
  opacity: 0.9;
}

.main-backup-panel span {
  color: var(--app-muted-strong);
  font-size: 12px;
}

.companion-tip-panel {
  width: min(760px, 100%);
  margin: 10px auto 0;
  padding: 10px 14px;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-sm);
  color: var(--app-muted-strong);
  text-align: center;
}

.companion-tip-panel span {
  display: inline-block;
  color: var(--app-muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.everything-search-panel {
  text-align: center;
}

.everything-search-intro {
  max-width: 650px;
  margin: 0 auto 14px;
  color: var(--app-muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.everything-search-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.everything-search-form input,
.everything-search-form select {
  text-align: left;
}

.everything-search-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.everything-search-control {
  flex: 1 1 170px;
  max-width: 230px;
}

.everything-search-submit {
  display: flex;
  align-items: end;
}

.everything-search-submit .button {
  min-width: 120px;
}

.everything-search-status {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-xs);
  color: var(--app-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.everything-search-results {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.everything-search-results-meta {
  color: var(--app-muted);
  font-size: 12px;
  text-align: center;
}

.everything-search-results-list {
  display: grid;
  gap: 8px;
}

.everything-search-result {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #000000;
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-xs);
}

.everything-search-result strong {
  color: var(--app-text);
  font-size: 13px;
}

.everything-search-result span {
  color: var(--app-muted-strong);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.everything-search-result code {
  color: var(--app-muted);
  font-size: 11.5px;
  word-break: break-all;
}

.everything-search-empty {
  margin: 0;
  color: var(--app-muted);
  font-size: 12.5px;
  text-align: center;
}

.status-idle {
  color: var(--app-muted);
}

.status-loading {
  color: #fbbf24;
}

.status-success {
  color: #86efac;
}

.status-error {
  color: #fca5a5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.guidance-card strong {
  font-size: 13px;
  text-align: center;
}

.guidance-card span,
.small-note,
.file-status-box,
.advisor-suggestion-box,
.archive-result-box {
  color: var(--app-muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

.tree-container {
  padding: 2px 0 0;
  text-align: left;
}

.tree-children {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid var(--app-border-soft);
}

.tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 100%;
  margin: 1px 0;
  padding: 4px 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--app-radius-xs);
}

.tree-node:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--app-border-soft);
}

.main-category-node {
  margin-top: 5px;
  border-left: 2px solid var(--app-primary);
  background: rgba(255, 255, 255, 0.025);
}

.node-content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.node-name {
  color: var(--app-text);
  font-size: 12.5px;
  font-weight: 520;
  white-space: nowrap;
}

.main-category-node .node-name {
  font-size: 13px;
  font-weight: 620;
}

.folder-display-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: #171717;
  color: #e5e5e5;
  border: 1px solid var(--app-border);
  font-family: var(--app-mono);
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0;
}

.node-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.node-actions button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--app-muted-strong);
  font-size: 15px;
  font-weight: 650;
}

.node-actions button:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.node-actions button.danger:hover {
  color: #fca5a5;
}

.structure-output,
.folder-tree-preview {
  min-height: 170px;
  max-height: 360px;
  overflow: auto;
  padding: 13px;
  background: #000000;
  font-family: var(--app-mono);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.structure-output {
  white-space: pre-wrap;
}

.archive-tree-instruction,
.archive-selected-status {
  margin: 0 0 10px;
  color: var(--app-muted);
  font-family: var(--app-font);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

.archive-selected-status {
  margin: 12px 0 0;
  padding: 10px;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius-xs);
  color: var(--app-muted-strong);
}

.archive-tree-selectable {
  display: grid;
  gap: 2px;
}

.archive-tree-children {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid var(--app-border-soft);
}

.archive-destination-button {
  display: inline-flex;
  justify-content: flex-start;
  width: 100%;
  min-height: 30px;
  margin: 1px 0;
  padding: 5px 8px;
  background: transparent;
  color: var(--app-text);
  border: 1px solid transparent;
  border-radius: var(--app-radius-xs);
  font-family: var(--app-font);
  font-size: 12.5px;
  font-weight: 520;
  text-align: left;
}

.archive-destination-button:hover,
.archive-destination-button.archive-destination-selected {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
  color: var(--app-text);
}

.archive-main-destination {
  font-weight: 650;
}

.file-status-box,
.advisor-suggestion-box,
.archive-result-box {
  min-height: 48px;
  padding: 12px;
  text-align: center;
}

.advisor-suggestion-box {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.advisor-use-button {
  margin-top: 3px;
}

label {
  display: block;
  margin: 12px 0 5px;
  color: var(--app-text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  background: #000000;
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-xs);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a3a3a3;
  text-align: center;
}

.examples-box {
  margin-top: 10px;
  padding: 10px;
  color: var(--app-muted);
  font-size: 12.5px;
  text-align: center;
}

.fixed-type {
  margin-top: 10px;
  padding: 10px;
  color: var(--app-muted);
  font-size: 12.5px;
  text-align: center;
}
