/* Styles for /newline-to-escape/ and /id/newline-to-escape/
   Extends site-wide /style.css with the two-column workspace layout */

/* Full-width wrapper without sidebar */
.page-wrapper {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: block;
}

/* Two-column tool layout: Column 1 (Input + Output), Column 2 (Settings) */
.tool-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr);
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2rem;
}

.tool-main-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.tool-settings-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.settings-title {
  font-size: 1.15rem !important;
  margin: 0 !important;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.panel-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 !important;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.mini-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 4px;
  background-color: #edf2f7;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  min-width: auto;
  flex: initial;
  transition: background-color 0.2s, border-color 0.2s;
}

.mini-btn:hover {
  background-color: #e2e8f0;
  border-color: var(--primary-color);
}

.presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
}

.presets-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-right: 0.25rem;
}

.input-section,
.buttons-section,
.output-section {
  margin-bottom: 0;
}

#inputText,
#outputText {
  min-height: 175px;
  margin-bottom: 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.93rem;
  line-height: 1.5;
}

#outputText {
  background-color: #f8f9fa;
}

.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

.stats-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.stats-items p {
  margin: 0 !important;
  color: #555;
}

.stats-items span {
  font-weight: 700;
  color: var(--primary-color);
}

.notification {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

/* Settings column styles */
.option-group {
  margin: 0;
  padding: 1rem;
  background-color: #fff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.group-legend {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary-color);
  padding: 0 0.35rem;
  margin-bottom: 0.35rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0;
  font-size: 0.92rem;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  margin-top: 0.22rem;
}

.option-item label {
  cursor: pointer;
  font-weight: 500;
  flex: 1;
}

.option-item.stacked {
  flex-direction: column;
  gap: 0.3rem;
}

.option-item.stacked label {
  flex: initial;
}

.option-item select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.92rem;
  font-family: inherit;
  background-color: #fff;
  cursor: pointer;
}

.option-item.is-disabled {
  opacity: 0.5;
}

.option-item.is-disabled label,
.option-item.is-disabled select {
  cursor: not-allowed;
}

.help-text {
  font-size: 0.78rem;
  color: #666;
  width: 100%;
  padding-left: 1.4rem;
  margin-top: -0.15rem;
}

.option-item.stacked .help-text {
  padding-left: 0;
  margin-top: 0;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background-color: #fff;
  overflow: hidden;
}

.faq-item summary {
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: bold;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0.75rem 1.1rem 1rem 1.1rem;
  color: #555;
  border-top: 1px solid #f0f0f0;
}

.related-tools-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 900px) {
  .tool-two-col {
    grid-template-columns: 1fr;
  }

  .tool-settings-col {
    position: static;
  }
}
