/**
 * Editor Styles
 * Full-featured file editor with Git integration
 * Using AI Agent dark theme colors
 */

/* ==========================================
   Editor Panel Mode (side panel)
   ========================================== */

.editor-panel {
    width: 100%;
    height: calc(100vh - 50px);
    background: var(--bg-base);
    display: none;
    flex-direction: column;
    flex: 1;
}

.editor-panel.visible {
    display: flex;
}

/* When editor panel is open, hide the grid */
.app-container.editor-open .agents-grid-panel {
    display: none;
}

/* Editor panel container adjustments */
.editor-panel .editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Show close button in panel mode */
.editor-panel .editor-close-btn {
    display: flex;
}

/* Highlight active toggle button */
#editorToggleBtn.active {
    background: var(--accent-primary, var(--accent-blue));
    color: #ffffff;
}

/* ==========================================
   Overlay & Container (fullscreen mode)
   ========================================== */

.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-panel-bg);
    z-index: 5000;
    animation: editorFadeIn 0.2s ease;
}

.editor-overlay.closing {
    animation: editorFadeOut 0.2s ease forwards;
}

@keyframes editorFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes editorFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.editor-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-panel-bg);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
    animation: editorSlideIn 0.2s ease;
    border: none;
}

@keyframes editorSlideIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   Header
   ========================================== */

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--bg-surface);
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-header-icon {
    font-size: 1rem;
    color: var(--text-secondary);
}

.editor-header-left h2 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.editor-header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 16px;
}

.editor-folder-input-group {
    display: flex;
    gap: 6px;
}

.editor-folder-input-wrapper {
    flex: 1;
    position: relative;
}

.editor-folder-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-mono, monospace);
    outline: none;
    transition: border-color 0.15s;
}

.editor-folder-input:focus {
    border-color: var(--text-secondary);
}

.editor-folder-input::placeholder {
    color: var(--text-secondary);
    font-family: var(--font-family, sans-serif);
}

.editor-project-selector {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    transition: all 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5L6 8l3-3.5H3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.editor-project-selector:hover {
    border-color: var(--text-secondary);
}

.editor-project-selector:focus {
    border-color: var(--accent-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.editor-project-selector option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px;
}

.editor-project-selector option:disabled {
    color: var(--text-secondary);
}

.editor-load-btn {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.editor-load-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
}

.editor-header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Git Quick Actions in Header */
.editor-git-quick-actions {
    display: flex;
    gap: 4px;
    margin-right: 4px;
    padding: 2px 6px;
    background: var(--bg-elevated);
    border-radius: 6px;
    border: 1px solid var(--bg-surface);
}

.editor-git-action-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-git-action-btn:hover {
    background: var(--accent-blue, #5c9fff);
    color: white;
}

.editor-git-action-btn:active {
    transform: scale(0.95);
}

.editor-git-action-btn[title*="Fetch"]:hover {
    background: var(--accent-purple, #a78bfa);
}

.editor-git-action-btn[title*="Pull"]:hover {
    background: var(--accent-green, var(--accent-green));
}

.editor-git-action-btn[title*="Push"]:hover {
    background: var(--accent-orange, #fb923c);
}

.editor-settings-btn,
.editor-close-btn {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0 4px;
}

.editor-settings-btn:hover,
.editor-close-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Git button with branch name - flexible width */
.editor-settings-btn.git-active {
    width: auto;
    max-width: 180px;
    padding: 0 10px;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
}

.editor-settings-btn.git-active:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-blue);
}

.editor-settings-btn.git-active .git-header-branch {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================
   Folder History Dropdown
   ========================================== */

.editor-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
}

.editor-history-dropdown.visible {
    display: block;
}

.editor-history-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.editor-history-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-surface);
    transition: background 0.15s;
}

.editor-history-item:last-child {
    border-bottom: none;
}

.editor-history-item:hover,
.editor-history-item.focused {
    background: var(--bg-surface);
}

.editor-history-icon {
    font-size: 1.1rem;
    margin-right: 10px;
}

.editor-history-info {
    flex: 1;
    min-width: 0;
}

.editor-history-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.editor-history-path {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-history-remove {
    opacity: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.editor-history-item:hover .editor-history-remove {
    opacity: 1;
}

.editor-history-remove:hover {
    color: var(--error-color, var(--accent-red));
}

/* ==========================================
   Body Layout
   ========================================== */

.editor-body {
    flex: 1 1 0;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ==========================================
   Sidebar
   ========================================== */

.editor-sidebar {
    width: 280px;
    min-width: 220px;
    background: var(--bg-base);
    border-right: 1px solid var(--bg-surface);
    display: flex;
    flex-direction: column;
}

.editor-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--bg-surface);
}

.editor-tab {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.editor-tab:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.editor-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-secondary);
}

.git-icon {
    font-size: 1rem;
}

.git-status-badge {
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.git-status-badge.has-changes {
    background: var(--warning-color, var(--accent-yellow));
    color: #ffffff;
}

.editor-sidebar-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-panel {
    display: none;
    flex-direction: column;
    height: 100%;
}

.editor-panel.active {
    display: flex;
}

.editor-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--bg-surface);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.editor-sidebar-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-sidebar-actions {
    display: flex;
    gap: 4px;
}

.editor-action-btn {
    padding: 2px 6px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-action-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ==========================================
   File Tree
   ========================================== */

.editor-file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.editor-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.editor-tree-item {
    user-select: none;
}

.editor-tree-folder,
.editor-tree-file {
    display: flex;
    align-items: center;
    padding: 3px 8px 3px 0;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: background 0.1s;
    border-left: 2px solid transparent;
}

.editor-tree-folder:hover,
.editor-tree-file:hover {
    background: var(--bg-surface);
}

.editor-tree-folder.selected,
.editor-tree-file.selected {
    background: rgba(107, 114, 128, 0.15);
    border-left-color: var(--text-secondary);
}

/* Drag and drop states */
.editor-tree-folder.dragging,
.editor-tree-file.dragging {
    opacity: 0.5;
}

.editor-tree-folder.drop-target {
    background: rgba(88, 166, 255, 0.2);
    border-left-color: var(--accent-blue);
}

.editor-tree-toggle {
    width: 14px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.editor-tree-icon {
    width: 16px;
    text-align: center;
    margin-right: 5px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.editor-tree-icon.icon-folder,
.editor-tree-icon.icon-folder-open {
    color: var(--warning-color, var(--accent-yellow));
}

.editor-tree-icon.icon-md,
.editor-tree-icon.icon-markdown {
    color: #519aba;
}

.editor-tree-icon.icon-js {
    color: #f7df1e;
}

.editor-tree-icon.icon-ts {
    color: #3178c6;
}

.editor-tree-icon.icon-py {
    color: #3776ab;
}

.editor-tree-icon.icon-java {
    color: #f89820;
}

.editor-tree-icon.icon-html {
    color: #e34f26;
}

.editor-tree-icon.icon-css,
.editor-tree-icon.icon-scss {
    color: #563d7c;
}

.editor-tree-icon.icon-json {
    color: #cbcb41;
}

.editor-tree-icon.icon-yaml,
.editor-tree-icon.icon-yml {
    color: #cb171e;
}

.editor-tree-icon.icon-sh,
.editor-tree-icon.icon-bash {
    color: var(--success-color, var(--accent-green));
}

.editor-tree-icon.icon-go {
    color: #00add8;
}

.editor-tree-icon.icon-rs {
    color: #dea584;
}

.editor-tree-icon.icon-dockerfile {
    color: #2496ed;
}

.editor-tree-icon.icon-makefile {
    color: #f0c674;
}

.editor-tree-icon.icon-rakefile,
.editor-tree-icon.icon-gemfile {
    color: #cc342d;
}

.editor-tree-icon.icon-git {
    color: #f05032;
}

.editor-tree-icon.icon-config {
    color: #8b8b8b;
}

.editor-tree-icon.icon-license {
    color: #d4af37;
}

.editor-tree-icon.icon-readme {
    color: #519aba;
}

.editor-tree-icon.icon-changelog {
    color: #8bc34a;
}

.editor-tree-icon.icon-jenkinsfile {
    color: #d33833;
}

.editor-tree-icon.icon-vagrantfile {
    color: #1563ff;
}

.editor-tree-icon.icon-podfile,
.editor-tree-icon.icon-brewfile,
.editor-tree-icon.icon-procfile {
    color: #8b8b8b;
}

.editor-tree-icon.icon-default {
    color: var(--text-secondary);
}

.editor-tree-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.editor-tree-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.editor-tree-children.hidden {
    display: none;
}

/* ==========================================
   Git Panel - Not a Repo
   ========================================== */

.git-not-repo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
}

.git-not-repo-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.git-not-repo p {
    margin: 0 0 16px 0;
}

.git-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.git-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-surface);
}

.git-branch-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.git-branch-icon {
    font-size: 1rem;
    color: var(--success-color, var(--accent-green));
}

.git-branch-name {
    font-weight: 500;
    color: var(--text-primary);
}

.git-sync-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.git-panel-actions {
    display: flex;
    gap: 4px;
}

/* Git Sub Tabs */
.git-sub-tabs {
    display: flex;
    border-bottom: 1px solid var(--bg-surface);
}

.git-sub-tab {
    flex: 1;
    padding: 8px 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.git-sub-tab:hover {
    background: var(--bg-surface);
}

.git-sub-tab.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--button-primary-bg, var(--text-secondary));
}

.git-changes-count {
    margin-left: 4px;
    color: var(--warning-color, var(--accent-yellow));
}

/* Git Sub Panels */
.git-sub-panel {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.git-sub-panel.active {
    display: flex;
}

/* Branches Panel */
.git-search-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--bg-surface);
    flex-wrap: wrap;
}

.git-branch-bar-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.git-branch-bar-actions .editor-btn-sm {
    padding: 4px 8px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.git-search-bar input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
}

.git-search-bar input:focus {
    border-color: var(--button-primary-bg, var(--text-secondary));
}

.git-branches-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.git-branches-section {
    margin-bottom: 16px;
    padding: 0 12px;
}

.git-branches-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 8px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(139, 148, 158, 0.15);
    margin-bottom: 8px;
}

.git-branches-section-title .section-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

.git-branch-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    border-radius: 6px;
    margin-bottom: 2px;
}

.git-branch-item:hover {
    background: rgba(139, 148, 158, 0.1);
}

.git-branch-item.current {
    background: transparent;
    position: relative;
}

.git-branch-item.current::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-blue);
    border-radius: 0 2px 2px 0;
}

.git-branch-item.remote {
    opacity: 0.75;
}

.git-branch-item.remote:hover {
    opacity: 1;
}

.git-branch-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--text-secondary);
}

.git-branch-item.current .git-branch-indicator {
    background: var(--accent-blue);
}

.git-branch-item .git-branch-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.git-branch-item.current .git-branch-name {
    font-weight: 500;
    color: var(--accent-blue);
}

.git-branch-upstream {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-right: 8px;
    padding: 2px 6px;
    background: rgba(107, 114, 128, 0.15);
    border-radius: 4px;
}

.git-branch-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.git-branch-item:hover .git-branch-actions {
    opacity: 1;
}

.git-branch-action {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 4px;
    font-size: 0.85rem;
}

.git-branch-action:hover {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-primary);
}

.git-branch-action.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color, var(--accent-red));
}

/* Quick Edit Popup */
.quick-edit-popup {
    animation: quickEditFadeIn 0.15s ease-out;
}

@keyframes quickEditFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quick-edit-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-edit-hash {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    background: rgba(107, 114, 128, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.quick-edit-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
}

.quick-edit-input:focus {
    border-color: var(--button-primary-bg, var(--text-secondary));
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.quick-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.quick-edit-actions .editor-btn,
.quick-edit-actions .editor-btn-primary {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Commits Panel - Zed-style filter bar */
.git-commits-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--bg-surface);
}

/* Search input with icon */
.git-commits-search {
    display: flex;
    align-items: center;
    background: var(--sidebar-bg, var(--bg-elevated));
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    padding: 0 8px;
    flex: 0 0 auto;
    min-width: 140px;
}

.git-commits-search-icon {
    color: var(--text-secondary);
    font-size: 12px;
    margin-right: 6px;
}

.git-commits-search input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    padding: 6px 0;
    outline: none;
    width: 100%;
}

.git-commits-search input::placeholder {
    color: var(--text-secondary);
}

/* Filter buttons row */
.git-filter-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.git-filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.git-filter-btn:hover {
    background: var(--sidebar-hover, rgba(255, 255, 255, 0.05));
    border-color: var(--text-secondary);
}

.git-filter-btn.active {
    background: var(--link-color, var(--accent-blue));
    border-color: var(--link-color, var(--accent-blue));
    color: #ffffff;
}

.git-filter-btn .dropdown-arrow {
    font-size: 8px;
    opacity: 0.7;
}

.git-commits-filters select,
.git-commits-filters input {
    padding: 5px 8px;
    background: var(--sidebar-bg, var(--bg-elevated));
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
}

.git-commits-filters select:hover,
.git-commits-filters input:hover {
    border-color: var(--text-secondary);
}

.git-commits-filters select:focus,
.git-commits-filters input:focus {
    border-color: var(--link-color, var(--accent-blue));
}

.git-commits-filters select {
    min-width: 80px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%236b7280' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.git-message-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.git-message-filter input[type="text"] {
    flex: 1;
    min-width: 80px;
}

.git-filter-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.git-filter-option:hover {
    background: var(--sidebar-hover, rgba(255, 255, 255, 0.05));
}

