/* ==================================================
   TOOL LAYOUT
================================================== */

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 2.4rem;
  align-items: start;
}

/* ==================================================
   INPUT CARD
================================================== */

.tool-box {
  background: #ffffff;
  padding: 1.6rem 1.7rem;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

/* ==================================================
   FORM
================================================== */

.tool-form {
  display: grid;
  gap: 1.15rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #475569;
}

/* Inputs & Selects */
.tool-form input,
.tool-form select {
  width: 100%;
  height: 44px;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #020617;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-form input:focus,
.tool-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================================================
   SELECT DROPDOWN ARROW
================================================== */

.tool-form select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* ==================================================
   PRIMARY BUTTON
================================================== */

.primary-btn {
  margin-top: 0.6rem;
  height: 46px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  transition: background 0.15s ease, transform 0.05s ease;
}

.primary-btn:hover {
  background: #1e4ed8;
}

.primary-btn:active {
  transform: translateY(1px);
}

/* ==================================================
   RESULTS CARD
================================================== */

.tool-results {
  background: #f8fafc;
  padding: 1.45rem 1.55rem;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.tool-results h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #020617;
}

/* ==================================================
   RESULTS GRID
================================================== */

.results-grid {
  display: grid;
  gap: 0.9rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-label {
  font-size: 0.78rem;
  color: #64748b;
}

.result-item strong {
  font-size: 1.1rem;
  font-weight: 600;
  color: #020617;
  letter-spacing: 0.2px;
}

/* ==================================================
   CHART
================================================== */

.chart-wrapper {
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #e5e7eb;
  display: flex;
  justify-content: center;
}

.chart-wrapper canvas {
  max-width: 100%;
  height: auto;
}

/* ==================================================
   CONTENT ARTICLE (LONG FORM)
================================================== */

.content-article {
  width: 90%;
  margin: 3.5rem auto 0;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #1f2937;
}

.content-article h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #020617;
  margin-bottom: 1.3rem;
  letter-spacing: -0.01em;
}

.content-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #020617;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #e5e7eb;
}

.content-article h3:first-of-type {
  border-top: none;
  padding-top: 0;
}

.content-article p {
  margin-bottom: 0.85rem;
  color: #374151;
}

.content-article h3 + p {
  margin-top: 0.4rem;
}

.content-article strong {
  font-weight: 600;
  color: #020617;
}

.content-article em {
  font-style: italic;
  color: #1e293b;
}

.content-article p strong {
  background: linear-gradient(
    transparent 65%,
    rgba(37, 99, 235, 0.12) 65%
  );
  padding: 0 2px;
  border-radius: 3px;
}

.content-article p:last-child {
  margin-bottom: 0;
}

/* ==================================================
   RESPONSIVE — TABLET
================================================== */

@media (max-width: 1024px) {
  .tool-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tool-box,
  .tool-results {
    padding: 1.4rem;
  }

  .result-item strong {
    font-size: 1.05rem;
  }
}

/* ==================================================
   RESPONSIVE — MOBILE
================================================== */

@media (max-width: 768px) {
  .tool-form {
    gap: 1rem;
  }

  .tool-form input,
  .tool-form select {
    height: 46px;
    font-size: 0.9rem;
  }

  .primary-btn {
    height: 48px;
    font-size: 0.95rem;
  }

  .content-article {
    width: 90%;
    margin-top: 2.5rem;
    font-size: 0.94rem;
  }

  .content-article h2 {
    font-size: 1.35rem;
  }

  .content-article h3 {
    font-size: 1.05rem;
    margin-top: 1.8rem;
  }
}

/* ==================================================
   RESPONSIVE — SMALL MOBILE
================================================== */

@media (max-width: 480px) {
  .tool-box,
  .tool-results {
    padding: 1.25rem 1.2rem;
    border-radius: 14px;
  }

  .form-field label {
    font-size: 0.75rem;
  }

  .tool-form input,
  .tool-form select {
    height: 48px;
    font-size: 0.92rem;
  }

  .primary-btn {
    height: 50px;
    font-size: 1rem;
  }

  .results-grid {
    gap: 0.75rem;
  }

  .result-label {
    font-size: 0.75rem;
  }

  .result-item strong {
    font-size: 1rem;
  }

  .content-article {
    width: 100%;
    font-size: 0.93rem;
  }

  .content-article h2 {
    font-size: 1.25rem;
  }

  .content-article h3 {
    font-size: 1rem;
  }
}

/* =========================
   QubeTools – MODERN TOOL SKELETON
========================= */

.tool-results {
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

/* Hide actual content */
.tool-results.is-loading * {
  visibility: hidden;
}

/* Skeleton overlay */
.tool-results.is-loading::after {
  content: "";
  position: absolute;
  inset: 1.4rem 1.5rem;
  border-radius: 14px;
  z-index: 20;
  pointer-events: none;

  /* Skeleton layers */
  background:
    /* shimmer overlay */
    linear-gradient(
      110deg,
      rgba(79,108,255,0) 40%,
      rgba(79,108,255,0.18) 50%,
      rgba(79,108,255,0) 60%
    ),

    /* result rows */
    linear-gradient(#e6ebff 0 0) 0 0 / 100% 18px,
    linear-gradient(#e6ebff 0 0) 0 36px / 100% 18px,
    linear-gradient(#e6ebff 0 0) 0 72px / 100% 18px,
    linear-gradient(#e6ebff 0 0) 0 108px / 100% 18px,

    /* chart / block */
    linear-gradient(#e6ebff 0 0)
      0 160px / 100% 180px;

  background-repeat: no-repeat;
  background-size:
    220% 100%,
    100% 18px,
    100% 18px,
    100% 18px,
    100% 18px,
    100% 180px;

  animation:
    QubeTools-skeleton-shimmer 1.6s linear infinite,
    QubeTools-skeleton-breathe 2.4s ease-in-out infinite;
}

/* Shimmer motion */
@keyframes QubeTools-skeleton-shimmer {
  0% {
    background-position:
      -120% 0,
      0 0,
      0 36px,
      0 72px,
      0 108px,
      0 160px;
  }
  100% {
    background-position:
      120% 0,
      0 0,
      0 36px,
      0 72px,
      0 108px,
      0 160px;
  }
}

/* Soft pulse */
@keyframes QubeTools-skeleton-breathe {
  0%   { opacity: 0.85; }
  50%  { opacity: 1; }
  100% { opacity: 0.85; }
}

/* Mobile refinement */
@media (max-width: 900px) {
  .tool-results.is-loading::after {
    background:
      linear-gradient(
        110deg,
        rgba(79,108,255,0) 40%,
        rgba(79,108,255,0.18) 50%,
        rgba(79,108,255,0) 60%
      ),
      linear-gradient(#e6ebff 0 0) 0 0 / 100% 16px,
      linear-gradient(#e6ebff 0 0) 0 32px / 100% 16px,
      linear-gradient(#e6ebff 0 0) 0 64px / 100% 16px,
      linear-gradient(#e6ebff 0 0)
        0 120px / 100% 160px;

    background-size:
      220% 100%,
      100% 16px,
      100% 16px,
      100% 16px,
      100% 160px;
  }
}

/* ==================================================
   JSON → XML CONVERTER — FINAL PRODUCTION CSS
================================================== */

/* ==================================================
   LAYOUT (WIDER EDITORS, SLIM CENTER)
================================================== */

.converter-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.26fr 1.3fr;
  gap: 2.1rem;
  align-items: stretch;
}

/* Equal-height cards */
.tool-box,
.tool-results {
  display: flex;
  flex-direction: column;
  height: 480px;
}

/* ==================================================
   HEADINGS
================================================== */

.tool-box > label,
.tool-results > h2 {
  font-weight: 700;
  color: #020617;
  letter-spacing: -0.01em;
}

/* ==================================================
   EDITOR (INPUT + OUTPUT)
================================================== */

.editor-shell {
  display: grid;
  grid-template-columns: 52px 1fr;
  flex: 1;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

/* Line numbers */
.editor-lines {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-right: 1px solid #e5e7eb;
  padding: 0.8rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-align: right;
  user-select: none;
  white-space: pre;
  overflow: hidden;
}

/* Textareas */
.editor-shell textarea,
.tool-results textarea {
  border: none;
  padding: 0.8rem;
  resize: none;
  height: 100%;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  outline: none;
  caret-color: #2563eb;
  letter-spacing: 0.01em;
  background: transparent;
}

/* Input focus */
.editor-shell:focus-within {
  border-color: #2563eb;
  box-shadow:
    0 0 0 1px rgba(37,99,235,0.6),
    0 14px 34px rgba(37,99,235,0.22);
}

/* Output container */
.tool-results textarea {
  flex: 1;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  transition:
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

/* Output focus */
.tool-results textarea:focus {
  border-color: #16a34a;
  box-shadow:
    0 0 0 1px rgba(22,163,74,0.6),
    0 14px 34px rgba(22,163,74,0.22);
}

/* ==================================================
   CENTER CONTROLS
================================================== */

.converter-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}

.center-toolbar {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Make center buttons compact */
.converter-center .tool-btn,
.converter-center .primary-btn {
  width: 100%;
  justify-content: center;
}

/* ==================================================
   BUTTONS (MINIMAL MOTION)
================================================== */

.tool-btn,
.primary-btn {
  transition:
    transform 0.12s cubic-bezier(.4,0,.2,1),
    box-shadow 0.18s ease,
    background-color 0.18s ease;
  will-change: transform;
}

/* Base tool button */
.tool-btn {
  height: 38px;
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
}

.tool-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15,23,42,0.12);
}

.tool-btn:active,
.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(15,23,42,0.2);
}

/* Convert button */
.primary-btn {
  height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  cursor: pointer;
  box-shadow:
    0 14px 32px rgba(37,99,235,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.18);
}

.primary-btn:hover {
  transform: translateY(-1px);    
  background: linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow:
    0 20px 44px rgba(37,99,235,0.5),
    inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* Copy (green) */
#copyBtn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  border: none;
  box-shadow:
    0 8px 22px rgba(22,163,74,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.18);
}

#copyBtn:hover {
  box-shadow:
    0 12px 30px rgba(22,163,74,0.55),
    inset 0 -2px 0 rgba(0,0,0,0.22);
}

/* Download (blue) */
#downloadBtn {
  background: linear-gradient(135deg, #2563eb, #1e4ed8);
  color: #ffffff;
  border: none;
  box-shadow:
    0 8px 24px rgba(37,99,235,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.18);
}

#downloadBtn:hover {
  box-shadow:
    0 12px 32px rgba(37,99,235,0.55),
    inset 0 -2px 0 rgba(0,0,0,0.22);
}

/* ==================================================
   OPTIONS PANEL
================================================== */

.options-panel {
  background: #f8fafc;
  border: 1px dashed #e5e7eb;
  border-radius: 14px;
  padding: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.options-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.options-panel input,
.options-panel select {
  height: 34px;
  padding: 0 0.6rem;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.options-panel input:focus,
.options-panel select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* ==================================================
   OUTPUT ACTIONS
================================================== */

.output-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 0.75rem;
}

/* Hide native file input */
.file-input {
  display: none;
}

/* ==================================================
   RESPONSIVE
================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .converter-layout {
    grid-template-columns: 1fr;
  }

  .tool-box,
  .tool-results {
    height: 440px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .tool-box,
  .tool-results {
    height: 400px;
  }

  .primary-btn {
    width: 100%;
  }

  .tool-btn {
    font-size: 0.78rem;
    padding: 0 0.85rem;
  }
}


/* =========================
   INPUT HEADER (LABEL + SAMPLE)
========================= */

.input-header {
  display: flex;
  align-items: center;
  justify-content: left;
  margin-bottom: 0.55rem;
}

.input-title {
  font-size: 1rem;
  font-weight: bold;
  color: #020617;
  margin-right: 1rem;
}

/* =========================
   SAMPLE BUTTON
   (Matches Convert Button Color)
========================= */

.sample-btn {
  height: 34px;
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;

  background: #2563eb;
  color: #ffffff;

  transition:
    background 0.15s ease,
    transform 0.05s ease,
    box-shadow 0.15s ease;
}

.sample-btn:hover {
  background: #1e4ed8;
}

.sample-btn:active {
  transform: translateY(1px);
}

.sample-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.options-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}

.options-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 4px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.option-item input {
  transform: scale(1.05);
}

.option-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.option-select label {
  font-size: 13px;
  opacity: 0.7;
}

/* ==================================================
   FILTER BUTTON (IMPROVED PREMIUM)
================================================== */

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
}

.filter-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.filter-icon {
  transition: transform 0.35s ease;
}

.filter-btn:hover .filter-icon {
  transform: rotate(45deg);
}

/* ==================================================
   FILTER OVERLAY – PREMIUM CENTER MODAL
================================================== */

.filter-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
}

.filter-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Backdrop */

.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

/* Panel */

.filter-panel {
  position: relative;
  width: 32rem;
  max-width: 92%;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transform: scale(0.92);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 1;
}

.filter-overlay.active .filter-panel {
  transform: scale(1);
  opacity: 1;
}

/* ==================================================
   HEADER
================================================== */

.filter-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* CLOSE BUTTON – RED CIRCLE */

.filter-close {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.filter-close:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* ==================================================
   BODY
================================================== */

.filter-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ==================================================
   PREFIX INPUT IMPROVED
================================================== */

.filter-group input[type="text"] {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.filter-group input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================================================
   FOOTER BUTTONS – CLEAN LEFT/RIGHT LAYOUT
================================================== */

.filter-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
}

/* Reset stays left */
.filter-footer .tool-btn {
  height: 2.6rem;
  padding: 0 1.4rem;
  border-radius: 0.7rem;
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none; /* prevent height illusion */
}

.filter-footer .tool-btn:hover {
  background: #dc2626;
}

/* Apply pushed to right */
.filter-footer .primary-btn {
  margin-left: auto;        /* THIS pushes it right */
  height: 2.6rem;
  padding: 0 1.6rem;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.regex-highlight-box {
  min-height: 140px;
  padding: 0.8rem;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  line-height: 1.6;
}

.regex-match {
  background: rgba(37, 99, 235, 0.2);
  padding: 0 3px;
  border-radius: 4px;
}
/* Checkbox alignment */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  position: static;
  transform: none;
}

/* Divider */
.tool-divider {
  margin: 1.8rem 0;
  border: none;
  border-top: 1px dashed #e5e7eb;
}
/* =========================
   UUID GENERATOR CHECKBOX FIX
========================= */

.uuid-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.uuid-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  transform: none;
  position: static;
}
/* =====================================
   TEXT TOOL EDITOR (Future-proof)
   Works with existing HTML
===================================== */

.tool-box .tool-textarea,
.tool-results .tool-textarea{
  width:100%;
  min-height:320px;

  padding:16px;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size:14px;
  line-height:1.6;

  background:#fff;

  border:1px solid #cbd5e1;
  border-radius:14px;

  outline:none;

  resize:none;                 /* remove resize corner */

  transition:
    border .15s ease,
    box-shadow .15s ease;
}

/* hover like other tools */

.tool-box .tool-textarea:hover,
.tool-results .tool-textarea:hover{
  border-color:#94a3b8;
}

/* focus like JSON tools */

.tool-box .tool-textarea:focus,
.tool-results .tool-textarea:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 2px rgba(59,130,246,.15);
}

/* ensure equal height between input and output */

.converter-layout .tool-box,
.converter-layout .tool-results{
  display:flex;
  flex-direction:column;
}

.converter-layout .tool-form,
.converter-layout .tool-results{
  flex:1;
}

/* primary tool action */

.tool-main-btn{
width:100%;
padding:12px 18px;

font-size:12px;
font-weight:600;

color:#fff;

background:linear-gradient(135deg,#3b82f6,#1e40af);

border:none;
border-radius:8px;

cursor:pointer;

box-shadow:0 10px 20px rgba(59,130,246,.25);

transition:all .15s ease;
}

.tool-main-btn:hover{
transform:translateY(-1px);
box-shadow:0 12px 22px rgba(37, 73, 130, 0.35);
}


/* secondary tool buttons */

.tool-normal-btn{
width:100%;
padding:10px 14px;

font-size:13px;
font-weight:500;

color:#1f2937;

background:#f1f5f9;

border:1px solid #cbd5e1;
border-radius:10px;

cursor:pointer;

transition:all .15s ease;
}

.tool-normal-btn:hover{
background:#e2e8f0;
border-color:#94a3b8;
}

/* ==================================================
   Production Tool Surface
   Shared finishing layer for all utility pages.
================================================== */

.page-content > .section:first-child {
  margin-top: 0 !important;
}

.page-content > .section:first-child .section-header {
  position: relative;
  overflow: hidden;
  max-width: none !important;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #dfe7f2;
  border-radius: 24px;
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(15, 118, 110, 0.12), transparent 72%),
    radial-gradient(480px 220px at 0% 100%, rgba(37, 99, 235, 0.12), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,251,255,0.9));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.page-content > .section:first-child .section-header::before {
  content: "Tool";
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 10px;
  border: 1px solid #cbe2df;
  border-radius: 999px;
  background: #eefbf8;
  color: #0f5f59;
  font-size: 0.74rem;
  line-height: 1;
  font-weight: 820;
  text-transform: uppercase;
}

.page-content > .section:first-child .section-header h1 {
  max-width: 780px;
  font-size: 2.5rem !important;
  line-height: 1.04 !important;
}

.page-content > .section:first-child .section-header p {
  max-width: 760px;
  color: #5d6b82 !important;
  font-size: clamp(0.98rem, 1.8vw, 1.12rem) !important;
}

.tool-layout,
.converter-layout {
  gap: 18px !important;
  align-items: stretch !important;
}

.tool-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr) !important;
}

.converter-layout {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.28fr) minmax(0, 1fr) !important;
}

.tool-box,
.tool-results {
  min-width: 0;
  height: auto !important;
  min-height: 360px;
  padding: clamp(18px, 2.6vw, 24px) !important;
  border: 1px solid #dfe7f2 !important;
  border-radius: 18px !important;
  background:
    radial-gradient(320px 150px at 100% 0%, rgba(37, 99, 235, 0.06), transparent 70%),
    #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.06) !important;
}

.tool-results {
  background:
    radial-gradient(320px 150px at 100% 0%, rgba(15, 118, 110, 0.07), transparent 70%),
    #fbfdff !important;
}

.tool-box > label,
.tool-results > h2,
.input-title {
  color: #101828 !important;
  font-size: 1rem !important;
  font-weight: 780 !important;
}

.form-field {
  gap: 8px !important;
}

.form-field label,
.options-group-title,
.option-select label {
  color: #334155 !important;
  font-size: 0.84rem !important;
  font-weight: 720 !important;
  letter-spacing: 0 !important;
}

.tool-form input,
.tool-form select,
.tool-form textarea,
.options-panel input,
.options-panel select,
.filter-group input[type="text"],
.tool-box .tool-textarea,
.tool-results .tool-textarea,
.editor-shell,
.tool-results textarea,
.regex-highlight-box {
  border: 1px solid #cfd8e6 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #101828 !important;
  box-shadow: none !important;
}

.tool-form input,
.tool-form select,
.options-panel input,
.options-panel select,
.filter-group input[type="text"] {
  min-height: 44px;
}

.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus,
.options-panel input:focus,
.options-panel select:focus,
.filter-group input[type="text"]:focus,
.tool-box .tool-textarea:focus,
.tool-results .tool-textarea:focus,
.editor-shell:focus-within,
.tool-results textarea:focus,
.regex-highlight-box:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13) !important;
  outline: 0 !important;
}

