/* ─── Global Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ───────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ─── Header ───────────────────────────────────────────────────────── */
.site-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
}
.site-header .logo span { color: #60a5fa; }
.site-header nav a {
  color: #94a3b8;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}
.site-header nav a:hover { color: #f1f5f9; }

/* ─── Hero (homepage) ──────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.hero h1 span { color: #60a5fa; }
.hero p {
  color: #94a3b8;
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Tool Cards Grid ──────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.tool-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  display: block;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: #60a5fa;
  text-decoration: none;
}
.tool-card .icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}
.tool-card p {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ─── Tool Page Layout ─────────────────────────────────────────────── */
.tool-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.tool-page .subtitle {
  color: #94a3b8;
  margin-bottom: 2rem;
}

/* ─── Form Elements ────────────────────────────────────────────────── */
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
textarea:focus, input:focus, select:focus {
  border-color: #60a5fa;
}
textarea { min-height: 180px; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: #3b82f6;
  color: white;
}
.btn-primary:hover { background: #2563eb; }
.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}
.btn-secondary:hover { background: #475569; }
.btn-group {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* ─── Output / Result ──────────────────────────────────────────────── */
.output-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem;
  min-height: 100px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 1rem;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #475569;
  color: #e2e8f0;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy-btn:hover { background: #60a5fa; }

/* ─── Status Messages ──────────────────────────────────────────────── */
.status {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.status-success { background: #064e3b; color: #6ee7b7; border: 1px solid #065f46; }
.status-error { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }

/* ─── Two-Column Layout ────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
}

/* ─── Color Swatches ───────────────────────────────────────────────── */
.color-preview {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  border: 1px solid #334155;
  margin: 1rem 0;
}

/* ─── Stats Row ────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat-card .number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #60a5fa;
}
.stat-card .label {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* ─── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid #1e293b;
  margin-top: 3rem;
}

/* ─── Ad Placeholder ───────────────────────────────────────────────── */
.ad-slot {
  background: #1e293b;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: #475569;
  font-size: 0.8rem;
  margin: 1.5rem 0;
}

/* ─── QR specific ──────────────────────────────────────────────────── */
#qr-output canvas, #qr-output img {
  margin: 1rem auto;
  display: block;
  border-radius: 8px;
}