.git-filter-option input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Filter separator */
.git-filter-separator {
    width: 1px;
    height: 20px;
    background: var(--bg-surface);
    margin: 0 4px;
}

/* Right-side action buttons */
.git-commits-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.git-commits-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-commits-action-btn:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.2);
    color: var(--text-primary);
}

.git-commits-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.git-commit-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 10px;
    flex-wrap: nowrap;
    min-height: 36px;
    border-radius: 6px;
    margin: 0 4px;
    border-left: 2px solid transparent;
}

.git-commit-item:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-commit-item.selected {
    background: rgba(88, 166, 255, 0.08);
    border-left-color: var(--accent-blue);
}

/* Colored commit dot indicator */
.git-commit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.git-commit-dot.merge {
    background: var(--accent-blue); /* Purple for merge commits */
}

.git-commit-dot.initial {
    background: var(--accent-green); /* Green for initial commit */
}

.git-commit-header {
    display: none; /* Hide old header layout */
}

.git-commit-hash {
    display: none; /* Hide hash, show only on hover/context menu */
}

.git-commit-message {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Branch indicator */
.git-commit-branch {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--accent-green);
    background: rgba(63, 185, 80, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.git-commit-branch-icon {
    opacity: 0.7;
}

.git-commit-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.git-commit-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.git-commit-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.git-commit-hash {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: var(--accent-blue);
}

.git-commit-author-old {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.git-commit-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 110px;
    text-align: right;
}

.git-commit-actions {
    display: none;
    gap: 4px;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.git-commit-item:hover .git-commit-actions {
    display: flex;
}

.git-commit-actions button {
    padding: 4px 6px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-commit-actions button:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

.git-load-more {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 10px;
    background: rgba(139, 148, 158, 0.06);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-load-more:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
}

/* Changes Panel */
.git-changes-section {
    margin-bottom: 8px;
}

.git-changes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    background: transparent;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.git-staged-list,
.git-unstaged-list {
    padding: 4px 0;
}

.git-change-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 4px;
    border-radius: 5px;
}

.git-change-item:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-change-status {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 10px;
}

.git-change-status.modified {
    background: rgba(88, 166, 255, 0.12);
    color: var(--accent-blue);
}

.git-change-status.added {
    background: rgba(63, 185, 80, 0.12);
    color: var(--accent-green);
}

.git-change-status.deleted {
    background: rgba(248, 81, 73, 0.12);
    color: var(--accent-red);
}

.git-change-status.renamed {
    background: rgba(163, 113, 247, 0.12);
    color: var(--accent-blue);
}

.git-change-status.untracked {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-secondary);
}

.git-change-status.conflict {
    background: rgba(210, 153, 34, 0.12);
    color: var(--accent-yellow);
}

.git-change-path {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.git-change-actions {
    display: none;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.git-change-item:hover .git-change-actions {
    display: flex;
    opacity: 1;
}

.git-change-actions button {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.git-change-actions button:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

.git-change-actions button.danger:hover {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

/* Commit Form */
.git-commit-form {
    padding: 12px;
    border-top: 1px solid var(--bg-surface);
}

.git-commit-form textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    margin-bottom: 8px;
}

.git-commit-form textarea:focus {
    border-color: var(--button-primary-bg, var(--text-secondary));
}

.git-commit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.git-commit-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Stash Panel */
.git-stash-actions-bar {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 148, 158, 0.1);
    display: flex;
    gap: 8px;
}

.git-stash-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.git-stash-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(139, 148, 158, 0.04);
    border: 1px solid rgba(139, 148, 158, 0.1);
    border-radius: 8px;
    transition: all 0.15s ease;
}

.git-stash-item:hover {
    border-color: rgba(139, 148, 158, 0.2);
    background: rgba(139, 148, 158, 0.06);
}

.git-stash-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.git-stash-index {
    font-size: 0.75rem;
    font-family: var(--font-mono, monospace);
    color: var(--accent-blue);
    background: rgba(163, 113, 247, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.git-stash-message {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.git-stash-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.git-stash-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.git-stash-item:hover .git-stash-actions {
    opacity: 1;
}

.git-stash-actions button {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-stash-actions button:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

.git-stash-actions button.danger:hover {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

/* ==========================================
   Content Area
   ========================================== */

.editor-content {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    overflow: hidden;
    min-height: 0;
}

.editor-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
}

.editor-current-file {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.editor-file-icon {
    font-size: 1rem;
}

.editor-file-lang {
    padding: 2px 8px;
    background: var(--bg-base);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.editor-content-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.editor-content-body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    min-height: 0;
}

/* Welcome Screen */
.editor-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 24px;
}

.editor-welcome-empty {
    text-align: center;
    color: var(--text-secondary);
}

.editor-welcome-empty p {
    margin: 0 0 8px 0;
}

.editor-welcome-hint {
    font-size: 0.8rem;
}

/* Recent Projects */
.editor-recent-projects {
    width: 100%;
    max-width: 500px;
}

.editor-recent-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 4px;
}

.editor-recent-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.editor-recent-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.editor-recent-item:hover {
    background: var(--bg-surface);
}

.editor-recent-icon {
    font-size: 1.1rem;
    margin-right: 12px;
    opacity: 0.7;
}

.editor-recent-info {
    flex: 1;
    min-width: 0;
}

.editor-recent-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.editor-recent-path {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   Editor Content - View Mode
   ========================================== */

.editor-content-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-base);
}

.editor-code-container {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    background: #0d0f12;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
}

.editor-code-container pre {
    margin: 0;
    padding: 16px;
    background: #0d0f12 !important;
    font-size: 13px;
    line-height: 1.6;
}

.editor-code-container pre code {
    display: block;
    line-height: 1.6;
    white-space: pre;
    font-family: var(--font-mono, monospace) !important;
    font-size: 13px !important;
    background: transparent !important;
}

.editor-code-container pre[class*="language-"],
.editor-code-container code[class*="language-"] {
    color: #e4e8ee !important;
    background: #0d0f12 !important;
    text-shadow: none !important;
    font-family: var(--font-mono, monospace) !important;
}

.editor-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
    flex-shrink: 0;
}

.editor-language-badge {
    padding: 3px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-family: var(--font-mono, monospace);
    text-transform: lowercase;
}

.editor-view-actions,
.editor-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-edit-btn {
    background: var(--primary-color, var(--accent-blue)) !important;
    color: white !important;
}

.editor-edit-btn:hover {
    background: var(--primary-hover, #2563eb) !important;
}

/* Code Display */
.editor-code-wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: auto;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    background: var(--bg-base);
}

.editor-line-numbers {
    padding: 16px 12px 16px 16px;
    background: var(--bg-base);
    color: var(--text-muted);
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--bg-surface);
    line-height: 1.6;
    position: sticky;
    left: 0;
    flex-shrink: 0;
}

.editor-line-numbers span {
    display: block;
    font-size: 12px;
}

.editor-code-content {
    flex: 1;
    padding: 0;
    overflow-x: auto;
    background: #0d0f12;
}

.editor-code-content pre {
    margin: 0;
    padding: 16px;
    background: #0d0f12 !important;
    font-size: 13px;
    line-height: 1.6;
}

.editor-code-content pre code {
    display: block;
    line-height: 1.6;
    white-space: pre;
    font-family: var(--font-mono, monospace) !important;
    font-size: 13px !important;
    background: transparent !important;
}

/* Prism Theme Overrides for Dark Mode - HIGH SPECIFICITY */
.editor-code-content pre[class*="language-"],
.editor-code-content code[class*="language-"],
.editor-code-content pre.line-numbers code,
.editor-code-content pre code#editorCodeBlock {
    color: #e4e8ee !important;
    background: #0d0f12 !important;
    text-shadow: none !important;
    font-family: var(--font-mono, monospace) !important;
}

/* Ensure all tokens are visible with proper colors */
.editor-code-content .token,
.editor-code-content pre code .token,
.editor-code-content code[class*="language-"] .token {
    background: transparent !important;
}

/* Override prism-tomorrow theme completely */
pre[class*="language-"],
code[class*="language-"] {
    text-shadow: none !important;
}

/* Token Colors - IntelliJ Darcula Theme */
/* No italics, strong readable colors */

.editor-code-content .token.comment,
.editor-code-content .token.prolog,
.editor-code-content .token.doctype,
.editor-code-content .token.cdata,
.editor-code-content code .token.comment,
.editor-code-content code .token.prolog {
    color: #808080 !important;
    font-style: normal !important;
}

.editor-code-content .token.punctuation,
.editor-code-content code .token.punctuation {
    color: #a9b7c6 !important;
}

.editor-code-content .token.property,
.editor-code-content code .token.property {
    color: #b267e6 !important;
}

.editor-code-content .token.tag,
.editor-code-content code .token.tag {
    color: #e8bf6a !important;
}

.editor-code-content .token.boolean,
.editor-code-content code .token.boolean {
    color: #b267e6 !important;
}

.editor-code-content .token.number,
.editor-code-content code .token.number {
    color: #6897bb !important;
}

.editor-code-content .token.constant,
.editor-code-content code .token.constant {
    color: #b267e6 !important;
}

.editor-code-content .token.symbol,
.editor-code-content code .token.symbol {
    color: #6a8759 !important;
}

.editor-code-content .token.selector,
.editor-code-content code .token.selector {
    color: #b267e6 !important;
}

.editor-code-content .token.attr-name,
.editor-code-content code .token.attr-name {
    color: #bababa !important;
}

.editor-code-content .token.string,
.editor-code-content .token.char,
.editor-code-content code .token.string {
    color: #6a8759 !important;
}

.editor-code-content .token.builtin,
.editor-code-content code .token.builtin {
    color: #ffc66d !important;
}

.editor-code-content .token.operator,
.editor-code-content .token.entity,
.editor-code-content .token.url,
.editor-code-content .language-css .token.string,
.editor-code-content .style .token.string,
.editor-code-content code .token.operator {
    color: #a9b7c6 !important;
}

.editor-code-content .token.atrule,
.editor-code-content .token.attr-value,
.editor-code-content code .token.attr-value {
    color: #6a8759 !important;
}

.editor-code-content .token.keyword,
.editor-code-content code .token.keyword {
    color: #b267e6 !important;
    font-style: normal !important;
}

.editor-code-content .token.function,
.editor-code-content code .token.function {
    color: #ffc66d !important;
}

.editor-code-content .token.class-name,
.editor-code-content code .token.class-name {
    color: #a9b7c6 !important;
}

.editor-code-content .token.regex,
.editor-code-content code .token.regex {
    color: #6a8759 !important;
}

.editor-code-content .token.important {
    color: #b267e6 !important;
    /* No bold - would change character width and break caret alignment */
    font-weight: inherit !important;
    font-style: normal !important;
}

.editor-code-content .token.variable,
.editor-code-content code .token.variable {
    color: #a9b7c6 !important;
}

/* Additional token types for better coverage */
.editor-code-content .token.namespace,
.editor-code-content code .token.namespace {
    color: #a9b7c6 !important;
}

.editor-code-content .token.deleted {
    color: #6a8759 !important;
    background: rgba(106, 135, 89, 0.15) !important;
}

.editor-code-content .token.inserted {
    color: #6a8759 !important;
    background: rgba(106, 135, 89, 0.15) !important;
}

.editor-code-content .token.parameter,
.editor-code-content code .token.parameter {
    color: #a9b7c6 !important;
}

.editor-code-content .token.decorator,
.editor-code-content .token.annotation {
    color: #bbb529 !important;
}

.editor-code-content .token.template-string {
    color: #6a8759 !important;
}

.editor-code-content .token.interpolation {
    color: #b267e6 !important;
}

/* Java/Kotlin specific */
.editor-code-content .token.annotation {
    color: #bbb529 !important;
}

/* XML/HTML tag colors */
.editor-code-content .token.tag .token.punctuation {
    color: #e8bf6a !important;
}

.editor-code-content .token.tag .token.attr-name {
    color: #bababa !important;
}

.editor-code-content .token.tag .token.attr-value {
    color: #6a8759 !important;
}

/* Ensure no italics anywhere */
.editor-code-content .token.italic,
.editor-highlight-code .token.italic {
    font-style: normal !important;
}

/* Python specific */
.editor-code-content .token.builtin,
.editor-code-content code .token.builtin {
    color: #4ec9b0 !important;
}

/* JavaScript/TypeScript specific */
.editor-code-content .token.console,
.editor-code-content .token.module {
    color: #4ec9b0 !important;
}

.editor-code-content .token.arrow,
.editor-code-content .token.fat-arrow {
    color: #569cd6 !important;
}

/* Type definitions - Light gray-blue */
.editor-code-content .token.type,
.editor-code-content .token.type-definition,
.editor-code-content code .token.type {
    color: #a9b7c6 !important;
}

/* Generics - Light gray-blue */
.editor-code-content .token.generics,
.editor-code-content .token.generic,
.editor-code-content code .token.generics {
    color: #a9b7c6 !important;
}

/* Null/undefined/nil - Warm Purple */
.editor-code-content .token.nil,
.editor-code-content .token.null,
.editor-code-content code .token.null {
    color: #b267e6 !important;
}

/* This/self/super keywords - Warm Purple */
.editor-code-content .token.this,
.editor-code-content .token.self,
.editor-code-content .token.super,
.editor-code-content code .token.this {
    color: #b267e6 !important;
}

/* Control flow keywords - Warm Purple */
.editor-code-content .token.control-flow,
.editor-code-content code .token.control-flow {
    color: #b267e6 !important;
}

/* Package/import statements - Light gray-blue */
.editor-code-content .token.package,
.editor-code-content .token.import,
.editor-code-content code .token.package {
    color: #a9b7c6 !important;
}

/* Modifiers (public, private, static, final) - Warm Purple */
.editor-code-content .token.modifier,
.editor-code-content .token.access-modifier,
.editor-code-content code .token.modifier {
    color: #b267e6 !important;
}

/* Exception types - Light gray-blue */
.editor-code-content .token.exception,
.editor-code-content code .token.exception {
    color: #a9b7c6 !important;
}

/* Constructor - Yellow/Gold like functions */
.editor-code-content .token.constructor,
.editor-code-content code .token.constructor {
    color: #ffc66d !important;
}

/* Primitive types (int, boolean, void, etc.) - Warm Purple */
.editor-code-content .token.primitive,
.editor-code-content code .token.primitive {
    color: #b267e6 !important;
}

/* Lambda/arrow - Blue */
.editor-code-content .token.lambda,
.editor-code-content code .token.lambda {
    color: #569cd6 !important;
}

/* Spread operator - Light gray-blue */
.editor-code-content .token.spread,
.editor-code-content code .token.spread {
    color: #a9b7c6 !important;
}

/* Method reference (Java ::) - Light gray-blue */
.editor-code-content .token.method-reference,
.editor-code-content code .token.method-reference {
    color: #a9b7c6 !important;
}

/* Ensure line numbers don't get colored */
.editor-code-content .line-numbers-rows > span::before,
.editor-line-numbers {
    color: #858585 !important;
}

/* ==========================================
   Editor Content - Edit Mode
   ========================================== */

.editor-content-edit {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 0;
    background: #0d0f12;
    overflow: hidden;
}

.editor-edit-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
    flex-shrink: 0;
}

.editor-line-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.editor-modified-indicator {
    font-size: 0.75rem;
    color: var(--warning-color, var(--accent-yellow));
    font-weight: 500;
    transition: color 0.2s;
}

.editor-modified-indicator.saved {
    color: var(--success-color, var(--accent-green));
}

.editor-autosave-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: auto;
    transition:
        color 0.2s,
        opacity 0.2s;
    opacity: 0.8;
}

