/* ============================================================
   CLAIRE — STYLES
   Dark palette. Holographic blue-teal #015870 accents.
   ============================================================ */

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

:root {
  --bg:         #030c10;
  --bg2:        #05131a;
  --accent:     #0da7ce;
  --accent-mid: #015870;
  --accent-dim: rgba(1, 88, 112, 0.22);
  --accent-low: rgba(1, 88, 112, 0.09);
  --border:     rgba(13, 167, 206, 0.22);
  --text:       #a8d4e2;
  --text-dim:   rgba(168, 212, 226, 0.5);
  --text-faint: rgba(168, 212, 226, 0.25);
  --gold:       rgba(255, 200, 60, 0.9);
  --red:        #ef4444;
  --blue:       #3b82f6;
  --brown:      #b45309;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'SF Pro Text', system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
  user-select: none;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
#app {
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  position: relative;
}

#header {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
  flex-shrink: 0;
}

#header-title {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent);
}

#header-week {
  font-size: 11px; color: var(--text-dim);
}

#gear-btn {
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: all 0.2s;
}
#gear-btn:hover { color: var(--accent); background: var(--accent-low); }

/* ── CENTER STAGE ────────────────────────────────────────── */
#stage {
  flex: 1;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  min-height: 0;
}

/* ── BUST CANVAS ─────────────────────────────────────────── */
#bust-canvas {
  position: absolute;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
#bust-canvas.center {
  width: 300px; height: 340px;
  left: 50%; top: 50%;
  transform: translate(-50%, -54%);
}
#bust-canvas.corner {
  width: 90px; height: 100px;
  left: 14px; top: 10px;
  transform: none;
}

/* ── VISUAL PANELS ───────────────────────────────────────── */
#panel {
  position: absolute;
  top: 0; left: 110px; right: 58px; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  overflow-y: auto;
}
#panel.visible {
  opacity: 1;
  pointer-events: all;
}

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

/* Task cards */
.task-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.task-card {
  background: var(--accent-low);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.2s;
}
.task-card:hover { background: var(--accent-dim); border-color: var(--accent); }
.task-card[data-ei="Priority"]  { border-left-color: var(--red); }
.task-card[data-ei="Secondary"] { border-left-color: var(--blue); }
.task-card[data-ei="Scheduled"] { border-left-color: var(--brown); }
.task-card.frog {
  border-left-color: var(--gold);
  background: rgba(255, 200, 60, 0.06);
}
.task-slot-badge {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-low);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; white-space: nowrap; flex-shrink: 0;
}
.task-slot-badge.frog { color: var(--gold); border-color: rgba(255,200,60,0.3); background: rgba(255,200,60,0.05); }
.task-slot-badge.priority  { color: var(--red);   border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.05); }
.task-slot-badge.secondary { color: var(--blue);  border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.05); }
.task-slot-badge.scheduled { color: var(--brown); border-color: rgba(180,83,9,0.3);   background: rgba(180,83,9,0.05); }
.task-name { font-size: 13px; line-height: 1.4; flex: 1; }
.task-eisenhower { font-size: 10px; color: var(--text-faint); flex-shrink: 0; }
.task-done-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border); background: none;
  cursor: pointer; flex-shrink: 0; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 11px;
}
.task-done-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-low); }

/* Frog panel */
.frog-card {
  background: rgba(255, 200, 60, 0.05);
  border: 1px solid rgba(255, 200, 60, 0.25);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}
.frog-label {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px;
}
.frog-task-name {
  font-size: 22px; font-weight: 600; line-height: 1.3;
  color: var(--text); margin-bottom: 20px;
}
.frog-meta { font-size: 12px; color: var(--text-dim); }

