/**
 * style3.css – Cura Simple Chat v3 layout additions
 *
 * New regions: history strip, right detail panel, toolbar buttons,
 * HILR cards, tool call chips, input hint chips.
 * Layered on top of style2.css (modern) and styles.css (classic).
 */

/* ── Layout: make #main a flex row ──────────────────────────────────────────── */

#main {
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* #chat-area fills the remaining space */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── History strip ───────────────────────────────────────────────────────────── */

#history-strip {
  width: 170px;
  min-width: 170px;
  border-right: 0.5px solid var(--border-color, #e2e8f0);
  background: var(--surface-secondary, #f8fafc);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.hs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hs-new-btn {
  font-size: 11px;
  background: none;
  border: none;
  cursor: pointer;
  color: #534AB7;
}

.hs-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
  background: transparent;
  cursor: pointer;
}

.hs-item:hover,
.hs-item.active {
  background: var(--surface-primary, #fff);
}

.hs-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-date {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}

.hs-empty {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  padding: 8px 10px;
}

/* ── Toolbar buttons ─────────────────────────────────────────────────────────── */

.toolbar-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: var(--surface-secondary, #f1f5f9);
}

.toolbar-btn.active {
  background: #EEEDFE;
  border-color: #AFA9EC;
}

/* ── Right detail panel ──────────────────────────────────────────────────────── */

#detail-panel {
  width: 280px;
  min-width: 280px;
  border-left: 0.5px solid var(--border-color, #e2e8f0);
  background: var(--surface-primary, #fff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.dp-header {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 48px;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
}

.dp-header span {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.dp-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  font-size: 14px;
  padding: 4px;
}

.dp-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
  overflow-x: auto;
}

.dp-tab {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.dp-tab.active {
  color: #534AB7;
  border-bottom-color: #534AB7;
}

#dp-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.dp-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.dp-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
  font-size: 12px;
}

.dp-row:last-child {
  border-bottom: none;
}

.dp-loading,
.dp-empty,
.dp-error {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  padding: 8px 0;
}

.dp-action-btn {
  margin-top: 12px;
  width: 100%;
  padding: 7px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: transparent;
  cursor: pointer;
}

/* ── Tool toggles ────────────────────────────────────────────────────────────── */

.tool-item {
  display: flex;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
}

.tool-name {
  flex: 1;
}

.tool-toggle {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.tool-toggle.on  { background: #534AB7; }
.tool-toggle.off { background: #cbd5e1; }

/* Read-only enabled/disabled badge (replaces toggle) */
.tool-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tool-status.on  { background: #ede9fe; color: #534AB7; }
.tool-status.off { background: #f1f5f9; color: #94a3b8; }

/* ── Info tab prompt ─────────────────────────────────────────────────────────── */

.info-prompt {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary, #64748b);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* ── Memory ──────────────────────────────────────────────────────────────────── */

.mem-item {
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
}

.mem-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #EEEDFE;
  color: #534AB7;
  margin-bottom: 3px;
}

.mem-text {
  font-size: 12px;
  line-height: 1.4;
}

.mem-time {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

.mem-delete {
  float: right;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}

/* ── Notebook ────────────────────────────────────────────────────────────────── */

.nb-item {
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
}

.nb-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.nb-text {
  font-size: 12px;
  line-height: 1.4;
}

.nb-date {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

/* ── Schedules ───────────────────────────────────────────────────────────────── */

.sched-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 0.5px solid var(--border-color, #e2e8f0);
}

.sched-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.sched-body {
  flex: 1;
}

.sched-name {
  font-size: 12px;
  font-weight: 500;
}

.sched-expr {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}

.sched-toggle {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: transparent;
  cursor: pointer;
}

/* ── HILR approval cards ─────────────────────────────────────────────────────── */

.hilr-card {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #FAC775;
  background: #FAEEDA;
}

.hilr-label {
  font-size: 11px;
  font-weight: 600;
  color: #854F0B;
  margin-bottom: 4px;
}

.hilr-action {
  font-size: 12px;
  color: #633806;
  margin-bottom: 8px;
}

.hilr-btns {
  display: flex;
  gap: 6px;
}

.hilr-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid;
}

.hilr-btn--approve {
  background: #1D9E75;
  color: #fff;
  border-color: #1D9E75;
}

.hilr-btn--reject {
  background: transparent;
  color: #633806;
  border-color: #FAC775;
}

.hilr-approved {
  font-size: 12px;
  color: #1D9E75;
  font-weight: 500;
}

.hilr-rejected {
  font-size: 12px;
  color: #993C1D;
  font-weight: 500;
}

/* ── Tool call chips ─────────────────────────────────────────────────────────── */

.tool-chips {
  margin-top: 6px;
}

.tool-chip {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #EEEDFE;
  color: #534AB7;
  border: 1px solid #AFA9EC;
  margin: 4px 4px 0 0;
}

/* ── Bubble footer (time + copy) ─────────────────────────────────────────────── */

.bubble-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.copy-btn {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 1px 4px;
  border-radius: 4px;
  color: inherit;
  line-height: 1;
  transition: opacity .15s, background .15s;
}

.bubble:hover .copy-btn { opacity: 0.45; }
.copy-btn:hover          { opacity: 1 !important; background: rgba(0,0,0,.06); }
.copy-btn--done          { opacity: 1 !important; color: #1D9E75; }

/* ── Input hint chips ────────────────────────────────────────────────────────── */

.input-hints {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.hint-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted, #64748b);
}

.hint-chip:hover {
  background: var(--surface-secondary, #f1f5f9);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  #detail-panel { display: none !important; }
}

@media (max-width: 780px) {
  #history-strip { display: none !important; }
}