.editor-autosave-status.saved {
    color: var(--success-color, var(--accent-green));
    opacity: 1;
}

.editor-autosave-status:empty {
    display: none;
}

.editor-edit-wrapper {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Markdown Preview */
/* Markdown Toggle Buttons */
.editor-markdown-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 2px;
}

.editor-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family:
        "Roboto",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
}

.editor-toggle-btn:hover {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.05);
}

.editor-toggle-btn.active {
    background: var(--accent-green);
    color: var(--text-primary);
}

.editor-toggle-btn .toggle-icon {
    font-size: 0.85rem;
}

/* Markdown View Container */
.editor-markdown-view {
    background: var(--bg-base);
}

/*
 * Editor Markdown Content — layout only.
 * Typography, headings, lists, blockquotes, inline code, links, images, etc.
 * are inherited from content-markup.css via the shared `markdown-content` class.
 */
.editor-markdown-content {
    padding: 32px 48px;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-base);
}

/* ==========================================
   Syntax-Highlighted Editor (textarea + Prism overlay)
   SIMPLIFIED VERSION - Native browser behavior first
   ========================================== */

/* ============================================
   EDITOR CONTAINER
   Simple flexbox layout - let browser handle the rest
   ============================================ */
.editor-highlight-container {
    /* Single source of truth for typography */
    --editor-font:
        "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    --editor-size: 14px;
    --editor-line: 1.7;
    --editor-tab: 2;
    --editor-pad-v: 16px;
    --editor-pad-h: 20px;

    position: relative;
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    background: #0d0f12;
    overflow: hidden;
}

/* ============================================
   LINE NUMBERS - Simple column
   ============================================ */
.editor-highlight-container .editor-line-numbers {
    flex-shrink: 0;
    width: 50px;
    padding: var(--editor-pad-v) 8px var(--editor-pad-v) 16px;
    background: #0a0c0f;
    border-right: 1px solid #1a1d24;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: right;
    user-select: none;
    font-family: var(--editor-font);
    font-size: var(--editor-size);
    line-height: var(--editor-line);
    color: #4a5366;
    box-sizing: border-box;
}

.editor-highlight-container .editor-line-numbers::-webkit-scrollbar {
    display: none;
}

.editor-highlight-container .editor-line-numbers {
    scrollbar-width: none;
}

.editor-highlight-container .editor-line-numbers .line-number {
    display: block;
    height: 1.7em;
}

/* ============================================
   CODE AREA - Contains both textarea and highlight
   CRITICAL: This is just a positioning container
   ============================================ */
.editor-code-area {
    flex: 1;
    position: relative;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
}

/* PrismJS toolbar plugin wraps <pre> in .code-toolbar (position: relative),
   breaking the absolute positioning chain. Force it to fill the code area. */
.editor-code-area > .code-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Hide PrismJS copy-to-clipboard toolbar in editor (editor has its own copy button) */
.editor-code-area > .code-toolbar > .toolbar {
    display: none;
}

/* ============================================
   TEXTAREA - THE PRIMARY EDITING ELEMENT
   This is what the user actually types in
   KEEP IT SIMPLE - use native browser behavior
   ============================================ */
.editor-textarea-overlay {
    /* Fill the container completely */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Simple padding - must match highlight-pre exactly */
    padding: var(--editor-pad-v) var(--editor-pad-h);
    margin: 0;
    border: none;

    /* Typography - explicit properties for browser compatibility */
    font-family: var(--editor-font);
    font-size: var(--editor-size);
    line-height: var(--editor-line);
    font-weight: 400;
    font-style: normal;
    tab-size: var(--editor-tab);
    -moz-tab-size: var(--editor-tab);

    /* Whitespace - use pre for code */
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    word-spacing: normal;
    letter-spacing: normal;

    /* CRITICAL: Reset text positioning to match code element */
    text-indent: 0;
    text-align: left;
    vertical-align: top;

    /* Make text invisible but keep caret */
    color: transparent;
    caret-color: #58a6ff;
    background: transparent;

    /* Allow scrolling */
    overflow: auto;

    /* Ensure it receives all input */
    z-index: 2;

    /* Standard textarea resets */
    resize: none;
    outline: none;
    box-sizing: border-box;
}

/* Focus state */
.editor-textarea-overlay:focus {
    outline: none;
}

/* Selection styling */
.editor-textarea-overlay::selection {
    background: rgba(88, 166, 255, 0.35);
}

/* ============================================
   HIGHLIGHT PRE - Shows syntax colored code
   Must match textarea EXACTLY for alignment
   ============================================ */
.editor-highlight-pre {
    /* Same positioning as textarea */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Same padding as textarea */
    padding: var(--editor-pad-v) var(--editor-pad-h);
    margin: 0;
    border: none;

    /* Same typography as textarea - explicit properties */
    font-family: var(--editor-font);
    font-size: var(--editor-size);
    line-height: var(--editor-line);
    font-weight: 400;
    font-style: normal;
    tab-size: var(--editor-tab);
    -moz-tab-size: var(--editor-tab);

    /* Same whitespace handling */
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    word-spacing: normal;
    letter-spacing: normal;

    /* CRITICAL: Same text positioning as textarea */
    text-indent: 0;
    text-align: left;
    vertical-align: top;

    /* Allow scrolling (synced with textarea) */
    overflow: auto;

    /* Visual styling */
    background: transparent;
    color: #e4e8ee;

    /* Below textarea, non-interactive */
    z-index: 1;
    pointer-events: none;
    user-select: none;

    box-sizing: border-box;
}

/* ============================================
   HIGHLIGHT CODE - Inside the pre
   Must match textarea typography EXACTLY
   ============================================ */
.editor-highlight-code {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;

    /* Explicit typography - must match textarea exactly */
    font-family: var(--editor-font);
    font-size: var(--editor-size);
    line-height: var(--editor-line);
    font-weight: 400;
    font-style: normal;
    white-space: pre;
    tab-size: var(--editor-tab);
    -moz-tab-size: var(--editor-tab);
    word-wrap: normal;
    word-break: normal;
    word-spacing: normal;
    letter-spacing: normal;

    /* CRITICAL: Reset text positioning */
    text-indent: 0;
    text-align: left;
    vertical-align: top;

    /* Non-interactive */
    pointer-events: none;
    user-select: none;

    color: #a9b7c6;
}

/* ============================================
   GLOBAL CSS RESET FOR EDITOR ELEMENTS
   Override global styles from variables.css that affect alignment
   ============================================ */

/* Override global code { font-size: 0.9em } from variables.css */
.editor-highlight-container code,
.editor-code-area code,
.editor-highlight-code {
    font-size: var(--editor-size) !important;
}

/* Override global pre { font-family: var(--font-mono) } */
.editor-highlight-container pre,
.editor-code-area pre,
.editor-highlight-pre {
    font-family: var(--editor-font) !important;
}

/* ============================================
   PRISM CSS RESET - CRITICAL FOR ALIGNMENT
   Prism's defaults break our textarea/pre alignment
   These must have high specificity to override Prism
   ============================================ */

/* Reset Prism's pre defaults */
.editor-highlight-container pre[class*="language-"],
.editor-code-area pre[class*="language-"],
.editor-highlight-pre[class*="language-"],
pre.editor-highlight-pre {
    /* Override Prism's font-size: 1em and line-height: 1.5 */
    font-family: var(--editor-font) !important;
    font-size: var(--editor-size) !important;
    line-height: var(--editor-line) !important;
    font-weight: 400 !important;
    font-style: normal !important;
    /* Override Prism's padding: 1em and margin: .5em 0 */
    margin: 0 !important;
    padding: var(--editor-pad-v) var(--editor-pad-h) !important;
    /* Override Prism's background */
    background: transparent !important;
    /* Override Prism's tab-size: 4 */
    tab-size: var(--editor-tab) !important;
    -moz-tab-size: var(--editor-tab) !important;
    /* Ensure consistent whitespace */
    white-space: pre !important;
    word-spacing: normal !important;
    word-break: normal !important;
    word-wrap: normal !important;
    /* Remove text shadow from prism-tomorrow */
    text-shadow: none !important;
}

/* Reset Prism's code defaults */
.editor-highlight-container code[class*="language-"],
.editor-code-area code[class*="language-"],
.editor-highlight-code[class*="language-"],
code.editor-highlight-code {
    /* Override Prism's font settings */
    font: inherit !important;
    /* Override Prism's background and padding */
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    /* Ensure block display */
    display: block !important;
    /* Remove text shadow */
    text-shadow: none !important;
}

/* Disable Prism line-numbers plugin styles that interfere */
.editor-highlight-container pre[class*="language-"].line-numbers,
.editor-highlight-pre.line-numbers {
    padding-left: var(--editor-pad-h) !important;
    counter-reset: none !important;
}

.editor-highlight-container .line-numbers-rows {
    display: none !important;
}

/* Reset all Prism tokens */
.editor-highlight-code .token,
.editor-highlight-code .token .token {
    font: inherit !important;
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    /* Prevent italic/bold from changing character width */
    font-style: normal !important;
    font-weight: normal !important;
    /* Reset any text decorations */
    text-decoration: none !important;
    text-shadow: none !important;
    vertical-align: baseline !important;
}

/* ============================================
   SYNTAX HIGHLIGHTING COLORS (Darcula theme)
   ============================================ */
.editor-highlight-code .token.comment,
.editor-highlight-code .token.prolog,
.editor-highlight-code .token.doctype,
.editor-highlight-code .token.cdata {
    color: #808080;
}

.editor-highlight-code .token.punctuation {
    color: #a9b7c6;
}

.editor-highlight-code .token.property {
    color: #b267e6;
}

.editor-highlight-code .token.tag {
    color: #e8bf6a;
}

.editor-highlight-code .token.boolean {
    color: #b267e6;
}

.editor-highlight-code .token.number {
    color: #6897bb;
}

.editor-highlight-code .token.constant {
    color: #b267e6;
}

.editor-highlight-code .token.symbol {
    color: #6a8759;
}

.editor-highlight-code .token.selector {
    color: #ffc66d;
}

.editor-highlight-code .token.attr-name {
    color: #bababa;
}

.editor-highlight-code .token.string,
.editor-highlight-code .token.char {
    color: #6a8759;
}

.editor-highlight-code .token.builtin {
    color: #a9b7c6;
}

.editor-highlight-code .token.operator {
    color: #a9b7c6;
}

.editor-highlight-code .token.entity,
.editor-highlight-code .token.url {
    color: #287bde;
}

.editor-highlight-code .token.atrule,
.editor-highlight-code .token.attr-value {
    color: #a5c261;
}

.editor-highlight-code .token.keyword {
    color: #b267e6;
}

.editor-highlight-code .token.function {
    color: #ffc66d;
}

.editor-highlight-code .token.class-name {
    color: #a9b7c6;
}

.editor-highlight-code .token.regex {
    color: #6a8759;
}

.editor-highlight-code .token.important {
    color: #b267e6;
}

.editor-highlight-code .token.variable {
    color: #a9b7c6;
}

.editor-highlight-code .token.namespace {
    color: #b9bcd1;
}

.editor-highlight-code .token.deleted {
    color: #ff6b68;
}

.editor-highlight-code .token.inserted {
    color: #a6e22e;
}

.editor-highlight-code .token.annotation,
.editor-highlight-code .token.decorator {
    color: #bbb529;
}

