/* ToolStand — Clean, minimal design system */
:root {
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --text: #1e293b;
  --text-secondary: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --link: #2563eb;
  --btn-bg: #2563eb;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --radius: 12px;
  --error: #dc2626;
  --warn: #b45309;
  --ok: #15803d;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #cbd5e1;
  --primary: #3b82f6;
  --primary-hover: #1d4ed8;
  --link: #60a5fa;
  --btn-bg: #2563eb;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --error: #fca5a5;
  --warn: #fbbf24;
  --ok: #4ade80;
}

/* Status text utilities — use these instead of hardcoding status hex colors (dark-mode WCAG AA safe) */
.ts-error { color: var(--error); }
.ts-warn { color: var(--warn); }
.ts-ok { color: var(--ok); }

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

.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;
  content-visibility: auto;
  contain-intrinsic-size: 180px;
}

.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;
}

.tool-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
.tool-tag{font-size:.65rem;font-weight:600;padding:2px 8px;border-radius:100px;background:var(--bg);color:var(--text-secondary);border:1px solid var(--border);text-transform:uppercase;letter-spacing:.03em}

.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: #475569; }
[data-theme="dark"] .badge--soon { background: #334155; color: #cbd5e1; }

/* 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(--link); }
.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(--link);
  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(--link);
}

/* 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(--btn-bg);
  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(--btn-bg);
  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;
  height: 120px;
  text-align: center;
  overflow: hidden;
  contain: layout style;
  /* Reserve space to prevent CLS when ad loads/doesn't load */
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-banner ins {
  min-height: 90px;
  height: 100%;
  display: block;
  width: 100%;
}
@media (max-width: 640px) {
  .ad-banner { height: 90px; margin: 16px auto; }
  .ad-banner ins { min-height: 50px; }
}

/* 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(--link);
  text-decoration: underline;
}

/* Related Tools — touch target accessibility (min 24px) */
.related-tools {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.related-tools h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.related-tools a {
  display: inline-block;
  min-height: 24px;
  padding: 4px 8px;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 24px;
  transition: color 0.2s;
  border-radius: 6px;
}

.related-tools a:hover {
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 600px) {
  .related-tools a {
    display: block;
    padding: 10px 8px;
  }
}

/* Rating Widget — design token-based */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0;
}
.rating-star {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border);
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 2px;
  line-height: 1;
}
.rating-star.active,
.rating-star:hover {
  color: #f59e0b; /* amber-500 — sabit, tema bagimsiz */
}
.rating-star:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.rating-star:disabled {
  cursor: default;
  opacity: 0.6;
}
.rating-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: 8px;
}
.rating-feedback {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 1.2em;
}

/* Shared modern copy button - higher specificity overrides legacy inline .copy-output-btn */
button.copy-output-btn,
button.btn-copy-embed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
button.copy-output-btn:hover,
button.btn-copy-embed:hover {
  background: var(--btn-bg);
  color: #fff;
  border-color: var(--primary);
}
button.copy-output-btn:active,
button.btn-copy-embed:active {
  transform: translateY(1px);
}

/* Shared scroll-cap utility for long result lists */
.ts-result-scroll {
  max-height: 360px;
  overflow-y: auto;
}
