/* ===========================
   UsefulTools.eu — Global CSS
   =========================== */

:root {
  --bg: #0d1117;
  --bg2: #161b24;
  --card-bg: #1a2030;
  --border: #252e3f;
  --text: #e6edf3;
  --text-muted: #7d8fa8;
  --accent: #3b82f6;
  --accent-soft: rgba(59,130,246,0.12);
  --accent-hover: #2563eb;
  --green: #22c55e;
  --font: 'Sora', sans-serif;
  --mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.18rem; font-weight: 800; text-decoration: none; color: var(--text);
  letter-spacing: -0.02em; flex-shrink: 0;
}
.logo span { color: var(--accent); }

/* hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.2s;
}
.header-inner nav {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.header-inner nav a {
  font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none; padding: 5px 10px; border-radius: 7px;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.header-inner nav a:hover { background: var(--card-bg); color: var(--text); }

/* ---- Horizontal tool nav (index page) ---- */
.tool-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.tool-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.tool-nav-inner::-webkit-scrollbar { display: none; }
.tool-nav-inner a {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 14px;
  font-size: 0.83rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tool-nav-inner a:hover { color: var(--text); border-bottom-color: var(--accent); }
.tool-nav-inner a .nav-icon { font-size: 0.95rem; }

/* ---- Page layout ---- */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
  flex: 1;
}
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .header-inner nav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); flex-direction: column; gap: 0; padding: 8px 16px 12px; z-index: 200; }
  .header-inner nav.open { display: flex; }
  .header-inner nav a { padding: 10px 8px; border-radius: 0; border-bottom: 1px solid var(--border); }
  .page-layout { padding: 24px 16px; }
}

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.ad-box {
  background: var(--card-bg); border: 1px dashed var(--border);
  border-radius: 14px; padding: 12px;
  min-height: 250px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.78rem; text-align: center;
}
.ad-box-wide {
  background: var(--card-bg); border: 1px dashed var(--border);
  border-radius: 14px; padding: 12px;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.78rem;
  margin-bottom: 28px;
}
.sidebar-links {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.sidebar-links p.sidebar-heading {
  font-size: 0.78rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px;
}
.sidebar-links a {
  display: block; padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem; text-decoration: none; color: var(--text);
  transition: color 0.12s;
}
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--accent); }

/* ---- Tool content area ---- */
.page-title-section { margin-bottom: 32px; }
.page-breadcrumb { font-size: 0.78rem; color: var(--text-muted); font-family: var(--mono); margin-bottom: 10px; }
.page-breadcrumb a { color: var(--accent); text-decoration: none; }
.page-breadcrumb a:hover { text-decoration: underline; }
.page-title-section h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; line-height: 1.15; margin-bottom: 10px; }
.page-title-section h1 span { color: var(--accent); }
.page-title-section p { color: var(--text-muted); font-size: 1rem; max-width: 560px; }

/* ---- Tool shell ---- */
.tool-shell {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 28px;
}
@media (max-width: 600px) { .tool-shell { padding: 22px 18px; } }

/* ---- Inputs ---- */
input[type="text"], input[type="number"], input[type="email"],
input[type="date"], select, textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus,
input[type="date"]:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 7px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff;
  font-family: var(--font); font-weight: 600; font-size: 0.95rem;
  border: none; border-radius: 10px;
  padding: 13px 28px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); transform: none; }

/* ---- Result box ---- */
.result-box {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 22px 24px;
  margin-top: 20px;
}
.result-value {
  font-size: 2.2rem; font-weight: 800; color: var(--accent);
  font-family: var(--mono); word-break: break-all; line-height: 1.2;
}
.result-label {
  font-size: 0.82rem; color: var(--text-muted); margin-top: 6px;
}

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
.flex-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

/* ---- Tabs ---- */
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-btn {
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-muted);
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-btn:hover:not(.active) { border-color: var(--accent); color: var(--text); }

/* ---- Word tags ---- */
.word-tag {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 7px; padding: 5px 12px;
  font-size: 0.88rem; margin: 4px; cursor: pointer;
  font-family: var(--mono); transition: background 0.12s;
}
.word-tag:hover { background: rgba(59,130,246,0.22); }

/* ---- Badge ---- */
.badge {
  display: inline-block; font-size: 0.75rem; font-family: var(--mono);
  padding: 3px 10px; border-radius: 20px;
  background: rgba(34,197,94,0.15); color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
}

/* ---- Info / FAQ ---- */
.info-section { margin-top: 40px; }
.info-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }
.info-section p { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 12px; line-height: 1.75; }
.faq-item { border-top: 1px solid var(--border); padding: 16px 0; }
.faq-item h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.faq-item p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2); padding: 20px 24px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap; gap: 10px;
}
.footer-inner nav { display: flex; gap: 16px; }
.footer-inner nav a { color: var(--text-muted); text-decoration: none; }
.footer-inner nav a:hover { color: var(--text); }

main { flex: 1; }


/* ── Rich content sections (AdSense approval) ── */

.rich-content-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.rich-content-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
}
.rich-content-section h2:first-child { margin-top: 0; }
.rich-content-section h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.rich-content-section p { color: var(--text-muted); line-height: 1.7; margin: 0 0 14px; }
.rich-content-section ul, .rich-content-section ol {
  color: var(--text-muted); line-height: 1.7; padding-left: 20px; margin: 0 0 14px;
}
.rich-content-section li { margin-bottom: 6px; }
.rich-content-section code {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 0.85em; color: var(--accent);
}
.faq-block { margin-top: 8px; }
.faq-block .faq-item { margin-bottom: 18px; padding: 14px 16px; background: var(--bg2); border-radius: 10px; border: 1px solid var(--border); }
.faq-block .faq-item h3 { font-size: 0.93rem; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.faq-block .faq-item p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
