/*
 * Conversation History — left-rail "Chats" tab
 * ============================================
 * The conversation list docked in the left rail's Chats view. Consumes shared
 * design tokens (gold accent, flat dark surfaces). See js/conversations.js.
 */

/* Header toggle button — only used on mobile to slide the rail in/out; hidden
   on desktop where the rail is always visible. */
.conv-toggle { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 761px) { #convToggle { display: none; } }

/* + New conversation */
.conv-new {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 12px 8px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
    color: var(--text-primary, #E8E6E3);
    font-size: 0.9rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.conv-new:hover {
    border-color: var(--accent, #C4A77D);
    color: var(--accent, #C4A77D);
    background: rgba(196, 167, 125, 0.06);
}
.conv-new svg { flex: 0 0 auto; }

/* Scrolling list */
.conv-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.conv-empty {
    padding: 24px 16px;
    color: var(--text-muted, #6B665E);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

/* An item: title/meta button + hover actions */
.conv-item {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 10px;
    transition: background 0.15s;
}
.conv-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.conv-item.active {
    background: rgba(196, 167, 125, 0.12);
    box-shadow: inset 2px 0 0 var(--accent, #C4A77D);
}

.conv-open {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    background: transparent;
    border: none;
    padding: 9px 10px;
    cursor: pointer;
    color: inherit;
}
.conv-item-title {
    font-size: 0.9rem;
    color: var(--text-primary, #E8E6E3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-item.active .conv-item-title { color: var(--accent-gold, #D4B896); }
.conv-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted, #6B665E);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row actions — revealed on hover / focus / active */
.conv-item-actions {
    display: flex;
    gap: 2px;
    padding-right: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}
.conv-item:hover .conv-item-actions,
.conv-item.active .conv-item-actions,
.conv-item:focus-within .conv-item-actions {
    opacity: 1;
}
.conv-act {
    display: inline-flex;
    background: transparent;
    border: none;
    color: var(--text-muted, #6B665E);
    cursor: pointer;
    padding: 5px;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
}
.conv-act:hover {
    color: var(--text-primary, #E8E6E3);
    background: rgba(255, 255, 255, 0.08);
}
.conv-delete:hover { color: var(--danger, #d98b7c); }

/* Inline rename input */
.conv-rename-input {
    flex: 1 1 auto;
    min-width: 0;
    margin: 6px 8px;
    padding: 6px 8px;
    background: var(--bg-elevated, #1a1a24);
    border: 1px solid var(--accent, #C4A77D);
    border-radius: 8px;
    color: var(--text-primary, #E8E6E3);
    font-size: 0.9rem;
    font-family: inherit;
}
.conv-rename-input:focus { outline: none; }

/* Inline delete confirm */
.conv-confirm {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
}
.conv-confirm-label {
    font-size: 0.78rem;
    color: var(--text-secondary, #A09A92);
}
.conv-confirm button {
    background: transparent;
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary, #A09A92);
    transition: all 0.15s;
}
.conv-confirm-yes:hover {
    color: #fff;
    background: var(--danger, #d98b7c);
    border-color: var(--danger, #d98b7c);
}
.conv-confirm-no:hover {
    color: var(--text-primary, #E8E6E3);
    border-color: var(--text-secondary, #A09A92);
}

/* Mobile: full-bleed drawer */
@media (max-width: 760px) {
    .conv-drawer { width: 88vw; }
}
