/* ============================================================
   tools.tomsharp.io — Notes App Styles
   ============================================================ */

:root {
  --bg-base:       #0d0d0d;
  --bg-surface:    #141414;
  --bg-elevated:   #1a1a1a;
  --bg-border:     #242424;

  --text-primary:  #e8e8e8;
  --text-secondary:#8a8a8a;
  --text-muted:    #4a4a4a;

  --accent:        #4ade80;
  --accent-dim:    rgba(74,222,128,0.10);
  --accent-border: rgba(74,222,128,0.25);
  --focus-ring:    rgba(74,222,128,0.30);

  --danger:        #f87171;
  --danger-dim:    rgba(248,113,113,0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
ul { list-style: none; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
::selection { background: var(--accent-dim); color: var(--accent); }

/* --- Layout ------------------------------------------------------- */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* --- Header ------------------------------------------------------- */

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

.header-logo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-logo a {
  color: var(--text-secondary);
  transition: color 0.15s;
}

.header-logo a:hover { color: var(--text-primary); }

.header-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.btn-logout {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  transition: color 0.15s, border-color 0.15s;
}

.btn-logout:hover {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* --- Compose ------------------------------------------------------ */

.compose {
  margin-bottom: 2rem;
}

.compose-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.6;
  padding: 0.875rem 1rem;
  resize: none;
  min-height: 96px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.compose-textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.compose-textarea::placeholder { color: var(--text-muted); }

.compose-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn-save {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--bg-base);
  background: var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
}

.btn-save:hover { opacity: 0.85; }
.btn-save:disabled { opacity: 0.4; cursor: default; }

/* --- Notes list --------------------------------------------------- */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  transition: border-color 0.15s;
  position: relative;
}

.note-card:hover { border-color: #333; }

.note-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}

.note-edit-area {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.65;
  resize: none;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-border);
}

.note-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.note-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.note-card:hover .note-actions,
.note-card.editing .note-actions { opacity: 1; }

.btn-note-action {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-note-action:hover {
  color: var(--text-primary);
  border-color: #444;
}

.btn-note-action.save {
  color: var(--accent);
  border-color: var(--accent-border);
}

.btn-note-action.save:hover {
  background: var(--accent-dim);
}

.btn-note-action.delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-dim);
}

/* --- Empty state -------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* --- Login page --------------------------------------------------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-box {
  width: 100%;
  max-width: 360px;
}

.login-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1.75rem;
  letter-spacing: 0.04em;
}

.login-field {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  outline: none;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.login-btn {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--bg-base);
  background: var(--accent);
  padding: 0.75rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
}

.login-btn:hover { opacity: 0.85; }

.login-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* --- Responsive --------------------------------------------------- */

@media (max-width: 600px) {
  .page { padding: 1.25rem 1rem 3rem; }
}
