/* === ToolBaron - Free Online Tools === */
:root {
  --bg: #f8fafc;
  --card: #fff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --green: #10b981;
  --green-hover: #059669;
  --orange: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* === Nav === */
nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 22px; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo span { color: var(--text); }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 18px; }

/* === Tool Grid === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px 60px; }
.section-title { font-size: 20px; font-weight: 700; margin: 40px 0 20px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.tool-icon { font-size: 32px; margin-bottom: 12px; display: block; }
.tool-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.tool-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* === Tool Page === */
.tool-container { max-width: 800px; margin: 0 auto; padding: 40px 24px 60px; }
.tool-header { text-align: center; margin-bottom: 32px; }
.tool-header h1 { font-size: 30px; font-weight: 800; }
.tool-header p { color: var(--muted); margin-top: 8px; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 50px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--card);
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: #eef2ff; }
.upload-zone .icon { font-size: 48px; display: block; margin-bottom: 12px; }
.upload-zone .text { font-size: 16px; font-weight: 500; }
.upload-zone .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.preview-area { display: none; margin-top: 20px; }
.preview-area.active { display: block; }
.preview-row { display: flex; gap: 20px; align-items: start; flex-wrap: wrap; }
.preview-box { flex: 1; min-width: 250px; background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); }
.preview-box .label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.preview-box img { max-width: 100%; border-radius: 8px; }
.preview-box .file-info { font-size: 13px; color: var(--muted); margin-top: 8px; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-hover); }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 16px; }

.quality-slider { margin: 20px 0; display: flex; align-items: center; gap: 12px; }
.quality-slider label { font-size: 14px; font-weight: 500; white-space: nowrap; }
.quality-slider input[type=range] { flex: 1; }
.quality-slider .val { font-size: 14px; color: var(--muted); min-width: 40px; text-align: right; }

/* === Blog === */
.blog-list { max-width: 700px; margin: 40px auto; }
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.blog-card h3 { font-size: 18px; }
.blog-card h3 a { color: var(--text); text-decoration: none; }
.blog-card h3 a:hover { color: var(--primary); }
.blog-card .meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.blog-card .excerpt { font-size: 14px; color: var(--muted); }

.blog-post { max-width: 720px; margin: 40px auto; padding: 0 24px; }
.blog-post article { background: var(--card); padding: 40px; border-radius: var(--radius); border: 1px solid var(--border); }
.blog-post h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.blog-post .meta { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.blog-post h2 { font-size: 22px; margin: 32px 0 12px; }
.blog-post h3 { font-size: 18px; margin: 24px 0 8px; }
.blog-post p { margin-bottom: 16px; line-height: 1.8; }
.blog-post ul, .blog-post ol { margin-bottom: 16px; padding-left: 24px; }
.blog-post li { margin-bottom: 6px; }

/* === Ad Placeholder === */
.ad-unit {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  text-align: center;
  padding: 16px;
  margin: 32px 0;
  color: #94a3b8;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  max-width: 1100px;
  margin: 0 auto;
}
footer a { color: var(--muted); text-decoration: none; margin: 0 8px; }
footer a:hover { color: var(--primary); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* === Responsive === */
@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .tool-grid { grid-template-columns: 1fr; }
  .preview-row { flex-direction: column; }
  .blog-post article { padding: 20px; }
}
