:root {
  --bg: #ffffff;
  --text: #111111;
  --accent: #2563eb;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #e5e7eb;
    --accent: #60a5fa;
    --border: #334155;
    --code-bg: #020617;
  }
}

html[data-theme="light"] {
  --bg: #ffffff;
  --text: #111111;
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --text: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
    sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 2rem;
}

textarea,
input {
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}

textarea {
  min-height: 200px;
  resize: vertical;
}

button {
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

button:not(.icon-button) {
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem;
  background: var(--accent);
  color: #ffffff;
}

button:not(.icon-button):hover {
  opacity: 0.9;
}

.icon-button {
  width: auto;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--code-bg);
}

#backButton {
  margin-top: 1rem;
}

#shareLink {
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
  margin-top: 1rem;
  width: 100%;
  box-sizing: border-box;
  resize: none; 
  overflow-x: auto;
}

article {
  line-height: 1.6;
}

article h1,
article h2,
article h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

article pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
}

article code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

article blockquote {
  border-left: 4px solid var(--border);
  padding-left: 1rem;
  color: #64748b;
}

#message {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#message.show {
  opacity: 1;
}

.hidden {
  display: none;
}


[hidden] {
  display: none !important;
}
