/* ====================
   CSS VARIABLES
==================== */

:root {
  /* Light mode */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #010103;
  --accent-hover: #37373a;
  --focus-ring: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] {
  /* Dark mode */
  --bg: #0f1115;
  --surface: #16181d;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #2a2d34;
  --accent: #e5e7eb;
  --accent-hover: #ffffff;
  --focus-ring: rgba(255, 255, 255, 0.08);
}

/* ====================
   RESET
==================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ====================
   TOP BAR
==================== */

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#username {
  font-size: 14px;
  color: var(--muted);
}

/* ====================
   BUTTONS
==================== */

button {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: var(--border);
}

#shareBtn {
  background: var(--accent);
  color: var(--bg);
  border: none;
}

#shareBtn:hover {
  background: var(--accent-hover);
}

/* ====================
   MAIN LAYOUT
==================== */

.container {
  max-width: 900px;
  margin: 24px auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

/* ====================
   STATUS BAR
==================== */

.status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}

#typingStatus,
#lastEdited {
  font-size: 12px;
  color: var(--muted);
}

/* ====================
   EDITOR
==================== */

#editor {
  width: 100%;
  height: calc(100vh - 160px);
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  resize: none;
  outline: none;
}

#editor::placeholder {
  color: var(--muted);
}

#editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
#onboarding {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 20px;
  border-bottom: 1px dashed var(--border);
}
