/* GleePad — minimal dark UI, phone-first */

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

:root {
  --bg:        #1a1a1a;
  --surface:   #242424;
  --border:    #333;
  --text:      #e8e8e8;
  --muted:     #888;
  --accent:    #4a9eff;
  --danger:    #e05c5c;
  --success:   #4caf7d;
  --warn:      #e0a85c;
  --radius:    10px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ── Screens ─────────────────────────────────────── */

.screen { display: flex; flex-direction: column; height: 100dvh; }
.hidden { display: none !important; }

/* ── Setup screen ────────────────────────────────── */

#setup-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.setup-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-card h1 { font-size: 1.6rem; font-weight: 600; }
.setup-card p  { color: var(--muted); font-size: 0.9rem; }

/* ── App screen ──────────────────────────────────── */

#app-screen { display: flex; flex-direction: column; }

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

.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }

/* ── Views ───────────────────────────────────────── */

.view { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.view.hidden { display: none; }

/* ── Capture ─────────────────────────────────────── */

.capture-area {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

#note-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  resize: none;
  outline: none;
  min-height: 120px;
}

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

.capture-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

/* Voice confirm */
#voice-confirm {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #1e2a1e;
}

.confirm-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.confirm-text  { font-size: 1rem; color: var(--text); margin-bottom: 10px; }

.confirm-actions { display: flex; gap: 8px; }

/* Voice status */
.voice-status {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.voice-status.listening { color: var(--accent); }
.voice-status.processing { color: var(--warn); }

/* ── Feedback flash ──────────────────────────────── */

.feedback {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.feedback.success { background: #1a2e20; color: var(--success); }
.feedback.error   { background: #2e1a1a; color: var(--danger); }
.feedback.warn    { background: #2e251a; color: var(--warn); }

/* ── Notes list ──────────────────────────────────── */

.list-toolbar { position: sticky; top: 0; background: var(--bg); padding-bottom: 8px; z-index: 10; }

#search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

#notes-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.note-card:active { border-color: var(--accent); }

.note-text {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.note-source-tag {
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 6px;
}

.note-routed-tag {
  color: var(--success);
}

/* ── Action sheet ────────────────────────────────── */

.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
}

.action-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 1px solid var(--border);
  z-index: 101;
  padding: 20px 16px 32px;
}

.action-sheet-inner { display: flex; flex-direction: column; gap: 10px; }

.action-note-preview {
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#action-route-btns { display: flex; flex-direction: column; gap: 8px; }

/* ── Buttons ─────────────────────────────────────── */

button { cursor: pointer; border: none; outline: none; font-family: var(--font); }

.primary-btn {
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius);
}

.secondary-btn {
  background: var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: var(--radius);
}

.action-btn {
  background: var(--border);
  color: var(--text);
  font-size: 1rem;
  padding: 14px;
  border-radius: var(--radius);
  text-align: left;
  width: 100%;
}

.action-btn.danger  { color: var(--danger); }
.action-btn.success { color: var(--success); }
.action-btn.secondary { color: var(--muted); }

.icon-btn {
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  padding: 6px 10px;
  border-radius: 8px;
}

.mic-btn.active { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Inputs (shared) ─────────────────────────────── */

input[type="password"], input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
}

.error { color: var(--danger); font-size: 0.85rem; }

/* ── Empty state ─────────────────────────────────── */

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
  font-size: 0.95rem;
}

/* ── Desktop / T420 ──────────────────────────────── */

@media (min-width: 640px) {
  #app-screen { max-width: 600px; margin: 0 auto; }
  body { background: #111; }
  header { border-radius: 0; }
}
