/* ============ HTMLTOOLKIT.DEV — SHARED STYLES ============ */
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Syne:wght@400;500;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* THEMES */
:root {
  --bg: #0e0e10;
  --bg2: #17171a;
  --bg3: #1f1f23;
  --bg4: #2a2a2f;
  --border: #2e2e34;
  --border2: #3e3e46;
  --text: #e8e8ec;
  --text2: #b9b9c7;
  --text3: #c7c7ff;
  --accent: #7c6dfa;
  --green: #2ecc8a;
  --red: #e05252;
  --amber: #e8a830;
  --blue: #4a9eff;
  --radius: 8px;
  --radius-lg: 12px;
  --nav-h: 56px;
}
html.theme-light {
  --bg: #f5f5f7;
  --bg2: #ffffff;
  --bg3: #ebebed;
  --bg4: #dddde0;
  --border: #dcdce0;
  --border2: #c8c8cc;
  --text: #1a1a1e;
  --text2: #5a5a6a;
  --text3: #474755;
  --accent: #5b4de8;
  --green: #1a9e5c;
  --red: #c0392b;
  --amber: #b8820a;
}
html.theme-midnight {
  --bg: #0a0f1e;
  --bg2: #0f1628;
  --bg3: #151f38;
  --bg4: #1c2a48;
  --border: #1e2d4a;
  --border2: #2a3d60;
  --text: #d8e4f8;
  --text2: #7a9bc8;
  --text3: #687f9f;
  --accent: #5b9cf8;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
body {
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
/* NAV */
.site-nav {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 16px;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
}
.logo-sub {
  color: var(--text3);
  font-size: 1.1rem;
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
  display: none;
}
.nav-link {
  padding: 5px 10px;
  font-size: 1rem;
  color: var(--text2);
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    background 0.12s,
    color 0.12s;
}
.nav-link:hover {
  background: var(--bg3);
  color: var(--text);
}
.nav-link.active {
  background: var(--bg3);
  color: var(--accent);
}
.nav-cat {
  font-size: 1rem;
  color: var(--text3);
  padding: 5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-left: 2px solid var(--text2);
}
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
}
.theme-label {
  font-size: 10px;
  color: var(--text3);
  font-family: "JetBrains Mono", monospace;
}
.theme-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.12s;
  padding: 0;
}
.theme-btn:hover {
  transform: scale(1.18);
}
.theme-btn.active {
  border-color: var(--accent);
}
.theme-btn.t-dark {
  background: #17171a;
}
.theme-btn.t-light {
  background: #f0f0f2;
  border-color: var(--border2);
}
.theme-btn.t-midnight {
  background: #0f1628;
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg2);
  margin-top: auto;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 1rem;
  color: var(--text3);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text2);
}
.footer-copy {
  font-size: 1rem;
  color: var(--text3);
}

/* MAIN CONTENT WRAPPER */
.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* AD SLOTS */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: var(--bg2);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text3);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}
.ad-slot-sidebar {
  width: 100%;
  min-height: 250px;
  background: var(--bg2);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text3);
  font-family: "JetBrains Mono", monospace;
  margin-top: 16px;
}
.ad-banner-wrap {
  padding: 12px 0;
  width: 100%;
}
.ad-sidebar-wrap {
  padding: 12px 0;
}

/* TOOL PAGE LAYOUT */
.tool-page {
  flex: 1;
  display: flex;
  gap: 0;
}
.tool-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tool-ad-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 16px;
  background: var(--bg2);
}
.tool-header {
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.tool-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.tool-header p {
  font-size: 1.1rem;
  color: var(--text2);
  padding-bottom: 16px;
}

/* SHARED COMPONENTS */
.btn {
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg3);
  color: var(--text);
  font-family: "Syne", sans-serif;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover {
  background: var(--bg4);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  opacity: 0.9;
}
.btn.danger {
  border-color: #5a2a2a;
  color: var(--red);
}
.field-label {
  font-size: 1rem;
  color: var(--text3);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.text-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  font-family: "JetBrains Mono", monospace;
  outline: none;
}
.text-input:focus {
  border-color: var(--accent);
}
.badge {
  font-size: 1rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
}
.badge.pass {
  background: rgba(46, 204, 138, 0.15);
  color: var(--green);
  border: 1px solid rgba(46, 204, 138, 0.3);
}
.badge.fail {
  background: rgba(224, 82, 82, 0.12);
  color: var(--red);
  border: 1px solid rgba(224, 82, 82, 0.25);
}
.sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
input[type="color"] {
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}
input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 4px;
}
put[type="checkbox"] {
  accent-color: var(--accent);
}
input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

/* BREADCRUMB */
.breadcrumb {
  font-size: 1rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.breadcrumb a {
  color: var(--text3);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb span {
  color: var(--text3);
}

/* MOBILE */
@media (max-width: 768px) {
  .site-nav {
    padding: 0 1rem;
    gap: 10px;
  }
  .nav-cat {
    display: none;
  }
  .theme-label {
    display: none;
  }
  .tool-page {
    flex-direction: column;
  }
  .tool-ad-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .tool-header {
    padding: 14px 16px 0;
  }
  .breadcrumb {
    padding: 8px 16px;
  }
}
@media (max-width: 480px) {
  .nav-links {
    display: none;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* SHARED UTIL */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