.editor-highlight-code .token.parameter {
    color: #a9b7c6;
}

.editor-highlight-code .token.template-string {
    color: #6a8759;
}

.editor-highlight-code .token.interpolation {
    color: #b267e6;
}

.editor-highlight-code .token.type {
    color: #a9b7c6;
}

.editor-highlight-code .token.generics {
    color: #507874;
}

.editor-highlight-code .token.null {
    color: #b267e6;
}

.editor-highlight-code .token.this,
.editor-highlight-code .token.self {
    color: #b267e6;
}

.editor-highlight-code .token.control-flow,
.editor-highlight-code .token.modifier {
    color: #b267e6;
}

.editor-highlight-code .token.constructor {
    color: #ffc66d;
}

.editor-highlight-code .token.primitive {
    color: #b267e6;
}

.editor-highlight-code .token.tag .token.punctuation {
    color: #e8bf6a;
}

.editor-highlight-code .token.tag .token.attr-name {
    color: #bababa;
}

.editor-highlight-code .token.tag .token.attr-value {
    color: #a5c261;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.editor-textarea-overlay::-webkit-scrollbar,
.editor-highlight-pre::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.editor-textarea-overlay::-webkit-scrollbar-track,
.editor-highlight-pre::-webkit-scrollbar-track {
    background: #0d0f12;
}

.editor-textarea-overlay::-webkit-scrollbar-thumb,
.editor-highlight-pre::-webkit-scrollbar-thumb {
    background: #2d3139;
    border-radius: 5px;
}

.editor-textarea-overlay::-webkit-scrollbar-thumb:hover,
.editor-highlight-pre::-webkit-scrollbar-thumb:hover {
    background: #4a5366;
}

/* Legacy textarea styles removed - using editor-textarea-overlay only */

.editor-textarea::-moz-selection {
    background: rgba(88, 166, 255, 0.35);
}

/* Scrollbar styling for textarea */
.editor-textarea::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.editor-textarea::-webkit-scrollbar-track {
    background: var(--bg-base);
}

.editor-textarea::-webkit-scrollbar-thumb {
    background: var(--sidebar-border, #2d3139);
    border-radius: 5px;
}

.editor-textarea::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.editor-file-modified {
    margin-left: 8px;
    font-size: 14px;
}

/*
 * Editor markdown pre/code/table — removed.
 * These styles now come from content-markup.css via the shared `markdown-content` class,
 * ensuring the editor preview looks identical to agent AI message rendering.
 * Mermaid diagrams are also styled via docs-viewer.css (.mermaid-diagram).
 */

.editor-preview-toggle {
    display: flex;
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
}

.editor-preview-btn {
    padding: 4px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-preview-btn:hover {
    color: var(--text-primary);
}

.editor-preview-btn.active {
    background: var(--button-primary-bg, var(--text-secondary));
    color: white;
}

/* ==========================================
   Context Menu
   ========================================== */

.editor-context-menu {
    position: fixed;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 5500;
    display: none;
    padding: 4px 0;
}

.editor-context-menu.visible {
    display: block;
}

.editor-context-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.15s;
}

.editor-context-item:hover {
    background: var(--bg-hover, rgba(99, 148, 255, 0.12));
}

.editor-context-item.danger {
    color: var(--accent-red, #ef4444);
}

.editor-context-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.editor-context-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editor-context-item.disabled:hover {
    background: transparent;
}

.editor-context-icon {
    width: 20px;
    margin-right: 8px;
}

.editor-context-label {
    flex: 1;
}

.editor-context-shortcut {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.editor-context-divider {
    height: 1px;
    background: var(--bg-surface);
    margin: 4px 0;
}

.editor-context-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.has-submenu {
    position: relative;
}

.editor-context-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: none;
    padding: 4px 0;
}

.has-submenu:hover .editor-context-submenu {
    display: block;
}

/* ==========================================
   Modal
   ========================================== */

.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 7000;
    display: none;
    align-items: center;
    justify-content: center;
}

.editor-modal.visible {
    display: flex;
}

.editor-modal-content {
    width: auto;
    min-width: 240px;
    max-width: 280px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    padding: 14px 16px;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.12s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.editor-modal-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-radius: 3px;
}

.editor-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.editor-modal-content h3 {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-right: 16px;
}

.editor-modal-content p {
    margin: 0 0 16px 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--sidebar-active, var(--text-secondary));
}

.editor-modal-content p.warning {
    color: var(--warning-color, var(--accent-yellow));
}

.editor-modal-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.editor-modal-input:focus {
    border-color: var(--button-primary-bg, var(--text-secondary));
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.editor-modal-options {
    margin-bottom: 16px;
}

.editor-modal-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.editor-modal-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    justify-content: flex-end;
}

.editor-btn {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
}

.editor-btn:active {
    transform: scale(0.98);
}

.editor-btn-sm {
    padding: 5px 10px;
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-btn-sm:hover {
    background: var(--bg-surface);
}

.editor-btn-primary {
    padding: 5px 10px;
    background: var(--accent-green);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-btn-primary:hover {
    background: var(--accent-green);
}

.editor-btn-warning {
    padding: 5px 10px;
    background: var(--accent-orange, #f59e0b);
    color: var(--bg-base);
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-btn-warning:hover {
    background: var(--accent-yellow, #fbbf24);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.editor-btn-danger {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    background: var(--error-color, var(--accent-red));
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    z-index: 1;
}

.editor-btn-danger:hover {
    background: var(--accent-red);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Apply Patch Actions */
.apply-patch-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.apply-patch-info {
    margin: 8px 0;
}

.apply-patch-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 4px;
    border-left: 3px solid var(--accent-blue);
}

/* Format Patch Modal */
.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.editor-modal-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.editor-modal-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.editor-modal-select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
}

.editor-modal-select option {
    padding: 8px;
    background: var(--bg-base);
    color: var(--text-primary);
}

.format-patch-preview {
    padding: 12px;
    background: var(--bg-surface);
    border-radius: 6px;
    margin: 12px 0;
    min-height: 40px;
}

.format-patch-preview .preview-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.format-patch-preview .preview-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.format-patch-preview .preview-info strong {
    color: var(--accent-blue);
}

.editor-btn-danger:active {
    transform: scale(0.98);
}

/* ============================================
   Create Patch Modal
   ============================================ */

.create-patch-modal {
    min-width: 500px;
}

.create-patch-modal h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.patch-source-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.patch-source-tab {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.patch-source-tab:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.patch-source-tab.active {
    background: var(--bg-surface);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-surface);
    color: var(--accent-blue);
}

.patch-source-content {
    min-height: 200px;
}

.patch-source-panel {
    display: none;
}

.patch-source-panel.active {
    display: block;
}

.patch-panel-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.patch-panel-action {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* Commits List */
.patch-commits-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.patch-commits-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.patch-commits-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-base);
}

.patch-commits-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.patch-commit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

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

.patch-commit-item:hover {
    background: var(--bg-surface);
}

.patch-commit-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.patch-commit-hash {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: var(--accent-blue);
    flex-shrink: 0;
    width: 60px;
}

.patch-commit-message {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patch-commit-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: right;
    min-width: 100px;
}

/* ============================================
   Patch Panel Simplified
   ============================================ */

.git-patch-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px;
}

.git-patch-actions .git-modal-action-btn {
    padding: 12px 24px;
    font-size: 0.9rem;
}

.git-patch-actions .git-modal-action-btn.primary {
    background: var(--accent-blue);
    color: var(--bg-base);
}

.git-patch-actions .git-modal-action-btn.primary:hover {
    background: var(--link-hover);
}

.git-patch-info {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-radius: 8px;
    margin: 0 20px 20px;
}

.git-patch-info p {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.git-patch-info p:last-child {
    margin-bottom: 0;
}

.git-patch-info strong {
    color: var(--text-primary);
}

/* Git Warning Message */
.git-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--accent-red, #ef4444);
    font-size: 0.85rem;
    margin: 10px 0;
}

/* Git Compare View */
.git-compare-view {
    padding: 16px;
}

.git-compare-view h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.git-compare-stats {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-base);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

.git-compare-files {
    max-height: 400px;
    overflow-y: auto;
}

.git-compare-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.git-compare-file:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-compare-status {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    width: 20px;
    text-align: center;
}

.git-compare-status.status-A {
    color: var(--accent-green);
}

.git-compare-status.status-M {
    color: var(--accent-orange, #d29922);
}

.git-compare-status.status-D {
    color: var(--accent-red);
}

.git-compare-status.status-R {
    color: var(--accent-blue);
}

/* Settings Form */
.editor-settings-form,
.editor-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Compact Modal Form */
.editor-modal-form.compact {
    gap: 12px;
    padding: 16px;
    max-width: 320px;
}

.editor-modal-form.compact h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-modal-form.compact .editor-modal-field {
    margin: 0;
}

.editor-modal-form.compact .editor-modal-input {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.editor-modal-form.compact .editor-modal-actions {
    margin-top: 4px;
    gap: 8px;
}

/* Modal Checkbox */
.editor-modal-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.editor-modal-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.editor-modal-checkbox span {
    user-select: none;
}

/* Modal Radio Group */
.editor-modal-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.editor-modal-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.editor-modal-radio:hover {
    background: var(--bg-surface);
}

.editor-modal-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.editor-modal-radio span {
    user-select: none;
}

.editor-modal-radio:has(input:checked) {
    background: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.1);
    color: var(--text-primary);
}

/* Apply Patch Modal */
.apply-patch-form {
    max-width: 450px;
    padding: 16px;
}

.apply-patch-form h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.apply-patch-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.apply-patch-tab {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.apply-patch-tab:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.apply-patch-tab.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.apply-patch-content {
    margin-bottom: 12px;
}

.apply-patch-tab-content {
    display: none;
}

.apply-patch-tab-content.active {
    display: block;
}

.apply-patch-tab-content textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    resize: vertical;
    min-height: 120px;
}

.apply-patch-tab-content textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.apply-patch-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    background: var(--bg-base);
    border: 2px dashed var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.apply-patch-dropzone:hover,
.apply-patch-dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.05);
}

.apply-patch-dropzone .dropzone-icon {
    font-size: 1.5rem;
}

.apply-patch-dropzone .dropzone-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.apply-patch-filename {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent-green);
}

.patch-source-info {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.patch-source-info:empty {
    display: none;
}

.patch-source-info.source-clipboard {
    background: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(var(--accent-blue-rgb, 59, 130, 246), 0.3);
}

.patch-source-info.source-file {
    background: rgba(var(--accent-green-rgb, 34, 197, 94), 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(var(--accent-green-rgb, 34, 197, 94), 0.3);
}

.apply-patch-options {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

/* Settings Group */
.editor-settings-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.editor-settings-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.editor-settings-group input[type="number"],
.editor-settings-group select {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.editor-settings-group input[type="number"]:focus,
.editor-settings-group select:focus {
    border-color: var(--accent-green);
}

.editor-settings-group input[type="number"]:hover,
.editor-settings-group select:hover {
    border-color: var(--border-default);
}

/* Diff Viewer */
.git-diff-viewer {
    padding: 16px;
    background: var(--bg-base);
    border-radius: 6px;
    overflow-x: auto;
}

.git-diff-viewer pre {
    margin: 0;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
    color: var(--text-primary);
    background: var(--code-bg) !important;
}

/* ==========================================
   Notifications
   ========================================== */

.editor-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--success-color, var(--accent-green));
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10003;
    animation: slideInNotification 0.3s ease;
}

.editor-notification.error {
    background: var(--error-color, var(--accent-red));
}

.editor-notification.fade-out {
    animation: fadeOutNotification 0.3s ease forwards;
}

@keyframes slideInNotification {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOutNotification {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==========================================
   States
   ========================================== */

.editor-empty-state,
.editor-loading,
.editor-error,
.git-empty,
.git-loading,
.git-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.editor-error,
.git-error {
    color: var(--error-color, var(--accent-red));
}

.editor-error-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

/* ==========================================
   Blame Viewer
   ========================================== */

.blame-viewer {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
}

.blame-line {
    display: flex;
    border-bottom: 1px solid var(--bg-surface);
    padding: 2px 0;
    line-height: 1.5;
}

.blame-line:hover {
    background: var(--bg-surface);
}

.blame-commit {
    width: 70px;
    color: var(--link-color, var(--accent-blue));
}

.blame-author {
    width: 120px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blame-code {
    flex: 1;
    white-space: pre;
    color: var(--text-primary);
}

/* ==========================================
   Image Preview
   ========================================== */

.image-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: repeating-conic-gradient(
            var(--bg-surface) 0% 25%,
            transparent 0% 50%
        )
        50% / 20px 20px;
    min-height: 300px;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 70vh;
}

/* ==========================================
   Commit Highlight
   ========================================== */

.git-commit-item.highlighted {
    background: rgba(107, 114, 128, 0.2);
    animation: pulseHighlight 1s ease;
}

@keyframes pulseHighlight {
    0%,
    100% {
        background: rgba(107, 114, 128, 0.2);
    }
    50% {
        background: rgba(107, 114, 128, 0.3);
    }
}

.git-commit-item.small {
    padding: 6px 12px;
}

.git-commit-item.small .git-commit-header {
    margin-bottom: 2px;
}

.git-commit-item.small .git-commit-message {
    font-size: 0.8rem;
}

.git-commit-item.small .git-commit-author {
    display: none;
}

/* ==========================================
   File/Commit History
   ========================================== */

.git-history-list {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.git-files-list {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.git-commit-details {
    padding: 16px;
    background: var(--bg-base);
    border-radius: 6px;
    margin-bottom: 16px;
}

.git-commit-details p {
    margin: 4px 0;
}

/* ==========================================
   Additional Modal Styling
   ========================================== */

.editor-modal-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background 0.15s;
}

.editor-modal-options label:hover {
    background: var(--bg-surface);
}

.editor-modal-options input[type="radio"],
.editor-modal-options input[type="checkbox"] {
    accent-color: var(--button-primary-bg, var(--text-secondary));
}

/* ==========================================
   Z-Index Hierarchy (from lowest to highest):
   - Editor overlay: 5000
   - Git modal: 5200
   - Editor context menu: 5500
   - Editor context submenu: 5510
   - Search modal: 6000
   - Editor modal: 7000 (highest - must be above search modal)
   ========================================== */

.editor-context-menu {
    z-index: 5500 !important;
}

.editor-context-submenu {
    z-index: 5510 !important;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .editor-container {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .editor-sidebar {
        width: 220px;
    }

    .editor-header-center {
        display: none;
    }

    .git-commits-filters {
        flex-direction: column;
    }

    .git-message-filter {
        width: 100%;
    }
}

/* ==========================================
   Git Modal (Large Panel)
   ========================================== */

.git-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 5200;
    display: none;
    align-items: center;
    justify-content: center;
}

.git-modal-overlay.visible {
    display: flex;
}

.git-modal-container {
    width: 96%;
    max-width: none;
    height: 94vh;
    background: var(--modal-panel-bg);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.git-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(139, 148, 158, 0.1);
}

.git-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.git-modal-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Git Modal Project Selector */
.git-modal-project-selector {
    padding: 5px 10px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    max-width: 280px;
    min-width: 180px;
    outline: none;
    transition: all 0.15s ease;
}

.git-modal-project-selector:hover {
    background: rgba(88, 166, 255, 0.14);
    border-color: rgba(88, 166, 255, 0.35);
}

.git-modal-project-selector:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.git-modal-project-selector option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* No-repo state placeholder */
.git-modal-no-repo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    width: 100%;
    line-height: 1.6;
}

.git-modal-no-repo small {
    color: var(--text-tertiary, rgba(139, 148, 158, 0.6));
    font-size: 0.8rem;
    margin-top: 4px;
}

.git-modal-branch {
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-mono, monospace);
    color: var(--accent-blue);
}

/* ============================================
   Branch Dropdown (Header Quick Switch)
   ============================================ */

.git-branch-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.git-branch-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-branch-dropdown-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: rgba(88, 166, 255, 0.3);
}

.git-branch-dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.15s ease;
}

.git-branch-dropdown-menu.visible
    + .git-branch-dropdown-btn
    .git-branch-dropdown-arrow,
.git-branch-dropdown:has(.git-branch-dropdown-menu.visible)
    .git-branch-dropdown-arrow {
    transform: rotate(180deg);
}

.git-branch-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    max-width: 400px;
    max-height: 400px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.git-branch-dropdown-menu.visible {
    display: flex;
}

.git-branch-dropdown-search {
    padding: 8px;
    border-bottom: 1px solid var(--border-default);
}

.git-branch-dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.git-branch-dropdown-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.git-branch-dropdown-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.git-dropdown-section-title {
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.git-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.git-dropdown-item:hover {
    background: var(--bg-hover);
}

.git-dropdown-item.current {
    background: rgba(88, 166, 255, 0.1);
}

.git-dropdown-item.current:hover {
    background: rgba(88, 166, 255, 0.15);
}

.git-dropdown-icon {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.git-dropdown-item.current .git-dropdown-icon {
    color: var(--accent-blue);
}

.git-dropdown-item.remote .git-dropdown-icon {
    color: var(--accent-purple);
}

.git-dropdown-name {
    flex: 1;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-dropdown-current {
    padding: 2px 6px;
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.git-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.git-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.git-modal-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-action-btn:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.3);
    color: var(--text-primary);
}

.git-modal-action-btn.primary {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.git-modal-action-btn.primary:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.git-modal-action-btn-sm {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-action-btn-sm:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

.git-modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.git-modal-close-btn:hover {
    background: rgba(139, 148, 158, 0.1);
    color: var(--text-primary);
}

/* Git Modal Tabs */
.git-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(139, 148, 158, 0.1);
}

.git-modal-tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.git-modal-tab:hover {
    background: rgba(139, 148, 158, 0.08);
    color: var(--text-primary);
}

.git-modal-tab.active {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-primary);
}

.git-modal-changes-count {
    padding: 2px 7px;
    background: var(--accent-red);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Git Modal Body */
.git-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-elevated);
}

.git-modal-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
}

.git-modal-panel.active {
    display: flex;
}

/* Git Modal Filters */
.git-modal-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(139, 148, 158, 0.1);
}

.git-modal-search {
    display: flex;
    align-items: center;
    background: rgba(139, 148, 158, 0.06);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 6px;
    padding: 0 12px;
    flex: 1;
    max-width: 360px;
    transition: all 0.15s ease;
}

.git-modal-search:focus-within {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.05);
}

