/* src/site/site.css */
:root {
  --bg: #f9f9f9;
  --fg: #1b1b1b;
  --muted: #777;
  --input-bg: #fff;
  --input-border: #d0d0d0;
  --input-focus: #7846a9;
  --btn-bg: #e8e8e8;
  --btn-fg: #555;
  --btn-hover: #d0d0d0;
  --error: #e74c3c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --fg: #e2e2e2;
    --muted: #888;
    --input-bg: #1e1e1e;
    --input-border: #3a3a3a;
    --input-focus: #7846a9;
    --btn-bg: #2a2a2a;
    --btn-fg: #c6c6c6;
    --btn-hover: #3a3a3a;
  }
}

html.light {
  --bg: #f9f9f9;
  --fg: #1b1b1b;
  --muted: #777;
  --input-bg: #fff;
  --input-border: #d0d0d0;
  --btn-bg: #e8e8e8;
  --btn-fg: #555;
  --btn-hover: #d0d0d0;
}

html.dark {
  --bg: #131313;
  --fg: #e2e2e2;
  --muted: #888;
  --input-bg: #1e1e1e;
  --input-border: #3a3a3a;
  --btn-bg: #2a2a2a;
  --btn-fg: #c6c6c6;
  --btn-hover: #3a3a3a;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 20px;
  min-height: 100vh;
  padding: 24px 24px 32px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

.container {
  width: 100%;
  max-width: 600px;
}

h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

textarea {
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  color: var(--fg);
  resize: none;
  overflow: hidden;
  outline: none;
  border-radius: 10px;
  width: 100%;
  min-height: 80px;
  padding: 14px 16px;
  transition: border-color .2s;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

textarea:focus {
  border-color: var(--input-focus);
}

.byte-count {
  text-align: right;
  color: var(--muted);
  margin-top: 6px;
  font-size: 11px;
}

.byte-count.over {
  color: var(--error);
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.5;
}

.qr-output {
  display: flex;
  flex-direction: column;
  align-items:  center;
  margin-top: 24px;
}

.qr-output.hidden {
  display: none;
}

.qr-output canvas {
  image-rendering: pixelated;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.action-btn {
  display: inline-flex;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  border: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 40px;
  height: 40px;
  padding: 0;
  transition: background .2s, transform .15s;
}

.action-btn:hover {
  background: var(--btn-hover);
  transform: scale(1.05);
}

.action-btn svg {
  flex-shrink: 0;
}

.site-footer {
  text-align: center;
  border-top: 1px solid var(--border, #d0d0d0);
  width: 100%;
  max-width: 600px;
  margin-top: 16px;
  padding: 24px 16px;
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.debug {
  position: fixed;
  z-index: 100;
  bottom: 16px;
  right: 16px;
}

.debug-toggle {
  background: var(--btn-bg);
  border: 1px solid var(--input-border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
}

.debug-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.debug-panel {
  position: absolute;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  min-width: 160px;
  padding: 12px 16px;
  bottom: calc(100% + 8px);
  right: 0;
}

.debug-row {
  display: flex;
  color: var(--fg);
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  font-size: 12px;
}

.debug-row select {
  border: 1px solid var(--input-border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 12px;
}
