/* ════════════════════════════════════════════════
   TOOLZONE — MAIN STYLESHEET
   ════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800;900&family=DM+Sans:wght@400;500;600&display=swap');

/* ── VARIABLES ── */
:root {
  --navy:        #1C1C2E;
  --accent:      #C84B00;
  --accent2:     #FF6B1A;
  --text:        #1A1A2E;
  --muted:       #888;
  --bg:          #F5F4F1;
  --white:       #ffffff;
  --border:      #E8E5E0;
  --green:       #1A6B3C;
  --light-green: #E8F5EE;
  --light-orange:#FEF0E8;
  --light-blue:  #E8EEF8;
  --light-purple:#F0EAF8;
  --radius:      13px;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── HEADER ── */
header {
  background: var(--navy);
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}
.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 900; font-size: 13px; color: #fff;
}
.logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.5px;
}
.logo-text span { color: #FF8147; }

/* ── NAV ── */
.top-nav { display: flex; gap: 2px; }
.top-nav a {
  padding: 7px 13px;
  color: rgba(255,255,255,0.55);
  font-size: 12px; font-weight: 600;
  border-radius: 7px;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
}
.top-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.top-nav a.active { background: var(--accent); color: #fff; }
.top-nav a.nav-admin {
  background: rgba(200,75,0,0.18);
  color: #FF8147;
  border: 1px solid rgba(200,75,0,0.3);
  margin-left: 8px;
}
.top-nav a.nav-admin:hover { background: rgba(200,75,0,0.3); }
.mob-btn {
  display: none;
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  font-size: 22px; cursor: pointer; padding: 4px;
}
.mob-nav {
  display: none; flex-direction: column;
  background: var(--navy);
  padding: 12px 16px; gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mob-nav.open { display: flex; }
.mob-nav a {
  padding: 10px 14px;
  color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 600;
  border-radius: 7px; text-decoration: none;
  font-family: 'Sora', sans-serif;
  transition: background 0.12s;
}
.mob-nav a:hover { background: rgba(255,255,255,0.06); }
.mob-nav .mob-admin {
  color: #FF8147;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 6px; padding-top: 16px;
}

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, #1C1C2E 0%, #2A1A3E 60%, #1C1C2E 100%);
  padding: 72px 32px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(200,75,0,0.18) 0%, transparent 65%);
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(200,75,0,0.18);
  color: #FF8147;
  border: 1px solid rgba(200,75,0,0.3);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 22px;
  font-family: 'Sora', sans-serif;
}
.hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(32px,5vw,52px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 em { color: #FF8147; font-style: normal; }
.hero p { font-size: 16px; color: rgba(255,255,255,0.6); margin-bottom: 32px; max-width: 480px; margin-inline: auto; }
.hero-stats { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; }
.hstat-n { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 900; color: #fff; }
.hstat-l { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; font-weight: 600; }

/* ── SEARCH ── */
.search-wrap { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 32px; }
.search-inner { max-width: 560px; margin: 0 auto; position: relative; }
.search-inner input {
  width: 100%; padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
  background: var(--bg); transition: border-color 0.15s;
}
.search-inner input:focus { outline: none; border-color: var(--accent); background: #fff; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ── CATEGORY GRID ── */
.home-section { padding: 40px 32px 60px; max-width: 1200px; margin: 0 auto; }
.section-title { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.cat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.cat-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: block;
}
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.cat-icon { font-size: 28px; margin-bottom: 12px; }
.cat-name { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cat-count { font-size: 12px; color: var(--muted); }

/* ── TOOL PAGE ── */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
}
.page-header-inner { max-width: 1100px; margin: 0 auto; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  text-decoration: none; margin-bottom: 12px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }
.page-title-row { display: flex; align-items: center; gap: 14px; }
.page-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.page-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.tools-content { max-width: 1100px; margin: 0 auto; padding: 28px 32px 60px; }
.tool-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }

/* ── TOOL CARD ── */
.tool-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tool-card[style*="display:none"] { display: none !important; }
.tc-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 18px 0;
}
.tc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.tc-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.tc-sub { font-size: 11px; color: var(--muted); }
.tc-body { padding: 16px 18px 18px; }

/* ── FORM ELEMENTS ── */
.fg { margin-bottom: 12px; }
.fg label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.fg input, .fg select, .fg textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  background: var(--bg); transition: border-color 0.15s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
}
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border: none; border-radius: 9px;
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s; width: 100%; margin-top: 4px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; box-shadow: 0 3px 10px rgba(200,75,0,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(200,75,0,0.35); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 12px; width: auto; }

/* ── RESULTS ── */
.result {
  margin-top: 14px; padding: 14px;
  background: var(--bg); border-radius: 10px;
  display: none; animation: fadeIn 0.3s ease;
}
.result.show { display: block; }
.result-val { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 900; color: var(--accent); }
.result-label { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.result-detail { font-size: 13px; color: var(--text); margin-top: 8px; line-height: 1.6; }
.result-out { font-family: monospace; font-size: 13px; white-space: pre-wrap; line-height: 1.7; color: var(--text); }

/* ── AD SLOTS ── */
.ad-slot {
  background: var(--border); border-radius: 10px;
  padding: 20px; text-align: center;
  color: var(--muted); font-size: 12px; margin-bottom: 20px;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
}
.ad-slot:empty { display: none; }

/* ── FOOTER ── */
footer {
  background: var(--navy); color: rgba(255,255,255,0.5);
  padding: 40px 32px 28px;
  font-size: 13px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand .logo-text { font-size: 16px; margin-bottom: 8px; }
.footer-brand p { font-size: 12px; color: rgba(255,255,255,0.35); line-height: 1.7; }
.footer-col h4 { font-family: 'Sora', sans-serif; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255,255,255,0.45); font-size: 12px; margin-bottom: 8px; text-decoration: none; transition: color 0.15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; }

/* ── FLASH ── */
.flash-msg { padding: 12px 18px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  background: var(--navy); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; font-family: 'Sora', sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ── PRINT ── */
#print-overlay { display: none; position: fixed; inset: 0; z-index: 8000; background: #fff; overflow: auto; padding: 40px; }
#print-overlay.active { display: block; }
.po-toolbar { display: flex; gap: 12px; margin-bottom: 24px; }
@media print {
  header, footer, .search-wrap, .mob-nav, .po-toolbar, #toast { display: none !important; }
  #print-overlay.active { padding: 0; }
}

/* ── BMI BAR ── */
.bmi-bar { height: 12px; border-radius: 6px; background: linear-gradient(to right,#4CAF50,#8BC34A,#FFC107,#FF5722,#F44336); margin-bottom: 12px; position: relative; }
.bmi-ptr { position: absolute; top: -4px; width: 4px; height: 20px; background: var(--navy); border-radius: 2px; transform: translateX(-50%); transition: left 0.5s; }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) { .cat-grid { grid-template-columns: repeat(2,1fr); } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .top-nav { display: none; }
  .mob-btn { display: block; }
  header { padding: 0 20px; }
  .hero { padding: 48px 20px 44px; }
  .home-section, .tools-content { padding-inline: 16px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .search-wrap { padding: 12px 16px; }
}
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr; } .footer-grid { grid-template-columns: 1fr; } }