.git-modal-search-icon {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 8px;
}

.git-modal-search input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 0;
    outline: none;
    width: 100%;
}

.git-modal-search input::placeholder {
    color: var(--text-muted);
}

.git-modal-filters select {
    padding: 9px 30px 9px 12px;
    background: rgba(139, 148, 158, 0.06);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236e7681' d='M0 3l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.15s ease;
}

.git-modal-filters select:hover {
    border-color: rgba(139, 148, 158, 0.3);
    color: var(--text-primary);
}

/* Git Modal Icon Buttons */
.git-modal-icon-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-icon-btn:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

/* Git Selection Count */
.git-selection-count {
    padding: 4px 10px;
    background: rgba(88, 166, 255, 0.12);
    color: var(--accent-blue);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Git Modal Commits Header */
.git-modal-commits-header {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    gap: 14px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 8px;
}

.git-modal-commit-header-dot {
    width: 8px;
    flex-shrink: 0;
}

.git-modal-commit-header-hash {
    min-width: 60px;
    flex-shrink: 0;
}

.git-modal-commit-header-message {
    flex: 1;
    min-width: 0;
}

.git-modal-commit-header-author {
    min-width: 100px;
    white-space: nowrap;
}

.git-modal-commit-header-date {
    min-width: 120px;
    text-align: right;
}

/* Git Modal Commits List */
.git-modal-commits-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background: var(--bg-elevated);
}

.git-modal-commit-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    margin: 0 8px;
    border-radius: 6px;
}

.git-modal-commit-item:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-modal-commit-item.selected {
    background: rgba(88, 166, 255, 0.08);
    border-left-color: var(--accent-blue);
}

.git-modal-commit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.git-modal-commit-dot.merge {
    background: var(--accent-blue);
}

.git-modal-commit-dot.initial {
    background: var(--accent-green);
}

.git-modal-commit-message {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.git-modal-commit-branch {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(63, 185, 80, 0.12);
    color: var(--accent-green);
    border-radius: 4px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.git-modal-commit-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
    min-width: 100px;
}

.git-modal-commit-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 120px;
    text-align: right;
}

.git-modal-commit-hash {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--accent-blue);
    flex-shrink: 0;
    min-width: 60px;
}

/* Checkbox removed - selection via click/shift+click/cmd+click */

.git-modal-commit-item .git-modal-commit-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.git-modal-commit-item:hover .git-modal-commit-actions {
    opacity: 1;
}

.git-modal-action-btn-sm {
    padding: 5px 8px;
    background: transparent;
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-action-btn-sm:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
    color: var(--text-primary);
}

.git-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-secondary);
}

.git-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-secondary);
}

.git-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--accent-red);
}

.git-diff-view {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.git-diff-view h3 {
    margin: 0;
    padding: 16px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--code-bg);
    border-bottom: 1px solid var(--bg-surface);
    flex-shrink: 0;
}

.git-diff-content,
pre.git-diff-content {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    background: var(--code-bg) !important;
    padding: 12px 18px;
    margin: 0;
    overflow: auto;
    flex: 1;
    color: var(--text-primary);
    border-radius: 6px;
    white-space: pre;
}

.git-diff-content pre {
    margin: 0;
    padding: 12px 18px;
    white-space: pre;
    min-width: fit-content;
    background: var(--code-bg) !important;
}

/* Diff line styling */
.diff-line {
    display: block;
    padding: 2px 16px;
    margin: 0;
    min-height: 1.4em;
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    transition: background 0.1s ease;
}

.diff-line:hover {
    background: rgba(255, 255, 255, 0.02);
}

.diff-line.diff-context {
    color: var(--text-secondary);
}

.diff-line.diff-added {
    background: rgba(35, 134, 54, 0.15);
    color: var(--accent-green);
    border-left: 2px solid rgba(35, 134, 54, 0.5);
    padding-left: 14px;
}

.diff-line.diff-added:hover {
    background: rgba(35, 134, 54, 0.2);
}

.diff-line.diff-deleted {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
    border-left: 2px solid rgba(248, 81, 73, 0.5);
    padding-left: 14px;
}

.diff-line.diff-deleted:hover {
    background: rgba(248, 81, 73, 0.2);
}

.diff-line.diff-header {
    background: rgba(88, 166, 255, 0.08);
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 8px 16px;
    margin-top: 16px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.diff-line.diff-header:first-child {
    margin-top: 0;
}

.diff-line.diff-hunk-header {
    background: rgba(139, 148, 158, 0.08);
    color: var(--text-secondary);
    padding: 6px 16px;
    margin: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    border-left: 2px solid rgba(167, 139, 250, 0.3);
}

/* Git Changes Panel */
.git-changes-section {
    margin-bottom: 8px;
}

.git-changes-section-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px 20px 8px;
}

.git-change-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 8px;
    border-radius: 6px;
}

.git-change-item:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-change-status {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.git-change-item.staged .git-change-status {
    color: var(--code-string);
}

.git-change-item.unstaged .git-change-status {
    color: var(--accent-blue);
}

.git-change-item.untracked .git-change-status {
    color: var(--code-string);
}

/* File status colors by type */
.git-change-item .git-change-status.added,
.git-change-item.added .git-change-status {
    color: var(--code-string);
}

.git-change-item .git-change-status.modified,
.git-change-item.modified .git-change-status {
    color: var(--accent-blue);
}

.git-change-item .git-change-status.deleted,
.git-change-item.deleted .git-change-status {
    color: var(--accent-red);
}

.git-change-item .git-change-status.renamed,
.git-change-item.renamed .git-change-status {
    color: var(--code-keyword);
}

/* File name colors by status */
.git-change-item.added .git-change-name {
    color: var(--code-string);
}

.git-change-item.modified .git-change-name {
    color: var(--accent-blue);
}

.git-change-item.deleted .git-change-name {
    color: var(--accent-red);
    text-decoration: line-through;
}

.git-change-item.renamed .git-change-name {
    color: var(--code-keyword);
}

/* File-by-file diff blocks */
.git-file-diff-block {
    margin: 0 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-base);
}

.git-file-diff-block.added {
    border-color: rgba(var(--accent-green-rgb, 34, 197, 94), 0.3);
}

.git-file-diff-block.modified {
    border-color: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.3);
}

.git-file-diff-block.deleted {
    border-color: rgba(var(--accent-red-rgb, 248, 81, 73), 0.3);
}

/* File diff header */
.git-file-diff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.git-file-diff-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.git-file-diff-status {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.git-file-diff-status.added {
    background: rgba(var(--accent-green-rgb, 34, 197, 94), 0.15);
    color: var(--accent-green);
}

.git-file-diff-status.modified {
    background: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.15);
    color: var(--accent-blue);
}

.git-file-diff-status.deleted {
    background: rgba(var(--accent-red-rgb, 248, 81, 73), 0.15);
    color: var(--accent-red);
}

.git-file-diff-path {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-file-diff-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-muted);
    flex-shrink: 0;
}

.git-file-diff-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Diff content area */
.git-file-diff-content {
    max-height: 300px;
    overflow-y: auto;
}

.git-inline-diff-content {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    line-height: 1.6;
}

.git-inline-diff-line {
    padding: 2px 14px;
    white-space: pre;
    border-left: 3px solid transparent;
}

.git-inline-diff-line.diff-added {
    background: rgba(var(--accent-green-rgb, 34, 197, 94), 0.12);
    color: var(--accent-green);
    border-left-color: var(--accent-green);
}

.git-inline-diff-line.diff-deleted {
    background: rgba(var(--accent-red-rgb, 248, 81, 73), 0.12);
    color: var(--accent-red);
    border-left-color: var(--accent-red);
}

.git-inline-diff-line.diff-hunk {
    color: var(--accent-blue);
    background: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.08);
    font-weight: 500;
    padding-top: 6px;
    padding-bottom: 6px;
    border-left-color: var(--accent-blue);
}

.git-inline-diff-line.diff-context {
    color: var(--text-muted);
}

