/* ToolStand — Clean, minimal design system */
:root {
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

* { 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;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover { color: var(--primary); }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tool-card--soon {
  opacity: 0.6;
  cursor: default;
}

.tool-card--soon:hover {
  transform: none;
  box-shadow: none;
}

.tool-icon { font-size: 2rem; }

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: auto;
  width: fit-content;
}

.badge--ready { background: #dcfce7; color: #166534; }
[data-theme="dark"] .badge--ready { background: #14532d; color: #86efac; }
.badge--soon { background: #f1f5f9; color: #64748b; }
[data-theme="dark"] .badge--soon { background: #334155; color: #94a3b8; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer a { color: var(--primary); }
.footer .small { font-size: 0.8rem; margin-top: 4px; }

/* Tool page shared styles */
.tool-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}

.tool-header {
  text-align: center;
  margin-bottom: 30px;
}

.tool-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Embed page */
.embed-page {
  padding: 16px;
}

.embed-page .powered-by {
  text-align: center;
  font-size: 0.75rem;
  margin-top: 8px;
}

.embed-page .powered-by a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Blog listing */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 60px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.blog-card-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.blog-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.blog-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Blog post article */
.blog-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.blog-article h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.blog-article .blog-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.blog-article p {
  margin-bottom: 1.2em;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.blog-article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
}

.blog-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5em 0 0.5em;
}

.blog-article ul, .blog-article ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.blog-article li {
  margin-bottom: 0.4em;
  font-size: 1.05rem;
  line-height: 1.7;
}

.blog-article a {
  color: var(--primary);
  text-decoration: underline;
}

.blog-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.blog-back:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .blog-article h1 { font-size: 1.5rem; }
}

/* QR tool specific */
.qr-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.qr-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.qr-tab.active {
  background: var(--primary);
  color: white;
}

.qr-tab:not(.active):hover {
  background: var(--border);
}

.qr-panel {
  display: none;
}

.qr-panel.active {
  display: block;
}

.qr-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.qr-input:focus {
  outline: none;
  border-color: var(--primary);
}

.qr-output {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-canvas-wrapper {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

#qrResult {
  width: 100%;
  min-height: 40px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  word-break: break-all;
  font-family: monospace;
  font-size: 0.9rem;
  display: none;
}

.qr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg-card);
}

#cameraView {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  display: none;
}

.embed-cta {
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.embed-cta h3 { margin-bottom: 8px; }

.embed-code {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text);
  resize: vertical;
  margin-top: 8px;
}

/* AdSense */
.ad-banner {
  max-width: 800px;
  margin: 24px auto;
  padding: 0 16px;
  min-height: 90px;
  text-align: center;
  overflow: hidden;
}
@media (max-width: 640px) {
  .ad-banner { min-height: 50px; margin: 16px auto; }
}

/* Tool search */
.search-container {
  max-width: 500px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.no-results a {
  color: var(--primary);
  text-decoration: underline;
}
