/* =============================================
   Shared Tool Page Styles
   Replace YOUR_PUB_ID with your AdSense publisher ID
   ============================================= */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 58px;
}
.site-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  white-space: nowrap;
}
.site-nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  flex: 1;
}
.site-nav a {
  font-size: .85rem;
  color: var(--text-muted);
  padding: .3rem .7rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.site-nav a:hover, .site-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

/* Ad banner */
.ad-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: .5rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: .8rem;
  letter-spacing: .05em;
}

/* Layout */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  flex: 1;
}
@media (max-width: 820px) {
  .page-wrap { grid-template-columns: 1fr; padding: 1.25rem 1rem; }
}

/* Main tool area */
.tool-main h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .4rem;
}
.tool-tagline {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 1.5rem;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Inputs */
label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { resize: vertical; min-height: 130px; font-family: "SF Mono", "Fira Code", monospace; font-size: .88rem; }
.field { margin-bottom: 1.1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f1f5f9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-group { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

/* Output */
.output-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: .88rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 80px;
  position: relative;
}
.output-box.empty { color: #475569; font-style: italic; }
.copy-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  padding: .25rem .6rem;
  background: rgba(255,255,255,.1);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 5px;
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Options row */
.options-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
input[type="checkbox"], input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
  cursor: pointer;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* Alert / toast */
.alert {
  padding: .7rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-top: .75rem;
  display: none;
}
.alert.show { display: block; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Badge */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #d1fae5; color: #065f46; }

/* Sidebar */
.tool-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar-card h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.related-links { list-style: none; }
.related-links li a {
  display: block;
  padding: .6rem 1rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .12s;
}
.related-links li:last-child a { border-bottom: none; }
.related-links li a:hover { background: var(--primary-light); text-decoration: none; }
.ad-sidebar {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
}

/* Content section */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.content-section h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.content-section h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.content-section p { font-size: .93rem; color: var(--text-muted); margin-bottom: .7rem; }
.content-section ul { padding-left: 1.3rem; font-size: .93rem; color: var(--text-muted); }
.content-section li { margin-bottom: .3rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: .85rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; font-size: .95rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: "+"; font-size: 1.2rem; color: var(--primary); }
.faq-q.open::after { content: "−"; }
.faq-a { font-size: .88rem; color: var(--text-muted); margin-top: .5rem; display: none; }
.faq-a.show { display: block; }

/* In-content ad */
.ad-incontent {
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* Cookie banner */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
  flex-wrap: wrap;
  display: none;
}
#cookie-banner p { flex: 1; font-size: .85rem; min-width: 200px; }
#cookie-banner a { color: #818cf8; }
.cookie-btns { display: flex; gap: .5rem; }
.cookie-btns button {
  padding: .4rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
}
#cookie-accept { background: var(--primary); color: #fff; }
#cookie-reject { background: transparent; border: 1px solid #475569 !important; color: #94a3b8; }

/* Utils */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.text-sm { font-size: .85rem; color: var(--text-muted); }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