.git-diff-empty,
.git-diff-error,
.git-diff-untracked {
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.git-diff-error {
    color: var(--accent-red);
}

.git-diff-untracked {
    color: var(--accent-green);
}

.git-change-item.untracked .git-change-name {
    color: var(--code-string);
}

.git-change-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-change-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.git-change-item:hover .git-change-actions {
    opacity: 1;
}

.git-modal-changes-simple {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.git-modal-files-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Current Branch Info Box */
.git-current-branch-info {
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid rgba(139, 148, 158, 0.1);
}

.git-current-branch-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.git-current-branch-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.git-current-branch-name .git-branch-icon {
    color: var(--accent-blue);
    font-size: 0.6rem;
}

.git-branch-tracking {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
    font-family: var(--font-mono, monospace);
}

/* Detached HEAD state */
.git-current-branch-info.git-detached-head {
    border-left: 3px solid var(--accent-yellow);
    padding-left: 17px;
    background: rgba(210, 153, 34, 0.04);
}

.git-detached-head .git-current-branch-label {
    color: var(--accent-yellow);
}

.git-detached-head .git-branch-icon {
    color: var(--accent-yellow);
}

.git-detached-hint {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Detached HEAD warning banner */
.git-detached-head-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.3);
    border-radius: 6px;
    color: var(--accent-yellow);
    font-size: 0.8rem;
    font-weight: 500;
}

.git-detached-head-warning .git-detached-icon {
    font-size: 1rem;
}

.git-branch-no-upstream {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
}

.git-current-branch-sync {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 148, 158, 0.08);
}

.git-sync-ahead {
    font-size: 0.8rem;
    color: var(--code-string);
}

.git-sync-behind {
    font-size: 0.8rem;
    color: #f78c6c;
}

.git-branch-current-tag {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: lowercase;
    padding: 2px 8px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    border-radius: 4px;
    margin-left: auto;
}

.git-branch-ahead {
    font-size: 0.7rem;
    color: var(--accent-green);
    padding: 2px 6px;
    background: rgba(63, 185, 80, 0.1);
    border-radius: 4px;
}

.git-branch-behind {
    font-size: 0.7rem;
    color: var(--accent-red);
    padding: 2px 6px;
    background: rgba(248, 81, 73, 0.1);
    border-radius: 4px;
}

.git-modal-load-more {
    display: block;
    width: calc(100% - 40px);
    margin: 16px 20px;
    padding: 12px;
    background: rgba(139, 148, 158, 0.06);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-load-more:hover {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.25);
}

/* Git Modal Branches List */
.git-modal-branches-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.git-modal-branches-section {
    margin-bottom: 0;
}

.git-modal-branches-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.git-modal-branches-section-title .section-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

.git-modal-branch-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 8px;
    border-radius: 6px;
    border-left: 2px solid transparent;
}

.git-modal-branch-item:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-modal-branch-item.current {
    background: transparent;
    border-left-color: var(--accent-blue);
}

.git-modal-branch-item.current:hover {
    background: rgba(139, 148, 158, 0.06);
}

.git-modal-branch-item.remote {
    opacity: 0.75;
}

.git-modal-branch-item.remote:hover {
    opacity: 1;
}

.git-modal-branch-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.git-modal-branch-item.current .git-modal-branch-indicator {
    background: var(--accent-blue);
}

.git-modal-branch-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.git-modal-branch-item.current .git-modal-branch-name {
    font-weight: 500;
    color: var(--accent-blue);
}

.git-modal-branch-item .git-branch-current-tag {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: lowercase;
    padding: 2px 8px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    border-radius: 4px;
}

.git-modal-branch-item .git-branch-ahead {
    font-size: 0.7rem;
    color: var(--accent-green);
    padding: 2px 6px;
    background: rgba(63, 185, 80, 0.1);
    border-radius: 4px;
}

.git-modal-branch-item .git-branch-behind {
    font-size: 0.7rem;
    color: var(--accent-red);
    padding: 2px 6px;
    background: rgba(248, 81, 73, 0.1);
    border-radius: 4px;
}

.git-modal-branch-upstream {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

.git-modal-branch-current-tag {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--accent-blue);
    padding: 2px 8px;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 4px;
}

/* Git Modal Changes */
.git-modal-changes-sections {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.git-modal-changes-section {
    background: rgba(139, 148, 158, 0.03);
    border: 1px solid rgba(139, 148, 158, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.git-modal-changes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.git-modal-staged-list,
.git-modal-unstaged-list {
    max-height: 200px;
    overflow-y: auto;
}

.git-modal-change-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    transition: background 0.15s ease;
}

.git-modal-change-item:hover {
    background: var(--sidebar-hover, rgba(255, 255, 255, 0.03));
}

.git-modal-change-status {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.git-modal-change-status.modified {
    background: rgba(147, 181, 255, 0.15);
    color: var(--accent-blue);
}

.git-modal-change-status.added {
    background: rgba(195, 232, 141, 0.2);
    color: var(--code-string);
}

.git-modal-change-status.deleted {
    background: rgba(255, 85, 85, 0.2);
    color: var(--accent-red);
}

.git-modal-change-status.untracked {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.git-modal-change-path {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
}

/* Git Modal Commit Hint */
.git-commit-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.git-commit-hint .hint-staged {
    color: var(--text-muted);
}

.git-commit-hint .hint-staged.has-files {
    color: var(--accent-green);
    font-weight: 500;
}

.git-commit-hint .hint-unstaged {
    color: var(--text-muted);
}

.git-commit-hint .hint-unstaged.has-files {
    color: var(--accent-orange, #d29922);
}

.git-commit-hint .hint-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Git Modal Commit Form */
.git-modal-commit-form {
    padding: 16px 20px;
    border-top: 1px solid rgba(139, 148, 158, 0.1);
    background: rgba(13, 17, 23, 0.5);
}

.git-modal-commit-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(139, 148, 158, 0.04);
    border: 1px solid rgba(139, 148, 158, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    transition: all 0.15s ease;
}

.git-modal-commit-form textarea:focus {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.04);
    outline: none;
}

.git-modal-commit-form textarea::placeholder {
    color: var(--text-muted);
}

.git-modal-commit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.git-modal-commit-actions .git-modal-action-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.git-modal-commit-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.git-modal-commit-option input {
    accent-color: var(--link-color, var(--accent-blue));
}

/* Git Modal Simplified Changes */
.git-modal-section {
    margin-bottom: 12px;
}

.git-modal-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
}

.git-modal-file-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-modal-file-btn:hover {
    background: var(--bg-surface);
    border-color: var(--text-secondary);
}

.git-modal-change-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.git-modal-change-item:hover .git-modal-change-actions {
    opacity: 1;
}

.git-modal-changes-simple {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.git-modal-files-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0;
}

.git-modal-file-item {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--bg-surface);
    transition: background 0.15s ease;
}

.git-modal-file-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.git-modal-file-header:hover {
    background: var(--sidebar-hover, rgba(255, 255, 255, 0.03));
}

.git-modal-file-item.staged .git-modal-file-header {
    background: rgba(195, 232, 141, 0.05);
}

.git-modal-file-expand {
    width: 16px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.git-modal-file-diff {
    background: var(--bg-base);
    border-top: 1px solid var(--bg-surface);
    max-height: 300px;
    overflow-y: auto;
}

.git-modal-file-diff .diff-content {
    margin: 0;
    padding: 8px 0;
}

.git-modal-file-diff .diff-line {
    padding: 1px 20px 1px 36px;
    font-size: 0.75rem;
    line-height: 1.5;
}

.git-diff-loading,
.git-diff-error {
    padding: 16px 20px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 0.8rem;
    text-align: center;
}

.git-diff-error {
    color: var(--accent-red);
}

.git-modal-file-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.git-modal-file-status.modified {
    background: rgba(147, 181, 255, 0.15);
    color: var(--accent-blue);
}

.git-modal-file-status.added {
    background: rgba(195, 232, 141, 0.2);
    color: var(--code-string);
}

.git-modal-file-status.deleted {
    background: rgba(255, 85, 85, 0.2);
    color: var(--accent-red);
}

.git-modal-file-status.untracked {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
}

.git-modal-file-item.staged .git-modal-file-status {
    background: rgba(195, 232, 141, 0.2);
    color: var(--code-string);
}

.git-modal-file-path {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-modal-file-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: auto;
}

.git-modal-file-header:hover .git-modal-file-actions {
    opacity: 1;
}

/* Git Modal Commit Form Simplified - uses same styles as above */

/* Git Header Branch */
.git-header-branch {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-blue);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Git Header Badge */
.git-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--link-color, var(--accent-blue));
    color: #ffffff;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.git-header-badge:empty {
    display: none;
}

/* Empty states */
.git-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.git-modal-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.git-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==========================================
   Small modal for commit actions like edit message, reset, etc.
   ========================================== */

.git-action-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.git-action-modal.visible {
    display: flex;
}

.git-action-modal-content {
    width: 96%;
    height: 94%;
    max-width: none;
    max-height: none;
    overflow: hidden;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 12px;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
    animation: gitActionModalSlideIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes gitActionModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.git-action-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.15s;
    border-radius: 8px;
    z-index: 10;
}

.git-action-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-color: var(--border-default);
}

.git-action-modal-content h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-base);
    border-bottom: 1px solid var(--bg-surface);
    flex-shrink: 0;
}

.git-action-modal-content > div {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
}

.git-action-modal-content .git-diff-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--bg-elevated);
}

.git-action-modal-content .git-diff-view h3 {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--bg-surface);
    margin: 0;
    padding-right: 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.git-action-modal-content p {
    margin: 0 0 14px 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--sidebar-active, var(--text-secondary));
}

.git-action-modal-content p.warning {
    color: var(--warning-color, var(--accent-yellow));
}

.git-action-modal-content .editor-modal-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: "SF Mono", "Monaco", "Menlo", "Consolas", monospace;
    line-height: 1.5;
    outline: none;
    margin-bottom: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    resize: vertical;
    min-height: 200px;
}

.git-action-modal-content .editor-modal-textarea:focus {
    border-color: var(--link-color, var(--accent-blue));
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.git-action-modal-content .editor-modal-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    resize: vertical;
}

.git-action-modal-content .editor-modal-input:focus {
    border-color: var(--link-color, var(--accent-blue));
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.git-action-modal-content .editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.git-action-modal-content .editor-modal-options {
    margin-bottom: 14px;
}

.git-action-modal-content .editor-modal-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-base);
    margin-bottom: 6px;
    transition: background 0.15s;
}

.git-action-modal-content .editor-modal-options label:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================
   File Action Modal (inside editor-container)
   Small modal for file operations like rename, delete, etc.
   ========================================== */

.file-action-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.file-action-modal.visible {
    display: flex;
}

.file-action-modal-content {
    width: 90%;
    max-width: 380px;
    max-height: 80%;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-surface);
    border-radius: 10px;
    padding: 20px 24px;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: fileActionModalSlideIn 0.15s ease-out;
}

@keyframes fileActionModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.file-action-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s;
    border-radius: 4px;
}

.file-action-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.file-action-modal-content h3 {
    margin: 0 0 12px 0;
    padding-right: 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.file-action-modal-content p {
    margin: 0 0 14px 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--sidebar-active, var(--text-secondary));
}

.file-action-modal-content p.warning {
    color: var(--warning-color, var(--accent-yellow));
}

