/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #3f82bd;
  --topbar: #d9edf7;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #16a34a;
  --warn: #f59e0b;
  --err: #e11d48;
  --primary: #2563eb;
  --bg: #f7f8fb;
  --card: #ffffff;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.wc-header {
  background: #020617;
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.wc-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wc-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wc-slab,
.slab {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  border-radius: 2px;
  color: #fff;
}

.slab-w,
.wc-slab.slab-w {
  background: #1f2327;
}

.slab-o,
.wc-slab.slab-o {
  background: #a7c1db;
  color: #1e2a3a;
}

.slab-r,
.wc-slab.slab-r {
  background: #7d96ae;
}

.slab-d,
.wc-slab.slab-d {
  background: #2f5d8a;
}

.wc-brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  font-size: 19px;
  font-weight: 800;
}

.wc-brand-text small {
  font-size: 10px;
  opacity: 0.95;
}

.wc-nav {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.wc-link {
  color: #f4f8fc;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: 0.15s;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.wc-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.wc-link.active {
  background: #fff;
  color: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.wc-signin-btn {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wc-signin-btn:hover {
  background: #38bdf8;
  color: #020617;
  border-color: #38bdf8;
}

.mobile-menu-btn {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  display: none;
  cursor: pointer;
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100vh;
  background: #1f2933;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.18);
  transition: right 0.3s;
  z-index: 100;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #34495e;
}

.mobile-close-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.mobile-nav-links {
  padding: 16px;
}

.mobile-link {
  display: block;
  color: #ecf0f1;
  padding: 12px 0;
  border-bottom: 1px solid #34495e;
  font-weight: 700;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 90;
}

.mobile-overlay.active {
  display: block;
}

/* Main layout */
.tools-main {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 0 15px;
}

/* Breadcrumb */
.tools-breadcrumb {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.tools-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tools-breadcrumb li::after {
  content: "/";
  margin-left: 6px;
  color: #9ca3af;
}

.tools-breadcrumb li:last-child::after {
  content: "";
}

.tools-breadcrumb a {
  color: #2563eb;
}

.tools-breadcrumb a:hover {
  text-decoration: underline;
}

/* Hero */
.tools-hero {
  margin-bottom: 22px;
}

.tools-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.tools-hero-text {
  background: radial-gradient(circle at top left, #eef2ff, #f1f5f9);
  border-radius: 16px;
  padding: 18px 18px 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.tools-hero-text h1 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 8px;
}

.tools-hero-text p {
  font-size: 14px;
  color: #4b5563;
  max-width: 620px;
  margin-bottom: 10px;
}

.tools-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tools-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #0f172a;
  color: #e5e7eb;
}

.tools-meta-row i {
  font-size: 11px;
}

/* Hero card */
.tools-hero-card {
  background: #020617;
  color: #e5e7eb;
  border-radius: 16px;
  padding: 16px 16px 14px;
  border: 1px solid #1e293b;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tools-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.tools-hero-badge i {
  font-size: 10px;
}

.tools-hero-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: #e5e7eb;
}

.tools-hero-card p {
  font-size: 13px;
  color: #94a3b8;
}

.hero-cta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  background: #38bdf8;
  color: #020617;
  border: 1px solid #38bdf8;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hero-cta i {
  font-size: 12px;
}

.hero-cta:hover {
  background: #0ea5e9;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.hero-list {
  margin-top: 8px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: #cbd5e1;
}

.hero-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-list i {
  color: #22c55e;
}

/* Controls */
.tools-controls-section {
  margin-bottom: 14px;
}

.tools-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.tools-search {
  flex: 1 1 260px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 5px 15px rgba(148, 163, 184, 0.15);
}

.tools-search i {
  font-size: 13px;
  color: #6b7280;
}

.tools-search input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: #111827;
}

.tools-search input::placeholder {
  color: #9ca3af;
}

.tools-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.15s;
}

.filter-pill i {
  font-size: 11px;
}

.filter-pill:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.filter-pill.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

.tools-controls-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Grid */
.tools-grid-section {
  margin-top: 4px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Tool card */
.tool-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 12px 12px 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
    border-color 0.15s ease-out, background 0.15s ease-out;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  border-color: #bfdbfe;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  color: #1d4ed8;
  font-size: 15px;
}

.tool-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-popular {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}

.badge-new {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
}

.badge-pro {
  background: #dbebff;
  border-color: #2563eb;
  color: #1e3a8a;
}

.badge-beta {
  background: #f5f3ff;
  border-color: #8b5cf6;
  color: #6d28d9;
}

.badge-lab {
  background: #ecfeff;
  border-color: #06b6d4;
  color: #0e7490;
}

.tool-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.tool-card p {
  font-size: 13px;
  color: #4b5563;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
}

.tool-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-meta i {
  font-size: 11px;
}

/* Open Tool button */
.tool-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s,
    box-shadow 0.15s, transform 0.15s;
}

.tool-link i {
  font-size: 12px;
}

.tool-link:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

/* Coming soon style */
.tool-link[data-coming-soon="true"] {
  background: #f1f5f9;
  color: #6b7280;
}

.tool-link[data-coming-soon="true"]:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #4b5563;
  box-shadow: none;
  transform: translateY(0);
}

/* Empty state */
.tools-empty-state {
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: white;
  border: none;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
}

.back-to-top:active {
  transform: translateY(0);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #020617;
  color: #e5e7eb;
  font-size: 13px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.55);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 250;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.pro-footer {
  background: #020617;
  color: #cbd5e1;
  margin-top: 40px;
}

.pf-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 15px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 26px;
}

.pf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-brand-text {
  font-size: 18px;
  font-weight: 800;
  color: #e2e8f0;
}

.pf-brand-text span {
  color: #38bdf8;
}

.pf-tag {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.pf-social {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.pf-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0b1220;
  color: #cbd5e1;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s,
    box-shadow 0.15s;
}

.pf-social a:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0b1220;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.pf-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.pf-col h5 {
  color: #e2e8f0;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}

.pf-col ul {
  list-style: none;
}

.pf-col li {
  margin: 8px 0;
}

.pf-col a {
  color: #94a3b8;
}

.pf-col a:hover {
  color: #e2e8f0;
}

.pf-bottom {
  border-top: 1px solid #1e293b;
  background: #0b1220;
}

.pf-bottom-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #8893a7;
  font-size: 13px;
}

.pf-links {
  display: flex;
  gap: 10px;
}

.pf-links a {
  color: #94a3b8;
}

.pf-links a:hover {
  color: #e2e8f0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  z-index: 200;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 96vw;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  display: none;
  z-index: 210;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.modal-close {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.modal-body {
  padding: 12px;
}

.auth-note {
  font-size: 13px;
  color: #4b5563;
}

/* Responsive */
@media (max-width: 1100px) {
  .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pf-wrap {
    grid-template-columns: 1fr;
  }

  .pf-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .wc-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-block;
  }

  .wc-brand-text {
    font-size: 18px;
  }

  .wc-slab {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .tools-hero-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-search {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .tools-filters {
    justify-content: flex-start;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .pf-cols {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
