/* =========================
   Tools Section Shared CSS
   Used by:
   - /tools.html
   - /sitemap-to-csv.php
   ========================= */

.sub-tab-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px auto 20px;
  padding: 0 12px;
}

.sub-tab-button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, transform 0.15s ease;
}

.sub-tab-button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.sub-tab-button.active {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.tools-grid {
  max-width: 1100px;
  margin: 0 auto 30px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tool-card {
  max-width: 1050px;
  margin: 0 auto 22px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

a.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

a.tool-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.tool-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.tool-card p {
  margin: 0;
  color: #bbb;
  line-height: 1.45;
}

.tool-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.tool-input {
  width: min(620px, 92vw);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  outline: none;
  box-sizing: border-box;
}

.tool-input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.tool-button {
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  min-width: 160px;
  min-height: 56px;
  box-sizing: border-box;
  text-align: center;
}

.tool-button:hover {
  transform: translateY(-1px);
}

.tool-button-primary {
  background: #3b82f6;
  color: #fff;
}

.tool-button-primary:hover {
  opacity: 0.95;
}

.tool-button-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-button-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tool-stats {
  max-width: 1050px;
  margin: 0 auto 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px;
  box-sizing: border-box;
}

.tool-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
}

.tool-results {
  max-width: 1050px;
  margin: 0 auto 20px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.tool-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tool-actions form {
  margin: 0;
  display: flex;
}

.tool-actions form .tool-button,
.tool-actions > .tool-button {
  width: 160px;
}

.tool-group {
  margin-bottom: 22px;
}

.tool-group:last-child {
  margin-bottom: 0;
}

.tool-group-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  word-break: break-word;
}

.tool-group-count {
  color: #999;
  font-weight: 400;
}

.tool-list {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding-left: 24px;
  color: #ddd;
}

.tool-list li {
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-all;
}

.tool-helper {
  text-align: center;
  color: #999;
  font-size: 0.9em;
  margin-top: 8px;
}

.tool-error {
  text-align: center;
  color: #ff8d8d;
  margin-top: 12px;
  font-weight: 700;
}

.tool-empty {
  text-align: center;
  color: #bbb;
}

@media (max-width: 640px) {
  .sub-tab-bar {
    gap: 6px;
    padding: 0 10px;
  }

  .sub-tab-button {
    padding: 9px 12px;
    font-size: 0.95rem;
  }

  .tool-card,
  .tool-results {
    padding: 14px;
  }

  .tool-form {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-input {
    width: 100%;
  }

  .tool-button,
  .tool-button-secondary {
    width: 100%;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
  }

  .tool-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-actions form {
    width: 100%;
  }

  .tool-actions form .tool-button,
  .tool-actions > .tool-button {
    width: 100%;
  }
}