/* ============================================================
   History — Tabs, notes view, commits, pagination
   ============================================================ */

/* ── History Title Row ─────────────────────────────────────── */

.history-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-title-row h2 {
    font-size: 16px;
    font-weight: 600;
}

.history-title-row .btn-small {
    margin: 0;
}

/* ── History Tabs ──────────────────────────────────────────── */

.history-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 0 20px;
    flex-shrink: 0;
}

.history-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.history-tab-btn:hover {
    color: var(--text-primary);
}

.history-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.history-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.history-tab-content.active {
    display: flex;
}

/* ── Notes View ────────────────────────────────────────────── */

.notes-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notes-header {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.notes-header .btn-small {
    margin: 0;
}

.notes-rendered {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.notes-rendered h1,
.notes-rendered h2,
.notes-rendered h3 {
    margin: 16px 0 8px;
    color: var(--text-primary);
}

.notes-rendered h1 { font-size: 20px; }
.notes-rendered h2 { font-size: 17px; }
.notes-rendered h3 { font-size: 15px; }

.notes-rendered p {
    margin: 8px 0;
}

.notes-rendered ul,
.notes-rendered ol {
    margin: 8px 0;
    padding-left: 24px;
}

.notes-rendered li {
    margin: 4px 0;
}

.notes-rendered code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.notes-rendered pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.notes-rendered pre code {
    background: none;
    padding: 0;
}

.notes-rendered blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.notes-rendered .empty-notes {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

#notes-edit-area {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.notes-textarea {
    flex: 1;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.notes-edit-actions {
    display: flex;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.notes-edit-actions .btn-small {
    margin: 0;
}

.notes-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.notes-spinner span {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ── Commits View ──────────────────────────────────────────── */

.commits-view {
    overflow-y: auto;
    padding: 12px 20px;
}

.commit-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

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

.commit-row:hover {
    background: var(--bg-hover);
}

.commit-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.commit-hash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.commit-subject {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.commit-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.commit-branch {
    color: var(--accent);
    font-size: 11px;
}

.commit-agent {
    color: var(--text-secondary);
    font-size: 11px;
}

.commit-time {
    white-space: nowrap;
    font-size: 11px;
}