.file-action-modal-content .editor-modal-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.file-action-modal-content .editor-modal-input:focus {
    border-color: var(--link-color, var(--accent-blue));
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.file-action-modal-content .editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* Git Action Modal - File lists and details */
.git-action-modal-content .git-commit-details {
    margin-bottom: 14px;
    padding: 12px;
    background: var(--bg-base);
    border-radius: 6px;
}

.git-action-modal-content .git-commit-details p {
    margin: 0 0 6px 0;
    font-size: 0.8rem;
}

.git-action-modal-content .git-commit-details p:last-child {
    margin-bottom: 0;
}

.git-action-modal-content .git-files-list {
    background: var(--bg-base);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 14px;
}

.git-action-modal-content .git-files-list .git-change-item {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
}

.git-action-modal-content .git-files-list .git-change-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.git-action-modal-content .git-diff-viewer {
    background: var(--bg-primary, var(--bg-base));
    border-radius: 0;
    margin-bottom: 0;
    flex: 1;
    overflow: auto;
}

.git-action-modal-content .git-diff-viewer pre {
    margin: 0;
    padding: 16px 24px;
    font-size: 0.85rem;
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    line-height: 1.6;
    white-space: pre;
    color: var(--text-primary, var(--text-primary));
    min-width: fit-content;
    background: var(--code-bg) !important;
}

.git-action-modal-content .git-diff-content {
    flex: 1;
    overflow: auto;
    background: var(--code-bg);
}

.git-action-modal-content .git-diff-content pre {
    margin: 0;
    padding: 16px 24px;
    font-size: 0.85rem;
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    line-height: 1.6;
    white-space: pre;
    min-width: fit-content;
    background: var(--code-bg) !important;
}

/* ==========================================
   Diff Syntax Highlighting (Global)
   ========================================== */

.diff-content {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.diff-line {
    display: block;
    padding: 3px 20px;
    white-space: pre;
    min-height: 1.6em;
    transition: background 0.1s ease;
}

.diff-line:hover {
    background: rgba(255, 255, 255, 0.04);
}

.diff-added,
.diff-line.diff-added {
    background: rgba(74, 222, 128, 0.06);
    color: rgba(134, 239, 172, 0.9);
    border-left: 2px solid rgba(74, 222, 128, 0.4);
    padding-left: 18px;
}

.diff-added:hover,
.diff-line.diff-added:hover {
    background: rgba(74, 222, 128, 0.1);
}

.diff-deleted,
.diff-line.diff-deleted {
    background: rgba(248, 113, 113, 0.06);
    color: rgba(252, 165, 165, 0.9);
    border-left: 2px solid rgba(248, 113, 113, 0.4);
    padding-left: 18px;
}

.diff-deleted:hover,
.diff-line.diff-deleted:hover {
    background: rgba(248, 113, 113, 0.1);
}

.diff-header,
.diff-file-header,
.diff-line.diff-header {
    background: rgba(99, 148, 255, 0.04);
    color: rgba(147, 177, 255, 0.8);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 10px 20px;
    margin-top: 20px;
    border-radius: 6px;
    border-left: none;
    letter-spacing: 0.3px;
}

.diff-line.diff-header:first-child {
    margin-top: 0;
}

.diff-hunk-header,
.diff-line.diff-hunk-header {
    background: rgba(167, 139, 250, 0.05);
    color: rgba(196, 181, 253, 0.85);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 8px 20px;
    margin: 12px 0;
    border-radius: 6px;
    border-left: 2px solid rgba(167, 139, 250, 0.3);
}

.diff-meta {
    color: var(--text-muted, var(--text-muted));
    font-size: 0.8rem;
}

.diff-context {
    color: var(--text-secondary);
}

/* ==========================================
   Commit Multi-Select Checkbox
   ========================================== */

.git-commit-checkbox {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color, var(--accent-blue));
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.git-commit-item:hover .git-commit-checkbox,
.git-commit-item.selected .git-commit-checkbox {
    opacity: 1;
}

.git-commit-checkbox:checked {
    opacity: 1;
}

/* Commit selection indicator */
#gitCommitSelectionCount,
#gitModalCommitSelectionCount {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: var(--primary-color, var(--accent-blue));
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Enhanced selected state for commits */
.git-commit-item.selected {
    background: rgba(59, 130, 246, 0.15);
    border-left: 2px solid var(--primary-color, var(--accent-blue));
}

.git-modal-commit-item.selected {
    background: rgba(59, 130, 246, 0.15);
    border-left: 2px solid var(--primary-color, var(--accent-blue));
}

/* ==========================================
   Git Modal Commit Checkbox
   ========================================== */

.git-modal-commit-item .git-commit-checkbox {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    cursor: pointer;
    accent-color: var(--primary-color, var(--accent-blue));
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.git-modal-commit-item:hover .git-commit-checkbox,
.git-modal-commit-item.selected .git-commit-checkbox {
    opacity: 1;
}

/* ==========================================
   Selection Actions Bar
   ========================================== */

.git-commits-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* git-commits-action-btn styles defined above in main section */

/* Modal action button small variant - styles defined in main git modal section */

/* ==========================================
   Git Patch Actions
   ========================================== */

.git-patch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-top: 1px solid var(--border-color, #333);
    margin-top: 8px;
}

.git-patch-label {
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    margin-right: 4px;
}

.git-patch-actions .editor-btn-sm {
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* ==========================================
   Git Patch Preview
   ========================================== */

.git-patch-preview {
    max-height: 60vh;
    overflow-y: auto;
}

.patch-stat-summary {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin-bottom: 12px;
}

.patch-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.patch-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted, #888);
}

.patch-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.patch-stat-value.addition {
    color: var(--accent-green);
}

.patch-stat-value.deletion {
    color: var(--accent-red);
}

.patch-files-list {
    margin-bottom: 12px;
}

.patch-files-list h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-secondary, #aaa);
}

.patch-files-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.patch-files-list li {
    padding: 4px 8px;
    font-size: 0.8rem;
    color: var(--text-primary, #e0e0e0);
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 4px;
    margin-bottom: 4px;
    font-family: monospace;
}

.patch-content-preview {
    margin-top: 12px;
}

.patch-content-preview h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-secondary, #aaa);
}

.patch-content-preview pre {
    background: var(--code-bg, var(--bg-base));
    padding: 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* ==========================================
   Git Diff Preview
   ========================================== */

.git-diff-preview {
    max-height: 60vh;
    overflow-y: auto;
}

.git-diff-preview pre {
    background: var(--code-bg, var(--bg-base));
    padding: 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================
   Git Commit Preview (for squash/cherry-pick)
   ========================================== */

.git-commit-preview {
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin: 8px 0;
    font-family: monospace;
    font-size: 0.8rem;
}

.git-commit-preview code {
    background: var(--code-bg, var(--bg-base));
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

.git-squash-info {
    margin-bottom: 12px;
}

.git-squash-info p {
    margin-bottom: 8px;
    color: var(--text-secondary, #aaa);
}

/* ==========================================
   Git Commit Details
   ========================================== */

.git-commit-details {
    max-height: 70vh;
    overflow-y: auto;
}

.git-commit-hash-full {
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin-bottom: 12px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Removed duplicate .git-diff-content - using main definition above */

/* ==========================================
   Git History Modal (Modern)
   ========================================== */

.git-history-modal {
    width: 700px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: 12px;
    overflow: hidden;
}

.git-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(
        135deg,
        var(--bg-surface) 0%,
        var(--bg-elevated) 100%
    );
    border-bottom: 1px solid var(--border-default);
}

.git-history-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.git-history-icon {
    font-size: 24px;
}

.git-history-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.git-history-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.git-history-path {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

.git-history-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.git-history-count {
    padding: 4px 10px;
    background: var(--accent-green);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.git-history-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.git-history-close:hover {
    background: var(--border-default);
    color: var(--text-primary);
}

.git-history-search {
    padding: 12px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
}

.git-history-search input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.git-history-search input:focus {
    border-color: var(--accent-blue);
}

.git-history-search input::placeholder {
    color: var(--text-muted);
}

.git-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px;
}

.git-history-date-group {
    margin-bottom: 20px;
}

.git-history-date-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--bg-surface);
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 1;
}

.git-history-date-commits {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.git-history-commit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.git-history-commit:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.git-history-commit-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.git-history-commit-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.git-history-commit-hash {
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.git-history-commit-hash:hover {
    background: rgba(88, 166, 255, 0.2);
}

.git-history-commit-message {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-history-commit-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.git-history-commit-author {
    color: #7ee787;
    font-weight: 500;
}

.git-history-commit-time {
    color: var(--text-muted);
}

.git-history-commit-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.git-history-commit:hover .git-history-commit-actions {
    opacity: 1;
}

.git-history-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.git-history-action-btn:hover {
    background: var(--border-default);
    border-color: var(--text-secondary);
    transform: scale(1.1);
}

.git-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-secondary);
}

.git-history-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: git-history-spin 0.8s linear infinite;
}

@keyframes git-history-spin {
    to {
        transform: rotate(360deg);
    }
}

.git-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--text-secondary);
}

.git-history-empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Scrollbar styling for git history */
.git-history-list::-webkit-scrollbar {
    width: 8px;
}

.git-history-list::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

.git-history-list::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}

.git-history-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-default);
}

/* ==========================================
   Git File History (Legacy)
   ========================================== */

.git-file-history {
    max-height: 70vh;
    overflow-y: auto;
}

.git-file-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin-bottom: 12px;
}

.git-file-history-path {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-primary, var(--accent-blue));
}

.git-file-history-count {
    font-size: 0.75rem;
    color: var(--text-secondary, var(--text-secondary));
}

.git-file-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.git-file-history-item {
    padding: 10px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.git-file-history-item:hover {
    background: var(--sidebar-hover, #2a2a2a);
}

.git-file-history-commit {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
}

.git-file-history-hash {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-secondary, #f472b6);
    flex-shrink: 0;
}

.git-file-history-message {
    font-size: 0.85rem;
    color: var(--text-primary, #e5e7eb);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-file-history-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary, var(--text-secondary));
}

.git-file-history-author {
    color: var(--accent-primary, var(--accent-blue));
}

/* ==========================================
   Git Blame
   ========================================== */

.git-blame {
    max-height: 70vh;
    overflow: auto;
}

.git-blame-header {
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin-bottom: 12px;
}

.git-blame-path {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-primary, var(--accent-blue));
}

.git-blame-content {
    overflow: auto;
}

.git-blame-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.git-blame-line {
    border-bottom: 1px solid var(--bg-surface);
}

.git-blame-line:hover {
    background: var(--sidebar-hover, #2a2a2a);
}

.git-blame-info {
    padding: 4px 8px;
    white-space: nowrap;
    vertical-align: top;
    background: var(--sidebar-bg, var(--bg-base));
    min-width: 180px;
}

.git-blame-hash {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-secondary, #f472b6);
    margin-right: 8px;
}

.git-blame-author {
    font-size: 0.75rem;
    color: var(--text-secondary, var(--text-secondary));
}

.git-blame-lineno {
    padding: 4px 8px;
    text-align: right;
    color: var(--text-secondary, var(--text-secondary));
    user-select: none;
    min-width: 40px;
    background: var(--code-bg, var(--bg-base));
}

.git-blame-code {
    padding: 4px 8px;
    font-family: monospace;
    white-space: pre;
    background: var(--code-bg, var(--bg-base));
}

.git-blame-code pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* ==========================================
   Git Diff View
   ========================================== */

.git-diff-view {
    max-height: 70vh;
    overflow: auto;
}

.git-diff-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    background: var(--sidebar-bg, var(--bg-base));
    border-radius: 6px;
    margin-bottom: 12px;
}

.git-diff-path {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-primary, var(--accent-blue));
}

.git-diff-label {
    font-size: 0.75rem;
    color: var(--text-secondary, var(--text-secondary));
}

.git-diff-raw {
    background: var(--code-bg, var(--bg-base));
    padding: 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: monospace;
}

/* ==========================================
   New File/Folder Highlight Animation
   ========================================== */

.editor-tree-folder.highlight-new,
.editor-tree-file.highlight-new {
    animation: highlightNew 2s ease-out;
}

@keyframes highlightNew {
    0% {
        background: rgba(74, 222, 128, 0.3);
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
    }
    50% {
        background: rgba(74, 222, 128, 0.15);
    }
    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* ==========================================
   Git Stash Panel Styles
   ========================================== */

.git-modal-stash-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.git-stash-item {
    background: rgba(139, 148, 158, 0.04);
    border: 1px solid rgba(139, 148, 158, 0.1);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.15s ease;
}

.git-stash-item:hover {
    border-color: rgba(139, 148, 158, 0.2);
    background: rgba(139, 148, 158, 0.06);
}

.git-stash-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.git-stash-index {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: rgba(163, 113, 247, 0.1);
    padding: 4px 10px;
    border-radius: 5px;
}

.git-stash-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-stash-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.git-stash-branch {
    color: var(--accent-blue);
}

.git-stash-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.git-stash-actions .git-modal-action-btn-sm {
    font-size: 0.75rem;
    padding: 6px 12px;
}

/* Stash Changes Summary */
.git-stash-changes-summary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.git-stash-changes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.git-stash-changes-icon {
    font-size: 1.1rem;
}

.git-stash-changes-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.git-stash-changes-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.git-stash-stat {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.git-stash-stat.staged {
    background: rgba(var(--accent-green-rgb, 34, 197, 94), 0.15);
    color: var(--accent-green);
}

.git-stash-stat.unstaged {
    background: rgba(var(--accent-blue-rgb, 59, 130, 246), 0.15);
    color: var(--accent-blue);
}

.git-stash-stat.untracked {
    background: rgba(var(--accent-yellow-rgb, 234, 179, 8), 0.15);
    color: var(--accent-yellow);
}

.git-stash-changes-files {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--bg-base);
    border-radius: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.git-stash-file-item {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-stash-file-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 4px;
}

.git-stash-quick-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.git-stash-quick-btn:hover {
    background: var(--accent-blue-hover, #4a8fe7);
    transform: translateY(-1px);
}

.git-stash-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.git-stash-empty-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
    font-style: italic;
}

.git-stash-actions .git-modal-action-btn-sm.danger {
    color: var(--accent-red);
}

.git-stash-actions .git-modal-action-btn-sm.danger:hover {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
}

/* ==========================================
   Git Patch Panel Styles
   ========================================== */

.git-patch-section {
    padding: 20px;
    border-bottom: 1px solid var(--bg-surface);
}

.git-patch-section:last-child {
    border-bottom: none;
}

.git-patch-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.git-patch-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.git-patch-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.git-patch-option {
    display: flex;
    align-items: center;
    gap: 16px;
}

.git-patch-option .git-modal-action-btn {
    min-width: 180px;
}

.git-patch-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.git-patch-preview {
    padding: 16px;
}

.git-patch-preview h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.git-patch-result {
    padding: 20px;
    text-align: center;
}

.git-patch-result h3 {
    font-size: 1.2rem;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.git-patch-result p {
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.git-patch-stats,
.git-error-content {
    background: var(--bg-base);
    padding: 12px;
    border-radius: 6px;
    font-family: "SF Mono", Monaco, monospace;
    font-size: 0.8rem;
    text-align: left;
    margin: 16px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.git-error-content {
    color: var(--accent-red);
    border: 1px solid rgba(255, 83, 112, 0.3);
}

/* Squash modal styles */
.git-squash-info {
    background: var(--sidebar-bg, var(--bg-elevated));
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.git-squash-info p {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.git-commits-preview {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 0.85rem;
}

.git-commits-preview li {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.git-commits-preview code {
    font-family: "SF Mono", Monaco, monospace;
    color: var(--code-keyword);
    background: rgba(199, 146, 234, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Textarea in modals */
.editor-modal-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-base);
    border: 1px solid var(--bg-surface);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: "SF Mono", Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

.editor-modal-textarea:focus {
    outline: none;
    border-color: var(--accent-primary, var(--accent-blue));
}

.editor-modal-textarea::placeholder {
    color: var(--text-secondary);
}

/* Empty state improvements */
.git-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.git-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.git-empty p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.git-empty-hint {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Patch action buttons in preview */
.git-patch-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bg-surface);
}

/* Modal danger button */
.git-modal-action-btn.danger {
    color: var(--accent-red);
    border-color: rgba(255, 83, 112, 0.3);
}

.git-modal-action-btn.danger:hover {
    background: rgba(255, 83, 112, 0.15);
    border-color: var(--accent-red);
}

/* Files view in commit details */
.git-files-view {
    padding: 16px;
}

.git-files-view h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.git-files-view p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.git-files-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--sidebar-bg, var(--bg-elevated));
    border-radius: 6px;
    border: 1px solid var(--bg-surface);
}

.git-files-list .git-change-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--bg-surface);
}

.git-files-list .git-change-item:last-child {
    border-bottom: none;
}

/* ============================================
   File Tree Git Modal (Standalone)
   Separate from main git modal for file tree actions
   ============================================ */

.file-tree-git-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 10, 14, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Higher than git modal (9999) */
    backdrop-filter: blur(12px);
}

.file-tree-git-modal-overlay.visible {
    display: flex;
}

.file-tree-git-modal-container {
    width: 90%;
    height: 85%;
    max-width: 1200px;
    max-height: 800px;
    overflow: hidden;
    background: var(--modal-panel-bg);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: fileTreeGitModalSlideIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

/* Compact modal for simple forms (patch check/apply, etc.) */
.file-tree-git-modal-container.compact {
    width: auto;
    height: auto;
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
}

.file-tree-git-modal-container.compact .file-tree-git-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
}

.file-tree-git-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.file-tree-git-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.file-tree-git-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-tree-git-modal-close:hover {
    background: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

@keyframes fileTreeGitModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.file-tree-git-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--modal-panel-bg);
}

/* Git History Modal inside file tree git modal */
.file-tree-git-modal-body .git-history-modal {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    background: var(--modal-panel-bg);
    overflow: hidden;
}

/* Git history list scrollable */
.file-tree-git-modal-body .git-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Git history search */
.file-tree-git-modal-body .git-history-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-surface);
    background: var(--modal-panel-bg);
}

.file-tree-git-modal-body .git-history-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.file-tree-git-modal-body .git-history-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.file-tree-git-modal-body .git-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--bg-surface);
    background: var(--modal-panel-bg);
}

