
/* Vital SEO — Crawl Map Generator local prototype */

.crawl-map-introduction {
  max-width: 760px;
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

.crawl-map-form {
  margin-bottom: 2rem;
}

.crawl-map-form > label {
  display: block;
  margin-bottom: .65rem;
  font-weight: 600;
}

.crawl-map-input-row {
  display: flex;
  align-items: stretch;
  gap: .75rem;
}

.crawl-map-input-row input {
  flex: 1 1 350px;
  min-width: 0;
  padding: .85rem 1rem;
  border: 1px solid #b8c9d9;
  border-radius: 8px;
  font: inherit;
}

.crawl-map-input-row .button {
  flex-shrink: 0;
}

.crawl-map-form .tool-help {
  margin-top: .8rem;
  font-size: .9rem;
  opacity: .75;
}

.crawl-map-results {
  margin-top: 1.5rem;
}

.crawl-map-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.crawl-map-summary > div {
  padding: 1rem;
  border: 1px solid #dce6ee;
  border-radius: 8px;
  background: #f5f9fc;
  text-align: center;
}

.crawl-map-summary strong {
  display: block;
  color: #1266a6;
  font-size: 1.65rem;
  line-height: 1.3;
}

.crawl-map-summary span {
  display: block;
  margin-top: .25rem;
  font-size: .85rem;
  color: #526475;
}

.crawl-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.crawl-map-zoom-controls,
.crawl-map-export-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.crawl-map-toolbar button {
  padding: .55rem .85rem;
  border: 1px solid #c7d7e4;
  border-radius: 7px;
  background: #fff;
  color: #17527f;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.crawl-map-toolbar button:hover {
  background: #eaf4fb;
}

.crawl-map-visualisation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  background: #fff;
}

.crawl-map-canvas {
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  background: #fff;
}

.crawl-map-canvas {
  position: relative;
}

.crawl-map-progress[hidden] {
  display: none;
}

.crawl-map-progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
  text-align: center;
}

.crawl-map-progress-content {
  width: min(100%, 340px);
}

.crawl-map-progress-heading {
  margin: 0 0 1rem;
  color: #254b69;
  font-size: 1.1rem;
  font-weight: 700;
}

.crawl-map-progress-counter {
  margin: 0 0 1.25rem;
  color: #536c80;
  font-size: .95rem;
}

.crawl-map-progress-counter strong {
  display: block;
  margin-bottom: .25rem;
  color: #1266a6;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.crawl-map-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eef5;
}

.crawl-map-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #2585c5;
  transition: width .2s ease;
}

.crawl-map-progress-note {
  margin: 1rem 0 0;
  color: #536c80;
  font-size: .85rem;
}

@media (prefers-reduced-motion: reduce) {
  .crawl-map-progress-fill {
    transition: none;
  }
}

#crawlMapSvg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  cursor: grab;
  touch-action: none;
}

#crawlMapSvg:active {
  cursor: grabbing;
}

#crawlMapLinks line {
  stroke: #a8c8e0;
  stroke-width: .8;
  opacity: .18;
}

#crawlMapNodes circle {
  stroke: #fff;
  stroke-width: 1.5;
  cursor: pointer;
}

#crawlMapNodes circle:hover {
  stroke: #f5b935;
  stroke-width: 2.5;
}

/* Directional links for the selected page. */
#crawlMapLinks line.crawl-map-link-incoming {
  stroke: #16a34a;
  stroke-width: 2;
  opacity: .95;
}

#crawlMapLinks line.crawl-map-link-outgoing {
  stroke: #ea580c;
  stroke-width: 2;
  opacity: .95;
}

.crawl-map-node-label {
  fill: #254b69;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  pointer-events: none;
  user-select: none;
}

.crawl-map-details {
  min-width: 0;
  padding: 1.25rem;
  border-left: 1px solid #dce6ee;
  background: #f7fafc;
  color: #253e52;
}

.crawl-map-details h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.crawl-map-details p,
.crawl-map-details dd {
  overflow-wrap: anywhere;
}

.crawl-map-details dt {
  margin-top: .9rem;
  font-size: .8rem;
  font-weight: 700;
  color: #536c80;
}

.crawl-map-details dd {
  margin: .25rem 0 0;
  font-size: .9rem;
}

