/* ============================================================
   simplefreetoolsonline.com — Global Stylesheet
   ============================================================ */

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

:root {
  --clr-bg: #F7F8FA;
  --clr-surface: #FFFFFF;
  --clr-border: #E4E7EC;
  --clr-text: #111827;
  --clr-muted: #6B7280;
  --clr-accent: #2563EB;
  --clr-accent-light: #EFF6FF;
  --clr-green: #059669;
  --clr-green-light: #ECFDF5;
  --clr-orange: #D97706;
  --clr-orange-light: #FFFBEB;
  --clr-red: #DC2626;
  --clr-red-light: #FEF2F2;
  --clr-purple: #7C3AED;
  --clr-purple-light: #F5F3FF;
  --clr-pink: #DB2777;
  --clr-pink-light: #FDF2F8;
  --clr-teal: #0891B2;
  --clr-teal-light: #ECFEFF;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --transition: 0.18s ease;
  --max-w: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

main { flex: 1; }

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--clr-text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px; height: 34px;
  background: var(--clr-accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
}

.logo span { color: var(--clr-accent); }

nav { display: flex; align-items: center; gap: 4px; }
nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--clr-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
nav a:hover { background: var(--clr-bg); color: var(--clr-text); }
nav a.active { color: var(--clr-accent); background: var(--clr-accent-light); }

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 220px;
}
.nav-search input {
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--clr-text);
  outline: none;
  width: 100%;
}
.nav-search input::placeholder { color: var(--clr-muted); }
.nav-search svg { color: var(--clr-muted); flex-shrink: 0; }

/* ── Ad slots ── */
.ad-slot {
  background: #fff;
  border: 1.5px dashed var(--clr-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 500;
}
.ad-slot-banner { height: 90px; width: 100%; margin: 24px 0; }
.ad-slot-square { height: 250px; width: 300px; }
.ad-slot-leaderboard { height: 90px; width: 728px; max-width: 100%; margin: 0 auto 24px; }
.ad-slot-sidebar { height: 600px; width: 100%; }

/* ── Hero / Page Header ── */
.page-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563EB 60%, #3b82f6 100%);
  color: #fff;
  padding: 52px 0 44px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.2;
}
.page-hero p {
  font-size: 16px;
  opacity: .85;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Tool page layout ── */
.tool-page-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  padding: 32px 0 48px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.tool-sidebar { display: flex; flex-direction: column; gap: 20px; }

.tool-card h2 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--clr-text);
}

/* ── Form elements ── */
textarea, input[type=text], input[type=number], input[type=email], select {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--clr-text);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea:focus, input:focus, select:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

label { font-size: 13px; font-weight: 500; color: var(--clr-muted); display: block; margin-bottom: 6px; }

.form-group { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--clr-accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-secondary {
  background: var(--clr-bg);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}
.btn-secondary:hover { background: #fff; box-shadow: var(--shadow-sm); }

.btn-success { background: var(--clr-green); }
.btn-success:hover { background: #047857; box-shadow: 0 4px 12px rgba(5,150,105,.3); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ── Result box ── */
.result-box {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  min-height: 80px;
  word-break: break-all;
  margin-top: 16px;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--clr-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.copy-btn:hover { color: var(--clr-accent); border-color: var(--clr-accent); }

/* ── Stats bar (word counter style) ── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.stat {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  text-align: center;
  min-width: 90px;
}
.stat-val { font-size: 22px; font-weight: 700; color: var(--clr-accent); }
.stat-label { font-size: 11px; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ── Related tools card ── */
.related-tools { background: #fff; border: 1px solid var(--clr-border); border-radius: var(--radius); padding: 18px; }
.related-tools h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .04em; }
.related-tool-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--clr-text);
  text-decoration: none;
  transition: background var(--transition);
}
.related-tool-link:hover { background: var(--clr-bg); text-decoration: none; }
.related-tool-link .ricon { font-size: 16px; }

/* ── Homepage hero ── */
.home-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  color: #fff;
  padding: 72px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.home-hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 14px;
  position: relative;
}
.home-hero h1 span { color: #60a5fa; }
.home-hero p { font-size: 17px; opacity: .82; max-width: 520px; margin: 0 auto 30px; position: relative; }

.home-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  overflow: hidden;
  position: relative;
}
.home-search input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  font-size: 15px;
  background: transparent;
  color: var(--clr-text);
  outline: none;
  min-width: 0;
}
.home-search button {
  background: var(--clr-accent);
  border: none;
  color: #fff;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition);
}
.home-search button:hover { background: #1d4ed8; }

/* ── Category grid ── */
.cats-section { padding: 40px 0 24px; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--clr-text);
}
.section-title span { color: var(--clr-accent); }

.cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

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

.cat-card {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.cat-card-head {
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-card-head .icon { font-size: 18px; }

.cat-card-body { padding: 0 0 8px; }

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-top: 1px solid var(--clr-border);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--clr-text);
  text-decoration: none;
  transition: background var(--transition);
}
.tool-link:hover { background: var(--clr-bg); color: var(--clr-accent); text-decoration: none; }
.tool-link-arrow { color: var(--clr-muted); font-size: 12px; }

/* Category colour themes */
.cat-image .cat-card-head { background: #FDF2F8; color: #9D174D; }
.cat-text .cat-card-head  { background: #F5F3FF; color: #5B21B6; }
.cat-dev .cat-card-head   { background: #ECFDF5; color: #065F46; }
.cat-file .cat-card-head  { background: #EFF6FF; color: #1E40AF; }
.cat-calc .cat-card-head  { background: #FFFBEB; color: #92400E; }
.cat-sec .cat-card-head   { background: #FEF2F2; color: #991B1B; }

/* ── Footer ── */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
}

.footer-brand .logo { color: #fff; margin-bottom: 12px; display: flex; }
.footer-brand p { font-size: 13.5px; line-height: 1.7; color: #94a3b8; max-width: 280px; }

.footer-col h4 { color: #f1f5f9; font-size: 13px; font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
.footer-col a { display: block; color: #94a3b8; font-size: 13.5px; margin-bottom: 7px; text-decoration: none; transition: color var(--transition); }
.footer-col a:hover { color: #60a5fa; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--clr-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--clr-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--clr-accent); }
.breadcrumb .sep { opacity: .4; }

/* ── Info / SEO content section ── */
.info-section { background: #fff; border: 1px solid var(--clr-border); border-radius: var(--radius); padding: 28px; margin-top: 24px; }
.info-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.info-section h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
.info-section p { font-size: 14px; color: var(--clr-muted); line-height: 1.75; margin-bottom: 10px; }
.info-section ul { padding-left: 20px; }
.info-section li { font-size: 14px; color: var(--clr-muted); line-height: 1.75; margin-bottom: 4px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1e293b; color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Color swatch ── */
.color-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
  margin-bottom: 14px;
  transition: background .15s;
}

/* ── Progress / Range ── */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--clr-border);
  outline: none;
  padding: 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--clr-accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,99,235,.4);
}

/* ── File drop zone ── */
.drop-zone {
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--clr-accent);
  background: var(--clr-accent-light);
}
.drop-zone .dz-icon { font-size: 40px; margin-bottom: 12px; }
.drop-zone p { color: var(--clr-muted); font-size: 14px; }
.drop-zone strong { color: var(--clr-accent); }

/* ── Tag input ── */
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--clr-accent-light); color: var(--clr-accent); font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; }

/* ── Diff viewer ── */
.diff-add { background: #dcfce7; color: #166534; padding: 0 2px; border-radius: 2px; }
.diff-remove { background: #fee2e2; color: #991b1b; padding: 0 2px; border-radius: 2px; text-decoration: line-through; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .tool-page-wrap { grid-template-columns: 1fr; }
  .tool-sidebar { flex-direction: row; flex-wrap: wrap; }
  .ad-slot-sidebar { height: 250px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  nav .nav-search { display: none; }
}

@media (max-width: 600px) {
  .home-hero { padding: 48px 0 44px; }
  .footer-grid { grid-template-columns: 1fr; }
  nav a:not(.logo) { display: none; }
  .ad-slot-banner { height: 60px; }
  .header-inner { height: 54px; }
}