/* Hide duplicate close button when inside file-tree-git-modal */
.file-tree-git-modal-body .git-history-header .git-history-close {
    display: none;
}

/* Diff view inside file tree git modal */
.file-tree-git-modal-body .git-diff-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--modal-panel-bg);
    padding: 20px;
}

.file-tree-git-modal-body .git-diff-view h3 {
    margin: 0 0 16px 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border-bottom: none;
    flex-shrink: 0;
}

.file-tree-git-modal-body .git-diff-content,
.file-tree-git-modal-body pre.git-diff-content {
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    background: var(--bg-base) !important;
    padding: 16px;
    margin: 0;
    overflow: auto;
    flex: 1;
    color: var(--text-primary);
    border-radius: 8px;
    white-space: pre;
    border: 1px solid var(--border-default);
}

.file-tree-git-modal-body .git-diff-content pre {
    margin: 0;
    padding: 0;
    white-space: pre;
    min-width: fit-content;
    background: transparent !important;
}

.file-tree-git-modal-body .diff-line {
    display: flex;
    align-items: stretch;
    padding: 0;
    margin: 0;
    min-height: 1.6em;
    border-left: 3px solid transparent;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.8rem;
}

.file-tree-git-modal-body .diff-line-num {
    display: inline-block;
    min-width: 40px;
    padding: 2px 8px;
    text-align: right;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.1);
    user-select: none;
    font-size: 0.7rem;
    border-right: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-line-content {
    flex: 1;
    padding: 2px 12px;
    white-space: pre;
}

.file-tree-git-modal-body .diff-added {
    background: rgba(46, 160, 67, 0.22);
    border-left-color: #3fb950;
}

.file-tree-git-modal-body .diff-added .diff-line-content {
    color: #e2f7e8;
}

.file-tree-git-modal-body .diff-added .diff-line-num {
    background: rgba(46, 160, 67, 0.32);
    color: #e2f7e8;
}

.file-tree-git-modal-body .diff-deleted {
    background: rgba(248, 81, 73, 0.2);
    border-left-color: #f85149;
}

.file-tree-git-modal-body .diff-deleted .diff-line-content {
    color: #fbe5e5;
}

.file-tree-git-modal-body .diff-deleted .diff-line-num {
    background: rgba(248, 81, 73, 0.3);
    color: #fbe5e5;
}

.file-tree-git-modal-body .diff-hunk-header {
    background: rgba(56, 139, 253, 0.1);
    border-left-color: #58a6ff;
    margin-top: 8px;
}

.file-tree-git-modal-body .diff-hunk-header .diff-line-num {
    background: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
}

.file-tree-git-modal-body .diff-hunk-header .diff-line-content {
    color: #58a6ff;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 12px;
}

.file-tree-git-modal-body .diff-context {
    color: var(--text-secondary);
}

.file-tree-git-modal-body .diff-context .diff-line-num {
    color: var(--text-tertiary);
}

.file-tree-git-modal-body .diff-empty {
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px;
    text-align: center;
}

/* Git history subheader */
.file-tree-git-modal-body .git-history-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-tree-git-modal-body .git-history-subheader .git-history-path {
    color: var(--text-tertiary);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
}

.file-tree-git-modal-body .git-history-subheader .git-history-count {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Close button for diff view - HIDDEN since we have modal header close */
.file-tree-git-modal-body .git-diff-close {
    display: none;
}

/* ============================================
   Multi-File Diff View (GitHub/VS Code style)
   ============================================ */

.file-tree-git-modal-body .multi-file-diff {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Commit info header */
.file-tree-git-modal-body .diff-commit-info {
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-commit-message {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tree-git-modal-body .diff-commit-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-tree-git-modal-body .diff-commit-author {
    font-weight: 500;
}

/* Stats bar */
.file-tree-git-modal-body .diff-stats-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-default);
    font-size: 0.75rem;
}

.file-tree-git-modal-body .diff-stats-files {
    color: var(--text-secondary);
}

.file-tree-git-modal-body .diff-stats-additions {
    color: #3fb950;
    font-weight: 600;
}

.file-tree-git-modal-body .diff-stats-deletions {
    color: #f85149;
    font-weight: 600;
}

/* Files list container */
.file-tree-git-modal-body .diff-files-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Individual file diff */
.file-tree-git-modal-body .diff-file {
    margin-bottom: 8px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-base);
}

/* File header (clickable to collapse) */
.file-tree-git-modal-body .diff-file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-surface);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-file-header:hover {
    background: var(--bg-hover);
}

.file-tree-git-modal-body .diff-file-toggle {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    width: 12px;
    flex-shrink: 0;
}

.file-tree-git-modal-body .diff-file-status {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    flex-shrink: 0;
}

.file-tree-git-modal-body .diff-file-status.status-added {
    background: rgba(46, 160, 67, 0.2);
    color: #3fb950;
}

.file-tree-git-modal-body .diff-file-status.status-deleted {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.file-tree-git-modal-body .diff-file-status.status-modified {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
}

.file-tree-git-modal-body .diff-file-status.status-renamed {
    background: rgba(136, 87, 229, 0.2);
    color: #a371f7;
}

.file-tree-git-modal-body .diff-file-path {
    flex: 1;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tree-git-modal-body .diff-file-stats {
    display: flex;
    gap: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.file-tree-git-modal-body .diff-file-additions {
    color: #3fb950;
}

.file-tree-git-modal-body .diff-file-deletions {
    color: #f85149;
}

/* File content (diff hunks) */
.file-tree-git-modal-body .diff-file-content {
    overflow-x: auto;
}

/* Diff hunk */
.file-tree-git-modal-body .diff-hunk {
    border-bottom: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-hunk:last-child {
    border-bottom: none;
}

.file-tree-git-modal-body .diff-hunk .diff-hunk-header {
    padding: 6px 12px;
    background: rgba(56, 139, 253, 0.1);
    color: #58a6ff;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    font-weight: 500;
    border-left: none;
    margin: 0;
    border-radius: 0;
}

.file-tree-git-modal-body .diff-hunk-content {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Diff lines in multi-file view */
.file-tree-git-modal-body .diff-hunk-content .diff-line {
    display: flex;
    min-height: 1.5em;
    border-left: none;
}

.file-tree-git-modal-body .diff-hunk-content .diff-line-num {
    min-width: 40px;
    padding: 0 8px;
    text-align: right;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.15);
    user-select: none;
    font-size: 0.75rem;
    border-right: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-hunk-content .diff-line-num-old {
    border-right: none;
}

.file-tree-git-modal-body .diff-hunk-content .diff-line-num-new {
    border-right: 1px solid var(--border-default);
}

.file-tree-git-modal-body .diff-hunk-content .diff-line-content {
    flex: 1;
    padding: 0 12px;
    white-space: pre;
    overflow-x: visible;
}

/* Line type colors */
.file-tree-git-modal-body .diff-hunk-content .diff-added {
    background: rgba(46, 160, 67, 0.22);
}

.file-tree-git-modal-body .diff-hunk-content .diff-added .diff-line-content {
    color: #e2f7e8;
}

.file-tree-git-modal-body .diff-hunk-content .diff-added .diff-line-num {
    background: rgba(46, 160, 67, 0.32);
    color: #e2f7e8;
}

.file-tree-git-modal-body .diff-hunk-content .diff-deleted {
    background: rgba(248, 81, 73, 0.2);
}

.file-tree-git-modal-body .diff-hunk-content .diff-deleted .diff-line-content {
    color: #fbe5e5;
}

.file-tree-git-modal-body .diff-hunk-content .diff-deleted .diff-line-num {
    background: rgba(248, 81, 73, 0.3);
    color: #fbe5e5;
}

.file-tree-git-modal-body .diff-hunk-content .diff-context .diff-line-content {
    color: var(--text-secondary);
}

/* Binary file indicator */
.file-tree-git-modal-body .diff-binary {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Empty state */
.file-tree-git-modal-body .diff-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    gap: 8px;
}

.file-tree-git-modal-body .diff-empty-state .diff-empty-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Git history commit styles inside modal */
.file-tree-git-modal-body .git-history-date-group {
    margin-bottom: 16px;
}

.file-tree-git-modal-body .git-history-date-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8b949e;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-tree-git-modal-body .git-history-commit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-tree-git-modal-body .git-history-commit:hover {
    background: var(--bg-surface);
    border-color: var(--accent-blue);
}

.file-tree-git-modal-body .git-history-commit-main {
    flex: 1;
    min-width: 0;
}

.file-tree-git-modal-body .git-history-commit-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.file-tree-git-modal-body .git-history-commit-hash {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.file-tree-git-modal-body .git-history-commit-hash:hover {
    background: rgba(88, 166, 255, 0.2);
}

.file-tree-git-modal-body .git-history-commit-message {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tree-git-modal-body .git-history-commit-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.7rem;
    color: #8b949e;
}

.file-tree-git-modal-body .git-history-commit-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.file-tree-git-modal-body
    .git-history-commit:hover
    .git-history-commit-actions {
    opacity: 1;
}

.file-tree-git-modal-body .git-history-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.file-tree-git-modal-body .git-history-action-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

/* Git history title section */
.file-tree-git-modal-body .git-history-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-tree-git-modal-body .git-history-icon {
    font-size: 1.2rem;
}

.file-tree-git-modal-body .git-history-title-text {
    display: flex;
    flex-direction: column;
}

.file-tree-git-modal-body .git-history-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.file-tree-git-modal-body .git-history-path {
    font-size: 0.75rem;
    color: #8b949e;
    font-family: "JetBrains Mono", monospace;
}

.file-tree-git-modal-body .git-history-stats {
    display: flex;
    align-items: center;
}

.file-tree-git-modal-body .git-history-count {
    font-size: 0.75rem;
    color: #8b949e;
    background: var(--bg-surface);
    padding: 4px 10px;
    border-radius: 12px;
}

.file-tree-git-modal-body .git-history-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary);
}

.file-tree-git-modal-body .git-history-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(88, 166, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.file-tree-git-modal-body .git-history-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
    padding: 40px;
}

.file-tree-git-modal-body .git-history-empty-icon {
    font-size: 2.5rem;
}

.file-tree-git-modal-body .git-history-commits {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.file-tree-git-modal-body .git-history-commit {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-surface);
    cursor: pointer;
    transition: background 0.15s;
}

.file-tree-git-modal-body .git-history-commit:hover {
    background: rgba(88, 166, 255, 0.05);
}

.file-tree-git-modal-body .git-history-commit-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    flex-shrink: 0;
    margin-top: 4px;
}

.file-tree-git-modal-body .git-history-commit-info {
    flex: 1;
    min-width: 0;
}

.file-tree-git-modal-body .git-history-commit-message {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    word-break: break-word;
}

.file-tree-git-modal-body .git-history-commit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-tree-git-modal-body .git-history-commit-hash {
    font-family: monospace;
    color: var(--accent-blue);
}

.file-tree-git-modal-body .git-history-commit-author {
    color: var(--text-secondary);
}

.file-tree-git-modal-body .git-history-commit-date {
    color: var(--text-secondary);
}

/* Loading state */
.file-tree-git-modal-body .git-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    gap: 12px;
    background: var(--bg-base);
    min-height: 200px;
}

.file-tree-git-modal-body .git-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid rgba(88, 166, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
