/* =========================================================
   MAIN
========================================================= */

main {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-top: 90px;

  background: var(--bg);
  color: var(--text);
}


/* =========================================================
   BREADCRUMB
========================================================= */

.breadcrumb {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  flex-wrap: wrap;

  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.breadcrumb a {
  color: var(--soft);

  text-decoration: none;

  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.breadcrumb .separator {
  margin: 0 8px;

  color: var(--border);

  user-select: none;
}

.breadcrumb [aria-current="page"] {
  color: var(--soft);
  font-weight: 500;
}


/* =========================================================
   TOOLS PAGE WRAPPER
========================================================= */

.page-tools {
  width: 100%;
  max-width: 1280px;

  margin: 0 auto;
  padding: 96px 24px 24px;

  box-sizing: border-box;
}

.tools-page {
  width: 100%;
  max-width: 1000px;

  margin: 40px auto 0;
  padding: 64px 20px;

  box-sizing: border-box;
}

.tool-container,
.category-page {
  width: 100%;
  max-width: 1000px;

  margin: 0 auto;
  padding: 20px;

  box-sizing: border-box;
}


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

.tool-header {
  max-width: 900px;

  margin: 0 auto 32px;

  text-align: center;
}

.tool-header h1 {
  margin: 10px 0 12px;

  color: var(--text);

  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
}

.tool-header p {
  max-width: 720px;

  margin: 0 auto;

  color: var(--soft);

  font-size: 15px;
  line-height: 1.7;
}


/* =========================================================
   PAGE BADGE
========================================================= */

.page-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 5px 10px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--card);
  color: var(--soft);

  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* =========================================================
   TOOLS HERO
========================================================= */

.tools-hero {
  margin-bottom: 40px;

  text-align: center;
}

.tools-hero h1 {
  margin-bottom: 12px;

  color: var(--text);
}

.tools-hero p {
  max-width: 720px;

  margin: 0 auto;

  color: var(--soft);
}


/* =========================================================
   TOOL BOX
========================================================= */

.tool-box {
  position: relative;

  width: min(1200px, 100%);

  margin: 0 auto 20px;
  padding: 20px;

  box-sizing: border-box;

  background: var(--card);

  border: 1px solid var(--border);
  border-radius: 16px;

  color: var(--text);

  transition:
    border-color 0.25s ease,
    transform 0.25s ease;
}

.tool-box:hover {
  border-color: var(--border);
}

.tool-box h1 {
  margin: 0 0 6px;

  color: var(--text);

  font-size: 24px;
  line-height: 1.3;
}

.tool-box h2 {
  margin: 28px 0 12px;

  color: var(--text);

  font-size: 20px;
  line-height: 1.35;
}

.tool-box h3 {
  margin: 22px 0 10px;

  color: var(--text);

  font-size: 17px;
}

.tool-box .desc,
.desc {
  margin-bottom: 18px;

  color: var(--soft);

  font-size: 14px;
  line-height: 1.7;
}


/* =========================================================
   TOOL FORM GRID
========================================================= */

.tool-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(280px, 0.8fr);

  gap: 20px;

  width: 100%;
}

.tool-options {
  display: grid;

  grid-template-columns: 1fr;

  gap: 2px;

  align-content: start;
}

.tool-field {
  width: 100%;

  margin-bottom: 12px;
}

.tool-field label {
  display: block;

  margin-bottom: 7px;

  color: var(--text);

  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}


/* =========================================================
   FORM GROUP — LEGACY
========================================================= */

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;

  margin-bottom: 6px;

  color: var(--text);

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


/* =========================================================
   INPUT / SELECT / TEXTAREA
========================================================= */

.tool-input,
.tool-select,
.tool-textarea,
input,
textarea,
select {
  width: 100%;

  padding: 12px;

  margin-bottom: 0;

  box-sizing: border-box;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--bg);
  color: var(--text);

  font: inherit;

  outline: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.tool-input::placeholder,
.tool-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--soft);
  opacity: 0.75;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--soft);

  box-shadow:
    0 0 0 2px var(--border);
}

textarea,
.tool-textarea {
  min-height: 120px;

  line-height: 1.5;

  font-family: inherit;

  resize: vertical;
}

select {
  cursor: pointer;
}


/* =========================================================
   TOOL OUTPUT
========================================================= */