.primary-btn,
.tool-main-btn,
.sample-btn,
.filter-btn {
  min-height: 44px;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #111827, #2563eb 58%, #0f766e) !important;
  color: #ffffff !important;
  font-weight: 780 !important;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24) !important;
}

.primary-btn:hover,
.tool-main-btn:hover,
.sample-btn:hover,
.filter-btn:hover {
  background: linear-gradient(135deg, #0f766e, #1d4ed8 62%, #0f172a) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.28) !important;
}

.tool-btn,
.tool-normal-btn {
  min-height: 38px;
  border: 1px solid #cfd8e6 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #101828 !important;
  font-weight: 720 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.tool-btn:hover,
.tool-normal-btn:hover {
  border-color: #b9cdf8 !important;
  background: #f8fafc !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
}

.converter-center {
  align-self: stretch;
  justify-content: center !important;
  padding: 14px;
  border: 1px solid #dfe7f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.center-toolbar,
.output-actions,
.panel-actions {
  gap: 10px !important;
}

.editor-shell {
  overflow: hidden;
}

.editor-lines {
  border-right: 1px solid #dfe7f2 !important;
  background: #f8fafc !important;
  color: #7a8799 !important;
}

.options-panel,
.options-group {
  border: 1px solid #dfe7f2 !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
}

.filter-panel {
  border: 1px solid #dfe7f2;
  border-radius: 20px !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28) !important;
}

.filter-header,
.filter-footer {
  background: #ffffff;
  border-color: #dfe7f2 !important;
}

.filter-close,
.close-btn {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.result-item {
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e8eef6;
}

.result-item:last-child {
  border-bottom: 0;
}

.result-label {
  color: #5d6b82 !important;
  font-weight: 650;
}

.result-item strong {
  color: #101828 !important;
  font-weight: 820 !important;
}

.content-article {
  width: min(900px, 100%) !important;
  margin: clamp(36px, 6vw, 72px) auto 0 !important;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #dfe7f2;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.content-article h2,
.content-article h3 {
  color: #101828 !important;
}

.content-article p,
.content-article li {
  color: #475467 !important;
}

@media (max-width: 1024px) {
  .tool-layout,
  .converter-layout {
    grid-template-columns: 1fr !important;
  }

  .converter-center {
    align-self: auto;
  }
}

@media (max-width: 640px) {
  .page-content > .section:first-child .section-header,
  .tool-box,
  .tool-results,
  .content-article {
    border-radius: 16px !important;
  }

  .center-toolbar,
  .output-actions,
  .panel-actions {
    display: grid !important;
  }

  .center-toolbar > *,
  .output-actions > *,
  .panel-actions > * {
    width: 100% !important;
  }
}