/* Vision panel */
.vision-card {
  background: var(--accent-low);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
}
.vision-label {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.vision-text {
  font-size: 13px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap;
}
/* Vision board — cards with Notion cover images */
.vision-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.vision-goal {
  background: var(--accent-low);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.vision-goal-cover {
  width: 100%; height: 96px;
  background-size: cover; background-position: center;
}
.vision-goal-body {
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.vision-goal-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.vision-goal-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vision-goal-status {
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.vision-goal-type {
  font-size: 9px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em;
}
/* Goals without a cover still read cleanly as compact cards */
.vision-goal:not(.has-cover) .vision-goal-body { padding: 12px 14px; }

/* Score panel */
.score-card {
  text-align: center;
  background: var(--accent-low);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
}
.score-number {
  font-size: 72px; font-weight: 700; line-height: 1;
  color: var(--accent); margin-bottom: 8px;
}
.score-label { font-size: 12px; color: var(--text-dim); margin-bottom: 24px; }
.score-bar-wrap {
  height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden;
}
.score-bar {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-target { font-size: 11px; color: var(--text-faint); margin-top: 8px; }

/* Week panel */
.week-header {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 12px;
  display: flex; justify-content: space-between;
}
.week-progress {
  height: 3px; background: var(--bg2); border-radius: 2px; overflow: hidden; margin-bottom: 16px;
}
.week-progress-fill {
  height: 100%; background: var(--accent);
}

/* Projects panel */
.projects-list { display: flex; flex-direction: column; gap: 10px; }
.project-card {
  background: var(--accent-low); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  overflow: hidden;
}
.project-cover {
  width: calc(100% + 32px); height: 72px;
  margin: -14px -16px 12px -16px;
  background-size: cover; background-position: center;
  border-radius: 10px 10px 0 0;
  opacity: 0.85;
}
.project-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.project-name { font-size: 13px; font-weight: 500; }
.project-pct { font-size: 12px; color: var(--accent); font-weight: 600; }
.project-bar-wrap { height: 3px; background: var(--bg2); border-radius: 2px; margin-bottom: 6px; }
.project-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s; }
.project-priority { font-size: 10px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.milestone-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; border-top: 1px solid var(--accent-low); padding-top: 8px; }
.milestone { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.milestone.done .milestone-name { color: var(--text-faint); text-decoration: line-through; }
.milestone-dot { font-size: 11px; color: var(--accent); flex-shrink: 0; }
.milestone.done .milestone-dot { color: var(--text-faint); }

/* Copy panel */
.copy-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px 28px;
}
.copy-text-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  font-size: 12px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto;
  cursor: text; user-select: text;
}

/* Confirm panel */
.confirm-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 32px; text-align: center;
}
.confirm-question {
  font-size: 15px; line-height: 1.5; margin-bottom: 24px;
}
.confirm-btns { display: flex; gap: 12px; justify-content: center; }
.confirm-yes, .confirm-no {
  padding: 10px 28px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  transition: all 0.2s;
}
.confirm-yes { background: var(--accent); color: var(--bg); }
.confirm-yes:hover { opacity: 0.85; }
.confirm-no { background: none; border: 1px solid var(--border); color: var(--text-dim); }
.confirm-no:hover { border-color: var(--accent); color: var(--accent); }

/* Audit panel */
.audit-list { display: flex; flex-direction: column; gap: 8px; }
.audit-item {
  background: var(--accent-low); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  font-size: 12px; line-height: 1.5;
}
.audit-item.warning { border-color: rgba(255, 160, 60, 0.35); background: rgba(255, 160, 60, 0.05); }

/* Panel heading */
.panel-heading {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px;
}

/* ── SPEECH BAR ──────────────────────────────────────────── */
#speech-bar {
  flex-shrink: 0;
  min-height: 52px;
  max-height: 80px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 60px 8px 20px;
  border-top: 1px solid rgba(1,88,112,0.15);
  background: transparent;
  text-align: center;
}
#speech-text {
  font-size: 13px; line-height: 1.6; color: var(--text);
  letter-spacing: 0.01em;
}
#speech-cursor {
  display: inline-block; width: 2px; height: 13px;
  background: var(--accent); margin-left: 2px;
  vertical-align: middle; animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ── INPUT BAR ───────────────────────────────────────────── */
#input-bar {
  flex-shrink: 0;
  display: flex; gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
#user-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}
#user-input::placeholder { color: var(--text-faint); }
#user-input:focus { border-color: var(--accent); }
#send-btn {
  width: 40px; height: 40px;
  background: var(--accent-mid); border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
