/* ==========================================================================
   TOOLS PAGES (SoC)
   Reuses main.css tokens/components (glass-card, section-*, btn, skill-badge).
   ========================================================================== */

.tool-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-3xl) var(--space-md);
  position: relative;
}

.tool-actions-bar {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  z-index: 10;
}

.tool-shell {
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.tool-shell .section-header {
  margin-bottom: var(--space-xl);
}

/* Stacked cards inside a tool page */
.tool-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.tool-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tool-card-title svg {
  color: var(--color-accent);
}

/* ---- Copyable field (IP address, coordinates) ---- */
.copy-field {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color var(--transition-fast);
}

.copy-field + .copy-field {
  margin-top: var(--space-sm);
}

.copy-field:hover {
  border-color: var(--border-glass-active);
}

.copy-field-main {
  flex-grow: 1;
  min-width: 0;
}

.copy-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.copy-field-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-primary);
  word-break: break-all;
}

.copy-field-value.is-muted {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-sans);
}

.copy-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-active);
  background: var(--surface-glass-active);
}

.copy-btn.copied {
  color: #ffffff;
  background: var(--color-success);
  border-color: var(--color-success);
}

.copy-btn .check-icon { display: none; }
.copy-btn.copied .copy-icon { display: none; }
.copy-btn.copied .check-icon { display: block; }

/* ---- Info grid (browser details) ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.info-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.info-value {
  font-size: 0.92rem;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.4;
}

.info-item.full {
  grid-column: 1 / -1;
}

.info-item.full .info-value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ---- Location map + links ---- */
.map-frame {
  width: 100%;
  height: 300px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: block;
  background: var(--bg-secondary);
}

.map-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  background: var(--surface-glass);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.map-link:hover {
  border-color: var(--border-glass-active);
  background: var(--surface-glass-active);
  transform: translateY(-2px);
}

.tool-status {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tool-status.error {
  color: #ef4444;
}

/* ---- Tools index grid ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.tool-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-decoration: none;
  color: inherit;
}

.tool-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.tool-tile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tool-tile-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex-grow: 1;
}

.tool-tile.soon {
  cursor: default;
}

.tool-tile.soon .tool-tile-icon {
  color: var(--text-muted);
}

.tool-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-accent);
}

.tool-badge.muted {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* ---- URL encode/decode tool ---- */
.tool-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.tool-textarea {
  width: 100%;
  min-height: 110px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.url-modes {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: var(--space-lg);
}

.url-mode {
  background: none;
  border: none;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.url-mode.active {
  background: var(--gradient-accent);
  color: #ffffff;
}

.url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.tool-hint {
  margin-top: var(--space-md);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tool-hint code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Back link */
.tool-back {
  margin-top: var(--space-xl);
  text-align: center;
}

.tool-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.tool-back-link:hover {
  color: var(--color-accent);
}

@media (max-width: 480px) {
  .tool-actions-bar {
    top: var(--space-md);
    right: var(--space-md);
  }
}
