/* ===== BASE RESET & VARIABLES ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1c25;
  --bg-card: #22242f;
  --bg-input: #2a2d3a;
  --border-color: #353849;
  --border-hover: #4a4e63;
  --text-primary: #e8eaed;
  --text-secondary: #9ba1b0;
  --text-muted: #6b7280;
  --accent-1: #6366f1;
  --accent-1-hover: #818cf8;
  --accent-2: #ec4899;
  --accent-3: #10b981;
  --accent-4: #f59e0b;
  --gradient-hero: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(99,102,241,.15);
  --transition: .2s ease;
  --transition-slow: .35s ease;
  --max-width: 1100px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a { color: var(--accent-1-hover); text-decoration: none; transition: color var(--transition); }
a:hover { color: #a5b4fc; }

img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(26,28,37,.82);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--text-primary); }

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-hero);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .3rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.nav-links a.active {
  color: var(--text-primary);
  background: rgba(99,102,241,.15);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: .25rem;
}

/* ===== AD SLOTS ===== */
.ad-slot {
  max-width: var(--max-width);
  margin: 1rem auto;
  padding: 0 1.5rem;
}

.ad-slot > div {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* ===== TOOL PAGE LAYOUT ===== */
.tool-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tool-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: .65rem;
  letter-spacing: -0.03em;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition);
}

.tool-card:hover {
  border-color: var(--border-hover);
}

.tool-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ===== FORM ELEMENTS ===== */
label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .4rem;
}

input[type="text"],
input[type="number"],
input[type="color"],
select,
textarea {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

textarea {
  resize: vertical;
  font-family: var(--font-mono);
  font-size: .875rem;
}

input[type="color"] {
  padding: .25rem;
  height: 48px;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-1);
  height: 6px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover {
  background: var(--accent-1-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 4px rgba(99,102,241,.3);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--border-hover);
}
.btn-secondary:active {
  background: var(--bg-input);
}

.btn-sm {
  padding: .4rem .8rem;
  font-size: .82rem;
}

.btn-copy {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
  font-size: .8rem;
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  font-weight: 600;
}
.btn-copy:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.btn-copy:active {
  transform: scale(0.95);
}
.btn-copy.copied {
  background: var(--accent-3);
  color: #fff;
  border-color: var(--accent-3);
}

/* ===== COLOR SWATCH ===== */
.color-swatch {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition);
}

/* ===== UTILITY CLASSES ===== */
.row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }
.col-auto { flex: none; }
.gap-sm { gap: .5rem; }
.gap-md { gap: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); font-size: .9rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .85rem; }

.inline-flex { display: inline-flex; align-items: center; gap: .5rem; }
.flex-wrap { flex-wrap: wrap; }

.code-output {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-primary);
  position: relative;
  overflow-x: auto;
}

.code-output .btn-copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
}

/* ===== PASS / FAIL BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 700;
}
.badge-pass { background: rgba(16,185,129,.15); color: #34d399; }
.badge-fail { background: rgba(239,68,68,.15); color: #f87171; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: .6rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-1-hover); border-bottom-color: var(--accent-1); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1.5px solid var(--accent-3);
  color: var(--text-primary);
  padding: .7rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(16,185,129,.2);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-description {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 1.25rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-primary); }

.footer-copy {
  color: var(--text-muted);
  font-size: .8rem;
}

/* ===== SEO CONTENT SECTION ===== */
.seo-content {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
}

.seo-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .85rem;
  letter-spacing: -0.02em;
}

.seo-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 .6rem;
  color: var(--text-primary);
}

.seo-content p, .seo-content li {
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.75;
  margin-bottom: .85rem;
}

.seo-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.seo-content code {
  background: var(--bg-input);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--accent-1-hover);
}

/* ===== HOMEPAGE SPECIFICS ===== */
.hero {
  text-align: center;
  padding: 3.5rem 0 2.5rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 1.15rem;
  letter-spacing: -0.04em;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.tool-link-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.tool-link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.tool-link-card:hover {
  border-color: var(--accent-1);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(99,102,241,.15), var(--shadow-glow);
  color: inherit;
}

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

.tool-link-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.15rem;
  flex-shrink: 0;
  transition: transform var(--transition-slow);
}

.tool-link-card:hover .card-icon {
  transform: scale(1.08);
}

.tool-link-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -0.01em;
}

.tool-link-card p {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.6;
  flex: 1;
}

.tool-link-card .card-cta {
  margin-top: 1.15rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent-1-hover);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: gap var(--transition);
}

.tool-link-card:hover .card-cta {
  gap: .6rem;
}

/* ===== MORE TOOLS CROSS-LINKS ===== */
.more-tools {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.more-tools h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text-primary);
}

.more-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.more-tool-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition);
}

.more-tool-card:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,.12);
  color: var(--text-primary);
}

.more-tool-card .mt-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.more-tool-card .mt-label {
  font-size: .9rem;
  font-weight: 600;
}

.more-tool-card .mt-desc {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1.05rem; }
  .tool-header h1 { font-size: 1.7rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .more-tools-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .col { flex: none; width: 100%; }
  .tool-card { padding: 1.5rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(26,28,37,.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: .5rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 1rem; }
  .mobile-toggle { display: block; }
  .footer-inner { text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .header-inner { height: 56px; }
  .main-content { padding: 1.5rem 1rem; }
  .tool-card { padding: 1.25rem; }
  .tool-link-card { padding: 1.5rem; }
}
