/* ── Redirect Chain Analyzer ─────────────────────────────────────── */

/* Tool hero (shared pattern) */
.tool-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tool-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.tool-desc {
  color: var(--muted2);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Form */
.redirects-form .form-row {
  display: flex;
  gap: 10px;
}
.redirects-form .input-wrap--url { flex: 1; }
.redirects-form .input {
  width: 100%;
  height: 44px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--mono);
  transition: border-color .2s, box-shadow .2s;
}
.redirects-form .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,138,248,.3);
}
.redirects-form .btn-primary {
  min-height: 44px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s, filter .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.redirects-form .btn-primary:hover { transform: scale(1.02); filter: brightness(1.1); }
.redirects-form .btn-primary:active { transform: scale(0.98); }
.redirects-form .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

/* Options row */
.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  align-items: center;
}
.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.option-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.select {
  height: 34px;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}
.select:focus {
  outline: none;
  border-color: var(--accent);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted2);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

}

/* ── Chain Timeline ──────────────────────────────────────────────── */

.redirects-results {
  margin-top: 16px;
  animation: redir-fadeIn .4s ease-out;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(91,138,248,.15);
}
.result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

/* Copy button */
.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted2);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-copy.copied {
  color: #22c55e;
  border-color: #22c55e;
  background: rgba(34,197,94,.08);
}

/* Timeline */
.chain-timeline {
  position: relative;
  padding: 0;
}

.chain-step {
  display: flex;
  gap: 16px;
  opacity: 0;
  animation: redir-stepIn .4s ease-out forwards;
}

.chain-step--loop .chain-content {
  border-color: var(--danger);
  background: rgba(239,68,68,.05);
}

.chain-step--final .chain-content {
  border-color: #22c55e;
}

/* Node (dot + vertical line) */
.chain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 36px;
}
.chain-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  background: var(--surface2);
  border: 2px solid var(--border2);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.chain-dot.status-permanent { background: var(--accent); border-color: var(--accent); }
.chain-dot.status-temporary { background: #eab308; border-color: #eab308; color: #000; }
.chain-dot.status-temp-method { background: #f97316; border-color: #f97316; }
.chain-dot.status-success { background: #22c55e; border-color: #22c55e; }
.chain-dot.status-client-error { background: var(--danger); border-color: var(--danger); }
.chain-dot.status-server-error { background: var(--danger); border-color: var(--danger); }
.chain-dot.status-unknown { background: var(--muted); border-color: var(--muted); }
.chain-dot--loop { background: var(--danger); border-color: var(--danger); }

.chain-line {
  width: 2px;
  flex: 1;
  min-height: 12px;
  background: var(--border2);
}

/* Content card */
.chain-content {
  flex: 1;
  padding: 14px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: 10px;
  margin-bottom: 4px;
  transition: border-color .2s;
}
.chain-content:hover {
  border-color: var(--border2);
}

/* Status badge */
.chain-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  margin-right: 8px;
}
.chain-badge.status-permanent { background: rgba(91,138,248,.15); color: var(--accent); }
.chain-badge.status-temporary { background: rgba(234,179,8,.15); color: #eab308; }
.chain-badge.status-temp-method { background: rgba(249,115,22,.15); color: #f97316; }
.chain-badge.status-success { background: rgba(34,197,94,.15); color: #22c55e; }
.chain-badge.status-client-error { background: rgba(239,68,68,.15); color: var(--danger); }
.chain-badge.status-server-error { background: rgba(239,68,68,.15); color: var(--danger); }
.chain-badge.status-unknown { background: rgba(163,163,163,.15); color: var(--muted); }
.chain-badge--loop { background: rgba(239,68,68,.2); color: var(--danger); }
.chain-badge--error { background: rgba(239,68,68,.15); color: var(--danger); }

/* Time */
.chain-time {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

/* URL */
.chain-url {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  margin-top: 6px;
  word-break: break-all;
  line-height: 1.4;
}

/* Error message in hop */
.chain-error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* Meta info (Location, cookies) */
.chain-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.chain-meta-item {
  font-size: 12px;
  margin-bottom: 3px;
  line-height: 1.4;
}
.meta-label {
  color: var(--muted);
  font-weight: 500;
}
.meta-value {
  color: var(--cyan);
  font-family: var(--mono);
  word-break: break-all;
}

/* Arrow between steps */
.chain-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  padding: 2px 0;
  margin-left: 10px;
  opacity: 0;
  animation: redir-stepIn .3s ease-out forwards;
}

/* ── Summary ─────────────────────────────────────────────────────── */

.redirect-summary {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.summary-card {
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: border-color .2s, transform .15s;
}
.summary-card:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}
.summary-card--wide {
  grid-column: 1 / -1;
  text-align: left;
}
.summary-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}
.summary-value--url {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  color: var(--cyan);
}

/* ── Warnings ────────────────────────────────────────────────────── */

.redirect-warnings {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.warning-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.warning-badge--error {
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.25);
}
.warning-badge--warn {
  background: rgba(234,179,8,.1);
  color: #eab308;
  border: 1px solid rgba(234,179,8,.25);
}
.warning-badge--info {
  background: rgba(91,138,248,.08);
  color: var(--accent);
  border: 1px solid rgba(91,138,248,.2);
}

/* ── Error / Loading (shared pattern) ────────────────────────────── */

.redirects-error { margin-top: 16px; animation: redir-fadeIn .3s ease-out; }
.card-error { border-color: rgba(248,113,113,.3); }
.card-error p { color: var(--red, var(--danger)); font-size: 14px; margin: 0; }

.redirects-loading { margin-top: 16px; text-align: center; }
.loader-bar {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 2px;
  animation: redir-load 1.2s ease-in-out infinite;
}
.loader-text {
  font-size: 13px;
  color: var(--muted2);
  text-align: center;
}

/* Info section */
.info-section {
  margin-top: 32px;
}
.info-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(91,138,248,.15);
}
.info-section p {
  font-size: 14px;
  color: var(--muted2);
  line-height: 1.7;
}

/* ── Animations ──────────────────────────────────────────────────── */

@keyframes redir-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes redir-stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes redir-load {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-card--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .redirects-form .form-row { flex-direction: column; }
  .redirects-form .btn-primary { width: 100%; justify-content: center; }
  .redirects-form .input { width: 100%; }
  .form-options { flex-direction: column; align-items: flex-start; gap: 10px; }
  .chain-step { gap: 10px; }
  .chain-content { padding: 10px 12px; }
  .chain-url { font-size: 12px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-value { font-size: 16px; }
}