.tool-output {
  width: 100%;

  min-height: 280px;

  padding: 14px;

  box-sizing: border-box;

  background: var(--bg);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 10px;

  font: inherit;
  line-height: 1.6;

  resize: vertical;

  outline: none;
}

.tool-output:focus {
  border-color: var(--soft);

  box-shadow:
    0 0 0 2px var(--border);
}


/* =========================================================
   TOOL ACTIONS
========================================================= */

.tool-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 16px;
  margin-bottom: 18px;
}


/* =========================================================
   TOOL BUTTON
========================================================= */

.tool-btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 42px;

  padding: 11px 18px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--bg);
  color: var(--text);

  font: inherit;
  font-size: 14px;
  font-weight: 600;

  line-height: 1.2;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.tool-btn:hover {
  transform: translateY(-2px);

  border-color: var(--soft);
}

.tool-btn:active {
  transform: translateY(0);
}

.tool-btn:disabled {
  opacity: 0.5;

  cursor: not-allowed;

  transform: none;
}


/* =========================================================
   BUTTON GROUP — LEGACY
========================================================= */

.btn-group {
  display: flex;
  align-items: stretch;
  justify-content: space-between;

  gap: 12px;

  margin-top: 25px;

  flex-wrap: wrap;
}


/* =========================================================
   BUTTON BASE — LEGACY
========================================================= */

.btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 6px;

  padding: 12px 20px;

  border: 1px solid transparent;
  border-radius: 10px;

  color: var(--text);

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

  line-height: 1.2;

  text-decoration: none;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}


/* =========================================================
   PRIMARY BUTTON — LEGACY
========================================================= */

.btn-primary {
  background: #2563eb;
  color: #ffffff;

  border-color: #2563eb;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}


/* =========================================================
   SECONDARY BUTTON — LEGACY
========================================================= */

.btn-secondary {
  background: transparent;

  color: var(--text);

  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--soft);
  background: var(--border);
}


/* =========================================================
   TOOL RESULT
========================================================= */

.tool-result,
#result {
  margin-top: 15px;
  padding: 15px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--card);

  color: var(--text);

  font-size: 14px;
  line-height: 1.6;

  overflow-wrap: anywhere;
}


/* =========================================================
   TOOL CONTENT / SEO ARTICLE
========================================================= */

.tool-content {
  width: min(1000px, 100%);

  margin: 32px auto 0;

  color: var(--text);

  font-size: 15px;
  line-height: 1.8;
}

.tool-content h2 {
  margin: 38px 0 12px;

  color: var(--text);

  font-size: 24px;
  line-height: 1.35;
}

.tool-content h3 {
  margin: 26px 0 10px;

  color: var(--text);

  font-size: 19px;
  line-height: 1.4;
}

.tool-content p {
  margin: 0 0 16px;

  color: var(--soft);
}

.tool-content ul,
.tool-content ol {
  margin: 0 0 20px;

  padding-left: 24px;

  color: var(--soft);
}

.tool-content li {
  margin-bottom: 7px;
}

.tool-content strong {
  color: var(--text);
}


/* =========================================================
   TOOLS GRID
========================================================= */

.tools-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));

  gap: 20px;
}


/* =========================================================
   TOOL CARD
========================================================= */

.tool-card {
  position: relative;

  display: block;

  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: var(--card);

  color: var(--text);

  text-decoration: none;

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-4px);

  border-color: var(--soft);
}

.tool-card h2,
.tool-card h3 {
  margin: 0 0 8px;

  color: var(--text);

  line-height: 1.35;
}

.tool-card p {
  margin: 0;

  color: var(--soft);

  font-size: 14px;
  line-height: 1.65;
}


/* =========================================================
   TOOL ICON
========================================================= */

.tool-icon {
  margin-bottom: 10px;

  color: var(--text);

  font-size: 24px;
  line-height: 1;
}


/* =========================================================
   BADGE
========================================================= */

.badge {
  position: absolute;

  top: 10px;
  right: 10px;

  padding: 4px 6px;

  border-radius: 6px;

  background: #b91c1c;
  color: #ffffff;

  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}


/* =========================================================
   CATEGORY
========================================================= */

.category-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  padding: 14px;

  background: var(--card);

  border: 1px solid var(--border);
  border-radius: 10px;

  color: var(--text);

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.category-header:hover {
  border-color: var(--soft);
}

