/**
 * Session Archaeology Interactive
 * Side-by-side git log vs session-augmented view
 * Uses site design tokens (dark theme, white opacity layers)
 */

/* --- Container --- */

.sa-viz {
    max-width: 640px;
    margin: var(--spacing-lg, 2rem) auto;
    padding: var(--spacing-md, 1.5rem) var(--spacing-lg, 2rem);
    background: var(--color-bg-elevated, #111111);
    border-radius: var(--radius-md, 16px);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    font-family: inherit;
}

.sa-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary, #ffffff);
    margin: 0 0 0.25rem;
}

.sa-hint {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0 0 var(--spacing-sm, 1rem);
    line-height: 1.5;
}

/* --- Toggle Row --- */

.sa-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing-sm, 1rem);
}

.sa-toggle-label {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 600;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sa-toggle-btn {
    padding: 0.35rem 0.75rem;
    font-size: var(--font-size-xs, 0.75rem);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    cursor: pointer;
    font-family: inherit;
    transition: all 150ms ease;
}

.sa-toggle-btn:hover {
    border-color: var(--color-border-hover, rgba(255, 255, 255, 0.2));
    color: var(--color-text-primary, #ffffff);
}

.sa-toggle-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.sa-toggle-btn.sa-toggle-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary, #ffffff);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- Commit List --- */

.sa-commits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm, 1rem);
}

.sa-commit {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    background: var(--color-bg-surface, #1a1a1a);
}

.sa-commit:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.sa-commit:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.sa-commit-active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(74, 158, 255, 0.4);
}

.sa-commit-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sa-commit-hash {
    font-family: var(--font-mono, 'SF Mono', Monaco, 'Cascadia Code', monospace);
    font-size: var(--font-size-xs, 0.75rem);
    color: #4a9eff;
    min-width: 4rem;
}

.sa-commit-msg {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-primary, #ffffff);
    font-weight: 500;
}

.sa-commit-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    padding-left: 4.5rem;
}

.sa-commit-meta-item {
    font-size: 0.65rem;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
}

/* --- Detail Panel --- */

.sa-detail {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 0.25rem;
}

.sa-detail-section {
    margin-bottom: 0.75rem;
}

.sa-detail-section:last-child {
    margin-bottom: 0;
}

.sa-detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.sa-label-intent {
    color: #4a9eff;
}

.sa-label-process {
    color: #c084fc;
}

.sa-label-reasoning {
    color: #fb923c;
}

.sa-label-verification {
    color: #4aff6b;
}

.sa-detail-text {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    line-height: 1.6;
}

.sa-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sa-detail-list li {
    padding: 0.15rem 0 0.15rem 0.75rem;
    position: relative;
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    line-height: 1.5;
}

.sa-detail-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
}

/* --- Gap Highlight --- */

.sa-gap-highlight {
    padding: 0.5rem 0.75rem;
    border: 1px dashed rgba(255, 107, 74, 0.3);
    border-radius: 6px;
    background: rgba(255, 107, 74, 0.03);
    margin-top: 0.5rem;
}

.sa-gap-text {
    font-size: var(--font-size-xs, 0.75rem);
    color: #ff6b4a;
    line-height: 1.5;
    margin: 0;
}

/* --- Stats Bar --- */

.sa-stats {
    display: flex;
    gap: var(--spacing-sm, 1rem);
    margin-top: var(--spacing-sm, 1rem);
    padding-top: var(--spacing-sm, 1rem);
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    flex-wrap: wrap;
}

.sa-stat {
    flex: 1 1 0;
    min-width: 80px;
    text-align: center;
}

.sa-stat-value {
    font-family: var(--font-mono, 'SF Mono', Monaco, 'Cascadia Code', monospace);
    font-size: var(--font-size-base, 1rem);
    font-weight: 700;
    color: var(--color-text-primary, #ffffff);
}

.sa-stat-label {
    font-size: 0.65rem;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.55));
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .sa-viz {
        padding: var(--spacing-sm, 1rem);
        margin: var(--spacing-sm, 1rem) auto;
        border-radius: var(--radius-sm, 8px);
    }

    .sa-commit-meta {
        padding-left: 0;
        flex-wrap: wrap;
    }

    .sa-toggle-row {
        flex-wrap: wrap;
    }

    .sa-stats {
        gap: 0.5rem;
    }
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
    .sa-commit,
    .sa-toggle-btn {
        transition: none;
    }
}