#send-btn:hover { background: var(--accent); color: var(--bg); }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── FLOAT BUTTONS ───────────────────────────────────────── */
#float-btns {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 20;
}
.float-btn {
  width: 40px; height: 40px;
  background: rgba(1, 88, 112, 0.15);
  border: 1px solid rgba(13, 167, 206, 0.3);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  position: relative;
  color: var(--accent);
}
.float-btn svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.float-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 14px rgba(1,88,112,0.35), 0 0 28px rgba(13,167,206,0.1);
  color: #fff;
}
.float-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 14px rgba(1,88,112,0.35);
}

/* Float button holographic shimmer */
.float-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(13,167,206,0.12) 50%, transparent 70%);
  border-radius: inherit;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.float-btn:hover::before { opacity: 1; }

/* Flyout */
.flyout {
  position: absolute; right: 50px; top: 50%; transform: translateY(-50%);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px;
  width: 210px; display: none;
  flex-direction: column; gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(1,88,112,0.15);
  z-index: 30;
}
.flyout.open { display: flex; }
.flyout-item {
  padding: 8px 12px; border-radius: 6px;
  font-size: 12px; color: var(--text);
  cursor: pointer; transition: all 0.15s;
  text-align: left; background: none; border: none;
  width: 100%;
}
.flyout-item:hover { background: var(--accent-dim); color: var(--accent); }
.flyout-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); padding: 6px 12px 4px;
}

/* ── SETTINGS OVERLAY ────────────────────────────────────── */
#settings-overlay {
  position: fixed; inset: 0;
  background: rgba(3, 12, 16, 0.94);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none; flex-direction: column;
}
#settings-overlay.open { display: flex; }

#settings-header {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
#settings-title { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; }
#settings-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 20px; cursor: pointer; line-height: 1;
}
#settings-close:hover { color: var(--text); }

#settings-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.settings-tab {
  padding: 10px 16px; font-size: 12px;
  color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none;
  transition: all 0.2s;
}
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

#settings-content {
  flex: 1; overflow-y: auto; padding: 20px;
}
#settings-content::-webkit-scrollbar { width: 4px; }
#settings-content::-webkit-scrollbar-track { background: transparent; }
#settings-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.settings-section { margin-bottom: 28px; }
.settings-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 8px; display: block;
}
.settings-textarea {
  width: 100%; height: 220px; resize: vertical;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 12px; outline: none; line-height: 1.6;
}
.settings-textarea:focus { border-color: var(--accent); }
.settings-input {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  padding: 8px 12px; outline: none; width: 100%;
}
.settings-input:focus { border-color: var(--accent); }
.settings-row {
  display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.settings-btn {
  padding: 8px 16px; border-radius: 8px;
  background: var(--accent-low); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.settings-btn:hover { border-color: var(--accent); color: var(--accent); }
.settings-btn.primary { background: var(--accent-mid); color: var(--text); border-color: var(--accent); }
.settings-btn.primary:hover { background: var(--accent); color: var(--bg); }

.research-finding {
  background: var(--accent-low); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; margin-bottom: 10px;
}
.finding-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.finding-summary { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; }
.finding-btns { display: flex; gap: 8px; }
.finding-approve { background: var(--accent-mid); color: var(--text); border: 1px solid var(--accent); padding: 5px 14px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.finding-reject { background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 5px 14px; border-radius: 6px; font-size: 11px; cursor: pointer; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.toggle-label { font-size: 12px; color: var(--text); }
.toggle {
  width: 36px; height: 20px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 10px;
  position: relative; cursor: pointer; transition: all 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent-mid); border-color: var(--accent); }
.toggle::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  background: var(--text-dim); border-radius: 50%;
  top: 2px; left: 2px; transition: all 0.2s;
}
.toggle.on::after { left: 18px; background: var(--text); }

/* ── LOADING STATE ───────────────────────────────────────── */
#loading {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: none; pointer-events: none;
}
#loading.show { display: block; }
.loading-dots span {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  margin: 0 3px; animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ── SCROLLBAR ───────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