.category-content {
  display: none;

  padding: 10px 0;
}

.category-content.active {
  display: grid;

  gap: 10px;
}


/* =========================================================
   TOOLS STATS
========================================================= */

.tools-stats {
  display: flex;

  align-items: stretch;
  justify-content: center;

  gap: 16px;

  flex-wrap: wrap;
}

.tools-stats div {
  width: auto;
  min-width: 80px;

  padding: 14px 18px;

  box-sizing: border-box;

  background: var(--card);

  border: 1px solid var(--border);
  border-radius: 12px;

  text-align: center;

  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.tools-stats div:hover {
  transform: translateY(-2px);

  border-color: var(--soft);
}

.tools-stats strong {
  display: block;

  margin-bottom: 2px;

  color: var(--text);

  font-size: 16px;
  line-height: 1.3;
}

.tools-stats span {
  color: var(--soft);

  font-size: 12px;
  line-height: 1.4;
}


/* =========================================================
   SEARCH
========================================================= */

.tools-search {
  margin-bottom: 30px;
}

.tools-search input {
  width: 100%;

  padding: 12px 14px;

  margin-bottom: 0;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--card);
  color: var(--text);
}


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

@media (max-width: 1024px) {

  .page-tools {
    padding: 96px 20px 20px;
  }

  .tools-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

}


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

@media (max-width: 768px) {

  main {
    padding-top: 80px;
  }

  .breadcrumb {
    width: calc(100% - 24px);

    padding: 10px 0;

    font-size: 11px;
  }

  .page-tools {
    padding: 80px 16px 16px;
  }

  .tools-page {
    margin-top: 20px;

    padding: 40px 14px;
  }

  .tool-container,
  .category-page {
    padding: 14px;
  }

  .tools-grid {
    grid-template-columns: 1fr;

    gap: 16px;
  }

  .tool-box {
    padding: 18px;
  }

  .tool-header {
    margin-bottom: 26px;
  }

  .tool-header h1 {
    font-size: 30px;
  }

  .tool-content {
    font-size: 14px;
  }

  .tool-content h2 {
    font-size: 21px;
  }

  .tool-content h3 {
    font-size: 18px;
  }

  .tools-search {
    margin-bottom: 24px;
  }

  .tool-actions {
    align-items: stretch;
  }

  .tool-btn {
    flex: 1 1 auto;
  }

}


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

@media (max-width: 480px) {

  main {
    padding-top: 72px;
  }

  .breadcrumb {
    width: calc(100% - 20px);

    padding: 8px 0;

    font-size: 10px;
  }

  .breadcrumb .separator {
    margin: 0 6px;
  }

  .page-tools {
    padding: 72px 14px 14px;
  }

  .tools-page {
    padding: 32px 10px;
  }

  .tool-container,
  .category-page {
    padding: 10px;
  }

  .tool-box {
    padding: 16px;

    border-radius: 14px;
  }

  .tool-box h1 {
    font-size: 22px;
  }

  .tool-header h1 {
    font-size: 26px;
  }

  .tool-header p {
    font-size: 14px;
  }

  .tool-grid {
    gap: 10px;
  }

  .tool-options {
    gap: 0;
  }

  .tool-actions {
    flex-direction: column;

    align-items: stretch;
  }

  .tool-btn {
    width: 100%;
  }

  .btn-group {
    flex-direction: column;

    align-items: stretch;
  }

  .btn,
  .btn-group button {
    width: 100%;

    box-sizing: border-box;

    justify-content: center;
  }

  .tools-stats {
    display: grid;

    grid-template-columns:
      repeat(3, minmax(0, 1fr));

    gap: 10px;
  }

  .tools-stats div {
    min-width: 0;

    padding: 12px 8px;
  }

  .tools-stats strong {
    font-size: 15px;
  }

  .tools-stats span {
    font-size: 11px;
  }

}


/* =========================================================
   TOOL CATEGORY BADGE
========================================================= */

.tool-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: fit-content;

  margin-bottom: 10px;
  padding: 5px 9px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--bg);
  color: var(--soft);

  font-size: 10px;
  font-weight: 700;

  line-height: 1.2;

  text-transform: uppercase;
  letter-spacing: 0.05em;

  white-space: nowrap;
}
