/* TekTinkers Tools — page-specific styles (global chrome from /css/style.css) */

.tools-page main {
  position: relative;
  z-index: 1;
}

/* Hero adjustments for tools sub-page */
.tools-hero {
  padding-bottom: 2.5rem;
}

.tools-hero .hero__lead {
  max-width: 48ch;
}

/* Section layout */
.tools-section {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad-x) 4rem;
}

.tools-section + .tools-section {
  padding-top: 1rem;
}

.tools-section__head {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(101, 165, 163, 0.2);
}

.tools-section__title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.tools-section__sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}

.tools-grid--single {
  grid-template-columns: 1fr;
  max-width: 42rem;
}

/* Tool cards */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(
    145deg,
    rgba(101, 165, 163, 0.12) 0%,
    rgba(244, 232, 192, 0.05) 50%,
    rgba(36, 51, 48, 0.5) 100%
  );
}

.tool-card--gold {
  background: linear-gradient(
    145deg,
    rgba(199, 132, 65, 0.14) 0%,
    rgba(244, 232, 192, 0.04) 50%,
    rgba(40, 34, 28, 0.5) 100%
  );
}

.tool-card__header {
  padding: 1.25rem 1.35rem 0.75rem;
  border-bottom: 1px solid rgba(101, 165, 163, 0.15);
}

.tool-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.tool-card__desc {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.tool-card__body {
  padding: 1.25rem 1.35rem 1.35rem;
}

/* Info rows (network information) */
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(244, 232, 192, 0.04);
  border: 1px solid rgba(101, 165, 163, 0.12);
}

.info-list__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.info-list__value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.info-list__value.is-loading {
  color: var(--text-muted);
  font-style: italic;
}

.info-list__value.is-error {
  color: var(--accent-coral);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.status-badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge--open {
  color: #8fd4a8;
  background: rgba(119, 134, 110, 0.25);
}

.status-badge--open::before {
  background: #6fcf97;
  box-shadow: 0 0 8px rgba(111, 207, 151, 0.6);
}

.status-badge--closed {
  color: #f5a89e;
  background: rgba(226, 84, 69, 0.2);
}

.status-badge--closed::before {
  background: var(--accent-coral);
  box-shadow: 0 0 8px rgba(226, 84, 69, 0.5);
}

.status-badge--filtered {
  color: #e8c98a;
  background: rgba(199, 132, 65, 0.22);
}

.status-badge--filtered::before {
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(199, 132, 65, 0.5);
}

.status-badge--working {
  color: #8fd4a8;
  background: rgba(101, 165, 163, 0.22);
}

.status-badge--working::before {
  background: var(--accent-teal);
  box-shadow: 0 0 8px var(--accent-teal-glow);
}

.status-badge--none {
  color: var(--text-muted);
  background: rgba(244, 232, 192, 0.08);
}

.status-badge--none::before {
  background: var(--text-muted);
}

/* Form controls */
.tools-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.tools-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.tools-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 10rem;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(26, 40, 38, 0.85);
  border: 1px solid rgba(101, 165, 163, 0.28);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tools-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px var(--accent-teal-glow);
}

.tools-input--wide {
  max-width: none;
}

.tools-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep);
  background: linear-gradient(135deg, #f0e4c4 0%, var(--accent-teal) 100%);
  border: 1px solid rgba(244, 232, 192, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.tools-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.tools-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.tools-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tools-btn--secondary {
  color: var(--text);
  background: rgba(244, 232, 192, 0.08);
  border-color: rgba(101, 165, 163, 0.28);
}

.tools-btn--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

/* Port preset chips */
.port-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.port-presets__label {
  width: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
}

.port-result {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(244, 232, 192, 0.04);
  border: 1px solid rgba(101, 165, 163, 0.15);
}

.port-result.is-visible {
  display: flex;
  flex-wrap: wrap;
}

.port-result__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.port-result__text strong {
  color: var(--text);
}

.port-note {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Password generator */
.pw-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pw-mode-tab {
  padding: 0.45rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(244, 232, 192, 0.06);
  border: 1px solid rgba(101, 165, 163, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pw-mode-tab:hover {
  color: var(--text);
  border-color: rgba(101, 165, 163, 0.4);
}

.pw-mode-tab.is-active {
  color: var(--bg-deep);
  background: linear-gradient(135deg, #f0e4c4 0%, var(--accent-teal) 100%);
  border-color: rgba(244, 232, 192, 0.35);
}

.pw-output-wrap {
  margin-bottom: 1rem;
}

.pw-output {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  color: var(--text);
  background: rgba(26, 40, 38, 0.9);
  border: 1px solid rgba(101, 165, 163, 0.28);
  border-radius: 10px;
  word-break: break-all;
  min-height: 3rem;
  line-height: 1.5;
}

.pw-example {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pw-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.pw-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}

.pw-option input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-teal);
}

.pw-option input[type="number"] {
  width: 100%;
  margin-top: 0.35rem;
}

.pw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

/* Strength meter */
.pw-strength {
  margin-top: 0.25rem;
}

.pw-strength__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pw-strength__value {
  color: var(--text);
}

.pw-strength__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(244, 232, 192, 0.1);
  overflow: hidden;
}

.pw-strength__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
}

.pw-strength__fill--weak {
  background: var(--accent-coral);
}

.pw-strength__fill--fair {
  background: var(--accent-gold);
}

.pw-strength__fill--good {
  background: var(--accent-teal);
}

.pw-strength__fill--strong {
  background: linear-gradient(90deg, var(--accent-teal), #8fd4a8);
}

.copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 100;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep);
  background: linear-gradient(135deg, #f0e4c4 0%, var(--accent-teal) 100%);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    visibility 0.3s ease;
  pointer-events: none;
}

.copy-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

@media (max-width: 480px) {
  .info-list__item {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-list__value {
    text-align: left;
  }

  .tools-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-input {
    max-width: none;
  }
}