#crawlMapStatus {
  margin-top: 1rem;
  font-size: .9rem;
  color: #526475;
}

@media (max-width: 800px) {
  .crawl-map-visualisation {
    grid-template-columns: minmax(0, 1fr);
  }

  .crawl-map-details {
    border-left: 0;
    border-top: 1px solid #dce6ee;
  }

  .crawl-map-canvas,
  #crawlMapSvg {
    min-height: 420px;
  }
}

@media (max-width: 600px) {
  .crawl-map-input-row {
    flex-direction: column;
  }

  .crawl-map-input-row .button {
    width: 100%;
  }

  .crawl-map-summary {
    gap: .5rem;
  }

  .crawl-map-summary > div {
    padding: .75rem .35rem;
  }

  .crawl-map-summary strong {
    font-size: 1.3rem;
  }

  .crawl-map-summary span {
    font-size: .75rem;
  }

  .crawl-map-toolbar {
    flex-direction: column;
  }

  .crawl-map-canvas,
  #crawlMapSvg {
    min-height: 350px;
  }
}

/* Page information: directional link legend. */
.crawl-map-direction-label {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.crawl-map-direction-line {
  display: inline-block;
  flex: 0 0 28px;
  height: 3px;
  border-radius: 2px;
}

.crawl-map-direction-incoming {
  background: #16a34a;
}

.crawl-map-direction-outgoing {
  background: #ea580c;
}

.crawl-map-detail-explanation {
  color: #536c80;
  font-size: .78rem !important;
  line-height: 1.5;
}

/* Other internal connections legend. */
.crawl-map-direction-other {
  background: #83c4ed;
}


/* Internal Link Visualiser — expandable SEO guidance */
.crawl-map-seo-tip[hidden] {
  display: none !important;
}

.crawl-map-seo-tip {
  margin-top: 16px;
  border: 1px solid #d8e4ef;
  border-radius: 12px;
  background: #f5f9fd;
  color: #243447;
  overflow: hidden;
}

.crawl-map-seo-tip summary {
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 650;
  list-style-position: inside;
}

.crawl-map-seo-tip summary:hover {
  background: rgba(35, 115, 185, 0.06);
}

.crawl-map-seo-tip summary:focus-visible {
  outline: 2px solid #2373b9;
  outline-offset: -3px;
}

.crawl-map-seo-tip-content {
  padding: 0 18px 16px;
  line-height: 1.65;
}

.crawl-map-seo-tip-content p {
  margin: 0 0 12px;
}

.crawl-map-seo-tip-content p:last-child {
  margin-bottom: 0;
}

[data-theme="dark"] .crawl-map-seo-tip,
.dark-mode .crawl-map-seo-tip {
  background: #172638;
  border-color: #3b536b;
  color: #e8eef5;
}

[data-theme="dark"] .crawl-map-seo-tip summary:hover,
.dark-mode .crawl-map-seo-tip summary:hover {
  background: rgba(255, 255, 255, 0.06);
}


/* Website Structure Visualiser — folder explorer layout */

.website-structure-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 28%) minmax(0, 1fr);
  grid-template-rows: minmax(520px, auto) auto;
  align-items: stretch;
}

.website-structure-explorer {
  min-width: 0;
  min-height: 520px;
  border-right: 1px solid #dce6ee;
  background: #f7fafc;
  color: #253e52;
  display: flex;
  flex-direction: column;
}

.website-structure-explorer-header {
  padding: 1.1rem;
  border-bottom: 1px solid #dce6ee;
}

.website-structure-explorer-header h3 {
  margin: 0 0 .45rem;
  font-size: 1.05rem;
}

.website-structure-explorer-header p {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
  color: #536c80;
}

.website-structure-folder-tree {
  flex: 1;
  min-height: 0;
  max-height: 680px;
  overflow: auto;
  padding: 1rem .75rem;
  font-size: .875rem;
}

.website-structure-explorer-empty {
  margin: 0;
  padding: .75rem;
  line-height: 1.6;
  color: #536c80;
}

.website-structure-graph {
  min-width: 0;
  min-height: 520px;
}

.website-structure-workspace > .crawl-map-details {
  grid-column: 1 / -1;
  border-left: 0;
  border-top: 1px solid #dce6ee;
}

