/* JSON to Excel tool. Hero, content sections, cards and FAQ come from
   tool_page.css; only the converter's own panels are here. */

/* The star field behind the hero is a positioned image, so the panels need
   their own stacking context or it swallows every click. */
.jx {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto 56px auto;
  padding: 0 16px;
}

.jx-panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.jx-panel-title {
  margin: 0 0 6px 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.jx-panel-title--spaced {
  margin-top: 24px;
}

.jx-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.jx-panel-actions {
  display: flex;
  gap: 8px;
}

/* The input sits beside its settings on a wide screen and above them on a
   narrow one, which is also the order they are used in. */
.jx-columns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .jx-columns-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.jx-mini {
  padding: 5px 12px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.jx-mini:hover {
  background: rgba(110, 0, 255, 0.35);
  color: #fff;
}

.jx-drop {
  position: relative;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  padding: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.jx-drop.is-over {
  border-color: #a06bff;
  background: rgba(110, 0, 255, 0.14);
}

.jx-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 12px;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

.jx-textarea::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.jx-textarea:focus,
.jx-input:focus,
.jx-select:focus {
  outline: 2px solid #a06bff;
  outline-offset: 1px;
}

.jx-drop-hint {
  margin: 8px 2px 0 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.jx-drop-hint i {
  margin-right: 4px;
}

.jx-file-label {
  color: #c4a2ff;
  cursor: pointer;
  text-decoration: underline;
  margin: 0;
}

.jx-file-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.jx-field {
  display: block;
  margin-bottom: 12px;
}

.jx-field-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.jx-select,
.jx-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 14px;
}

.jx-select option {
  background: #1b1130;
  color: #fff;
}

.jx-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.jx-check input {
  margin-top: 2px;
  accent-color: #6e00ff;
  flex-shrink: 0;
}

.jx-check input:disabled + span {
  opacity: 0.45;
}

.jx-hint {
  margin: 0 0 10px 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
  line-height: 1.5;
}

.jx-error {
  margin: 10px 0 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 120, 120, 0.4);
  background: rgba(255, 80, 80, 0.12);
  color: #ffc9c9;
  font-size: 13px;
  line-height: 1.5;
}

.jx-notices {
  margin: 0 0 12px 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  line-height: 1.6;
}

.jx-summary {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.jx-status {
  margin: 12px 2px 0 2px;
  min-height: 20px;
  color: #c4a2ff;
  font-size: 13px;
}

/* Column picker: a wrapping list rather than a single tall column, because a
   wide JSON can easily produce forty fields. */
.jx-column-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.jx-column {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.jx-column.is-off {
  opacity: 0.45;
}

.jx-column-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  min-width: 0;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.jx-column-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jx-column-label input {
  accent-color: #6e00ff;
  flex-shrink: 0;
}

.jx-column-moves {
  display: flex;
  flex-shrink: 0;
}

.jx-move {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 15px;
}

.jx-move:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.jx-move:disabled {
  opacity: 0.25;
  cursor: default;
}

.jx-table-wrap {
  overflow: auto;
  max-height: 440px;
  border-radius: 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.jx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.jx-table th,
.jx-table td {
  padding: 6px 10px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  border-right: 0.5px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The header stays put while the body scrolls, so a wide table keeps its
   column names in view. */
.jx-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #2a1a45;
  color: #fff;
  font-weight: 600;
}

.jx-table td {
  color: rgba(255, 255, 255, 0.86);
}

.jx-rownum {
  color: rgba(255, 255, 255, 0.35) !important;
  background: rgba(0, 0, 0, 0.3);
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  position: sticky;
  left: 0;
}

.jx-table thead .jx-rownum {
  z-index: 2;
}

/* A colour per type, so a number that arrived as text is visible at a glance
   rather than after opening the file. */
.jx-type-number {
  color: #9fd4ff !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.jx-type-boolean {
  color: #ffc98c !important;
}

.jx-type-date {
  color: #a8e6a3 !important;
}

.jx-type-empty {
  background: rgba(255, 255, 255, 0.03);
}

.jx-export {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 560px) {
  .jx-export .tp-btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .jx-column-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
