/* =================================================================
   Tools page styles — list, cards, individual tool layouts
   ================================================================= */

.tools-filters {
  margin-bottom: 1.5rem;
}

.tools-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tools-filter-chip:hover {
  border-color: rgba(124, 58, 237, 0.4);
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}

.tools-filter-chip.is-active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

body[data-theme="dark"] .tools-filter-chip {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .tools-filter-chip:hover {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.16);
  color: #c4b5fd;
}

/* ===== Tool card ===== */
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.4rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(124, 58, 237, 0.04));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(124, 58, 237, 0.25);
  text-decoration: none;
  color: inherit;
}

.tool-card:hover::before { opacity: 1; }

body[data-theme="dark"] .tool-card {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .tool-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.tool-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.tool-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.2rem 0;
  color: #1e293b;
}

body[data-theme="dark"] .tool-card__title { color: #f1f5f9; }

.tool-card__tagline {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7c3aed;
  margin: 0 0 0.6rem 0;
}

body[data-theme="dark"] .tool-card__tagline { color: #c4b5fd; }

.tool-card__desc {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

body[data-theme="dark"] .tool-card__desc { color: #94a3b8; }

.tool-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c3aed;
}

body[data-theme="dark"] .tool-card__cta { color: #c4b5fd; }

.tool-card__cta i {
  transition: transform 0.18s ease;
}

.tool-card:hover .tool-card__cta i { transform: translateX(4px); }

.tools-empty { padding: 4rem 1rem; }

/* ===== Individual tool page ===== */
.tool-page {
  padding: 6rem 0 3rem;
  min-height: 70vh;
}

.tool-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s ease;
}

.tool-page__back:hover { color: #7c3aed; }

body[data-theme="dark"] .tool-page__back { color: #94a3b8; }
body[data-theme="dark"] .tool-page__back:hover { color: #c4b5fd; }

.tool-page__head {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.5rem 1.6rem;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

body[data-theme="dark"] .tool-page__head {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}

.tool-page__icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.3);
}

.tool-page__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c3aed;
  margin-bottom: 0.2rem;
}

body[data-theme="dark"] .tool-page__eyebrow { color: #c4b5fd; }

.tool-page__title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.3rem 0;
  color: #0f172a;
}

body[data-theme="dark"] .tool-page__title { color: #f1f5f9; }

.tool-page__desc {
  margin: 0;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
  max-width: 640px;
}

body[data-theme="dark"] .tool-page__desc { color: #cbd5e1; }

.tool-page__body {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

body[data-theme="dark"] .tool-page__body {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}

.tool-page__about {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(37, 99, 235, 0.04));
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 1rem;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}

body[data-theme="dark"] .tool-page__about {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.25);
}

.tool-page__about-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #6d28d9;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body[data-theme="dark"] .tool-page__about-title { color: #c4b5fd; }

.tool-page__about-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #475569;
}

body[data-theme="dark"] .tool-page__about-text { color: #cbd5e1; }

.tool-page__related-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #0f172a;
}

body[data-theme="dark"] .tool-page__related-title { color: #f1f5f9; }

/* ===== Tool form controls (shared) ===== */
.tool-form .form-label {
  font-weight: 600;
  font-size: 0.78rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

body[data-theme="dark"] .tool-form .form-label { color: #cbd5e1; }

.tool-form .form-control,
.tool-form .form-select {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  background-color: #fff;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body[data-theme="dark"] .tool-form .form-control,
body[data-theme="dark"] .tool-form .form-select {
  background: #020617;
  border-color: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

.tool-form .form-control:focus,
.tool-form .form-select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
  outline: 0;
}

.tool-form textarea.form-control {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  line-height: 1.55;
  min-height: 220px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background: #f1f5f9;
  color: #0f172a;
}

.tool-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tool-btn--primary {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

.tool-btn--primary:hover {
  filter: brightness(1.05);
  color: #fff;
  transform: translateY(-1px);
}

.tool-btn--ghost {
  background: transparent;
  color: #64748b;
  border-color: rgba(0, 0, 0, 0.08);
}

.tool-btn--ghost:hover {
  background: rgba(15, 23, 42, 0.04);
}

.tool-btn.is-copied {
  background: #10b981;
  color: #fff;
}

body[data-theme="dark"] .tool-btn {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}
body[data-theme="dark"] .tool-btn:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #fff;
}
body[data-theme="dark"] .tool-btn--ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

/* ===== Color converter ===== */
.color-preview {
  width: 100%;
  height: 160px;
  border-radius: 1rem;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 8px 24px rgba(15, 23, 42, 0.1);
  margin-bottom: 1rem;
  position: relative;
  cursor: pointer;
}

.color-preview input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.color-values { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }

.color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border-radius: 0.6rem;
  padding: 0.4rem 0.6rem;
}

body[data-theme="dark"] .color-row {
  background: rgba(148, 163, 184, 0.08);
}

.color-row label {
  width: 56px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
}

.color-row input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  outline: none;
  color: #0f172a;
}

body[data-theme="dark"] .color-row input { color: #e2e8f0; }

.color-shades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
}

.color-shades__swatch {
  height: 56px;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
  transition: transform 0.15s ease;
}

.color-shades__swatch:hover { transform: scale(1.06); }

.color-shades__swatch::after {
  content: attr(data-hex);
  position: absolute;
  bottom: -1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: #64748b;
}

body[data-theme="dark"] .color-shades__swatch::after { color: #94a3b8; }

/* ===== JSON formatter ===== */
.json-status {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.json-status.is-valid { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16, 185, 129, 0.25); }
.json-status.is-invalid { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.3); }

body[data-theme="dark"] .json-status.is-valid { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
body[data-theme="dark"] .json-status.is-invalid { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* ===== Password generator ===== */
.password-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f1f5f9;
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

body[data-theme="dark"] .password-display {
  background: rgba(148, 163, 184, 0.1);
}

.password-display__value {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.05em;
  word-break: break-all;
  min-width: 0;
}

body[data-theme="dark"] .password-display__value { color: #f1f5f9; }

.password-meter {
  height: 8px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

body[data-theme="dark"] .password-meter { background: rgba(255,255,255,0.06); }

.password-meter__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: all 0.25s ease;
}

.password-meter__bar.weak       { width: 25%; background: #ef4444; }
.password-meter__bar.fair       { width: 55%; background: #f59e0b; }
.password-meter__bar.strong     { width: 80%; background: #22c55e; }
.password-meter__bar.very_strong{ width: 100%; background: linear-gradient(90deg, #10b981, #06b6d4); }

.password-meter__label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.4rem;
  color: #64748b;
}

body[data-theme="dark"] .password-meter__label { color: #94a3b8; }

.password-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.password-options .form-check {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem 0.55rem 2.2rem;
  margin: 0;
}

body[data-theme="dark"] .password-options .form-check {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}

/* ===== Word counter ===== */
.word-counter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.word-stat {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(37, 99, 235, 0.04));
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 0.7rem;
  padding: 0.75rem 0.9rem;
  text-align: center;
}

body[data-theme="dark"] .word-stat {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
}

.word-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6d28d9;
  font-family: ui-monospace, monospace;
}

body[data-theme="dark"] .word-stat__value { color: #c4b5fd; }

.word-stat__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
}

body[data-theme="dark"] .word-stat__label { color: #94a3b8; }

/* ===== Base64 ===== */
.base64-modes {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 0.6rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
}

body[data-theme="dark"] .base64-modes { background: rgba(148, 163, 184, 0.1); }

.base64-modes button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.base64-modes button.is-active {
  background: #fff;
  color: #7c3aed;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] .base64-modes button.is-active {
  background: #0f172a;
  color: #c4b5fd;
}

.base64-image-drop {
  border: 2px dashed rgba(124, 58, 237, 0.3);
  border-radius: 0.8rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(124, 58, 237, 0.03);
}

.base64-image-drop:hover,
.base64-image-drop.is-dragover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.6);
}

body[data-theme="dark"] .base64-image-drop {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.4);
}

.base64-image-drop input[type="file"] { display: none; }

.base64-image-drop i {
  font-size: 1.8rem;
  color: #7c3aed;
  margin-bottom: 0.6rem;
}

.base64-image-preview {
  margin-top: 1rem;
  text-align: center;
}

.base64-image-preview img {
  max-height: 160px;
  border-radius: 0.5rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}