.website-structure-folder-tree .structure-tree-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: .45rem .5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #253e52;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.website-structure-folder-tree .structure-tree-item:hover,
.website-structure-folder-tree .structure-tree-item:focus-visible {
  background: #e5f1fa;
}

.website-structure-folder-tree .structure-tree-item.is-selected {
  background: #dbeeff;
  color: #124d80;
  font-weight: 700;
}

.website-structure-folder-tree .structure-tree-children {
  margin-left: .75rem;
  padding-left: .65rem;
  border-left: 1px solid #d6e2ec;
}

@media (max-width: 800px) {
  .website-structure-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .website-structure-explorer {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #dce6ee;
  }

  .website-structure-folder-tree {
    max-height: 340px;
  }

  .website-structure-graph,
  .website-structure-graph #crawlMapSvg {
    min-height: 420px;
  }

  .website-structure-workspace > .crawl-map-details {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .website-structure-graph,
  .website-structure-graph #crawlMapSvg {
    min-height: 350px;
  }
}


/* Website Structure Visualiser — selection and tree controls */

.website-structure-folder-tree .structure-tree-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .15rem;
}

.website-structure-folder-tree .structure-tree-toggle {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #17527f;
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.website-structure-folder-tree .structure-tree-toggle:hover:not(:disabled),
.website-structure-folder-tree .structure-tree-toggle:focus-visible {
  background: #dbeeff;
}

.website-structure-folder-tree .structure-tree-toggle:disabled {
  cursor: default;
  opacity: .35;
}

.website-structure-folder-tree .structure-tree-item {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.website-structure-folder-tree .structure-tree-children[hidden] {
  display: none;
}

.website-structure-graph #crawlMapNodes g {
  cursor: pointer;
}

.website-structure-graph #crawlMapNodes g:focus-visible {
  outline: none;
}

.website-structure-graph #crawlMapNodes g.is-selected rect,
.website-structure-graph #crawlMapNodes g:focus-visible rect {
  stroke: #075ca8;
  stroke-width: 3.5;
}

.website-structure-graph #crawlMapNodes g.is-selected text {
  fill: #07518d;
  font-weight: 700;
}


/* Website Structure Visualiser — resizable panels */

@media (min-width: 801px) {
  .website-structure-workspace {
    grid-template-columns:
      minmax(0, var(--structure-explorer-width, 28%))
      8px
      minmax(0, 1fr);
  }

  .website-structure-explorer {
    border-right: 0;
  }

  .website-structure-divider {
    position: relative;
    min-width: 8px;
    background: #e5edf4;
    border-left: 1px solid #d6e2ec;
    border-right: 1px solid #d6e2ec;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
  }

  .website-structure-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 44px;
    border-radius: 4px;
    background: #9bb3c7;
    transform: translate(-50%, -50%);
  }

  .website-structure-divider:hover,
  .website-structure-divider:focus-visible,
  .website-structure-divider.is-resizing {
    background: #cfe5f7;
  }

  .website-structure-divider:focus-visible {
    outline: 2px solid #1674c4;
    outline-offset: -2px;
  }

  .website-structure-workspace > .crawl-map-details {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .website-structure-divider {
    display: none;
  }

  .website-structure-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Website Structure Visualiser — stable graph height */

/* Keep expanding folder branches from changing the SVG viewport. */
@media (min-width: 801px) {
  .website-structure-workspace {
    grid-template-rows: 520px auto;
  }

  .website-structure-explorer,
  .website-structure-graph {
    height: 520px;
    min-height: 0;
    max-height: 520px;
    overflow: hidden;
  }

  .website-structure-folder-tree {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
  }

  .website-structure-graph #crawlMapSvg {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
  }
}

@media (max-width: 800px) {
  .website-structure-explorer {
    min-height: 0;
    height: auto;
  }

  .website-structure-folder-tree {
    max-height: 340px;
    overflow: auto;
  }

  .website-structure-graph {
    height: 420px;
    min-height: 0;
    overflow: hidden;
  }

  .website-structure-graph #crawlMapSvg {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .website-structure-graph {
    height: 350px;
  }
}


/* Website Structure Visualiser — compact mobile sitemap URL input */
@media (max-width: 640px) {
  .crawl-map-form .crawl-map-input-row input[type="url"] {
    flex: 0 0 50px;
    width: 100%;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    box-sizing: border-box;
  }
}


