/* ================================================
   PIXELTOOLS — tool-page.css
   Complement to style.css for individual tool pages.
   Depends on CSS variables already defined in style.css.
   ================================================ */

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 24px 0;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── TOOL HERO ── */
.tool-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 28px;
  position: relative;
  z-index: 10;
}
.tool-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.tool-hero-icon {
  width: 58px; height: 58px;
  border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.tool-hero-text h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.tool-hero-text p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 520px;
}
.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.tool-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}

/* ── TOOL STAGE ── */
.tool-stage {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 56px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── CARD ── */
.tp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px;
}

/* ── SECTION TITLE ── */
.tp-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── DIVIDER ── */
.tp-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ── UPLOAD ZONE ── */
.tp-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.tp-upload-zone:hover,
.tp-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(124,58,237,.04);
}
.tp-upload-zone input[type=file] { display: none; }
.tp-upload-icon { font-size: 38px; margin-bottom: 12px; display: block; }
.tp-upload-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
  margin-bottom: 6px;
}
.tp-upload-sub { font-size: 13px; color: var(--muted); }
.tp-upload-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.tp-upload-btn:hover { border-color: var(--accent); }

/* ── FILE INFO BAR ── */
.tp-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 13px;
  margin-bottom: 16px;
}
.tp-file-info .name {
  font-weight: 600; color: var(--text);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-file-info .size { color: var(--muted); flex-shrink: 0; }
.tp-file-info .remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 2px 4px;
  border-radius: 6px; flex-shrink: 0; line-height: 1;
}
.tp-file-info .remove:hover { color: #ef4444; }

/* ── CONTROLS ── */
.tp-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tp-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tp-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  min-width: 96px;
  flex-shrink: 0;
}
.tp-select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .18s;
  min-height: 38px;
}
.tp-select:focus { border-color: var(--accent); }

.tp-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .18s;
  min-height: 38px;
  flex: 1;
}
.tp-input:focus { border-color: var(--accent); }
.tp-input::placeholder { color: var(--muted); }

.tp-range {
  flex: 1;
  min-width: 140px;
  accent-color: var(--accent);
}
.tp-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 38px;
  text-align: right;
}

/* ── TEXTAREA ── */
.tp-textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 13px;
  resize: vertical;
  outline: none;
  transition: border-color .18s;
  line-height: 1.65;
  min-height: 140px;
  box-sizing: border-box;
}
.tp-textarea:focus { border-color: var(--accent); }
.tp-textarea::placeholder { color: var(--muted); }
.tp-textarea[readonly] { color: var(--accent2); cursor: default; }

/* ── PREVIEW BOX ── */
.tp-preview-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.tp-preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.tp-preview-content {
  font-family: 'DM Mono', monospace, 'Courier New';
  font-size: 12px;
  color: #9ca3af;
  padding: 14px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
.tp-preview-content::-webkit-scrollbar { width: 4px; }
.tp-preview-content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ── STATS GRID ── */
.tp-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tp-stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.tp-stat-num {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}
.tp-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 3px;
}

/* ── BUTTONS ── */
.tp-btn-primary {
  width: 100%;
  padding: 14px 24px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #0c6b84);
  border: none;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .18s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: -.2px;
}
.tp-btn-primary:hover { opacity: .9; }
.tp-btn-primary:active { transform: scale(.98); }
.tp-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.tp-btn-secondary {
  padding: 10px 18px;
  border-radius: 11px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  display: flex; align-items: center; gap: 6px;
}
.tp-btn-secondary:hover { border-color: var(--accent); background: rgba(124,58,237,.04); }

.tp-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tp-btn-row .tp-btn-primary { flex: 1; width: auto; min-width: 160px; }

/* ── PROGRESS BAR ── */
.tp-progress-wrap { display: none; }
.tp-progress-wrap.show { display: block; }
.tp-progress-bar-track {
  background: var(--border);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.tp-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
  border-radius: 6px;
  width: 0%;
  transition: width .3s;
}
.tp-progress-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── RESULT ── */
.tp-result {
  display: none;
  text-align: center;
  padding: 36px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.tp-result.show { display: block; }
.tp-result-icon { font-size: 44px; margin-bottom: 12px; }
.tp-result h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 800;
  margin-bottom: 8px;
}
.tp-result p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.tp-result .btn-download,
.btn-download {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #0c6b84);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity .18s;
  letter-spacing: -.2px;
}
.tp-result .btn-download:hover,
.btn-download:hover { opacity: .88; }

/* ── RELATED TOOLS ── */
.related-tools {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 56px;
}
.related-tools h2 {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 800;
  margin-bottom: 14px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.related-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .18s, transform .15s;
}
.related-card:hover { border-color: rgba(124,58,237,.4); transform: translateY(-2px); }
.related-card-icon { font-size: 18px; flex-shrink: 0; }
.related-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .tool-hero { padding: 20px 16px 20px; }
  .tool-hero-inner { flex-direction: column; gap: 14px; }
  .tool-stage { padding: 0 16px 40px; gap: 12px; }
  .tp-card { padding: 18px 16px; }
  .breadcrumb { padding: 14px 16px 0; }
  .tp-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-control-row { flex-direction: column; align-items: flex-start; }
  .tp-label { min-width: auto; }
  .tp-btn-row { flex-direction: column; }
  .tp-btn-row .tp-btn-primary { flex: none; width: 100%; }
  .related-tools { padding: 0 16px 40px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