/* Website Structure Visualiser — dark-mode contrast */
html[data-theme="dark"] .crawl-map-form .crawl-map-input-row input[type="url"] {
  background: #111c2a;
  border-color: #40556c;
  color: #f1f6fc;
}

html[data-theme="dark"] .crawl-map-form .crawl-map-input-row input[type="url"]::placeholder {
  color: #a5b6c8;
  opacity: 1;
}

html[data-theme="dark"] .crawl-map-summary > div {
  background: #172638;
  border-color: #3b536b;
  color: #e8eef5;
}

html[data-theme="dark"] .crawl-map-summary strong {
  color: #8cc9ff;
}

html[data-theme="dark"] .crawl-map-summary span,
html[data-theme="dark"] #crawlMapStatus,
html[data-theme="dark"] .crawl-map-progress-note {
  color: #b7c8d9;
}

html[data-theme="dark"] .crawl-map-toolbar button {
  background: #172638;
  border-color: #40556c;
  color: #d9ebfb;
}

html[data-theme="dark"] .crawl-map-toolbar button:hover:not(:disabled) {
  background: #243b52;
}

html[data-theme="dark"] .website-structure-explorer,
html[data-theme="dark"] .website-structure-workspace > .crawl-map-details {
  background: #172638;
  border-color: #3b536b;
  color: #e8eef5;
}

html[data-theme="dark"] .website-structure-explorer-header {
  border-color: #3b536b;
}

html[data-theme="dark"] .website-structure-explorer-header p,
html[data-theme="dark"] .website-structure-explorer-empty,
html[data-theme="dark"] .crawl-map-details dt {
  color: #b7c8d9;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-item {
  color: #e8eef5;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-item:hover,
html[data-theme="dark"] .website-structure-folder-tree .structure-tree-item:focus-visible {
  background: #29445f;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-item.is-selected {
  background: #23517b;
  color: #ffffff;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-toggle {
  color: #a9d5fa;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-toggle:hover:not(:disabled),
html[data-theme="dark"] .website-structure-folder-tree .structure-tree-toggle:focus-visible {
  background: #29445f;
}

html[data-theme="dark"] .website-structure-folder-tree .structure-tree-children {
  border-color: #40556c;
}

@media (min-width: 801px) {
  html[data-theme="dark"] .website-structure-divider {
    background: #25394e;
    border-color: #40556c;
  }

  html[data-theme="dark"] .website-structure-divider::after {
    background: #93adc5;
  }

  html[data-theme="dark"] .website-structure-divider:hover,
  html[data-theme="dark"] .website-structure-divider:focus-visible,
  html[data-theme="dark"] .website-structure-divider.is-resizing {
    background: #345b7d;
  }
}


/* Website Structure Visualiser — dark-mode accordions */
html[data-theme="dark"] #tool-website-structure-visualiser details.crawl-map-instructions.spl-checking-explanation {
  background: #172638;
  border: 1px solid #3b536b;
  color: #e8eef5;
}

html[data-theme="dark"] #tool-website-structure-visualiser details.crawl-map-instructions.spl-checking-explanation > summary {
  background: transparent;
  border: 0;
  color: #d9ebff;
}

html[data-theme="dark"] #tool-website-structure-visualiser details.crawl-map-instructions.spl-checking-explanation > summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-instructions-content,
html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-instructions-content p,
html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-instructions-content li,
html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-instructions-content strong {
  color: #e8eef5;
}

html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-instructions-content a {
  color: #8cc9ff;
}


/* Website Structure Visualiser — dark graph canvas */
html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-visualisation {
  background: #111c2a;
  border-color: #3b536b;
}

html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-canvas.website-structure-graph {
  background: #111c2a;
}

html[data-theme="dark"] #tool-website-structure-visualiser .website-structure-graph #crawlMapLinks path {
  stroke: #7699b7;
}

html[data-theme="dark"] #tool-website-structure-visualiser .website-structure-graph #crawlMapNodes g.is-selected rect,
html[data-theme="dark"] #tool-website-structure-visualiser .website-structure-graph #crawlMapNodes g:focus-visible rect {
  stroke: #f5b935;
}

html[data-theme="dark"] #tool-website-structure-visualiser .crawl-map-progress {
  background: #111c2a;
  color: #e8eef5;
}
