/* Partial: _edit-mode.css.j2 — Edit mode indicators and editable field styles */

/* Edit Mode: hidden by default, shown when body.edit-mode */
.edit-only {
    display: none !important;
}

body.edit-mode .edit-only {
    display: inline-flex !important;
}

/* Block-level edit-only elements (e.g. card sections) */
body.edit-mode div.edit-only,
body.edit-mode .edit-only-block {
    display: block !important;
}

/* Textarea edit-only elements displayed as block */
body.edit-mode textarea.edit-only {
    display: block !important;
}

/* Remainder section: hide view elements in edit mode */
body.edit-mode .remainder-heading-view,
body.edit-mode .remainder-text-view { display: none !important; }

/* --- Edit Mode Visual Indicators --- */

/* Editable fields at rest in edit mode */
body.edit-mode .editable-field {
    background: var(--edit-field-bg);
    border-radius: 3px;
    padding: 1px 4px;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: text;
}

body.edit-mode .editable-field:hover {
    background: var(--edit-field-hover-bg);
}

body.edit-mode .editable-field:focus {
    background: var(--edit-field-focus-bg);
    box-shadow: var(--edit-field-focus-shadow);
    outline: none;
}

/* Changed/unsaved field */
body.edit-mode .editable-field.dirty {
    background: var(--edit-field-dirty-bg);
    position: relative;
}

body.edit-mode .editable-field.dirty::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--edit-field-dirty-dot);
}

/* Status select in edit mode */
body.edit-mode .status-select {
    padding: 2px 6px;
    border: 1px solid var(--edit-select-border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--edit-select-bg);
    cursor: pointer;
    transition: border-color 0.15s;
}

body.edit-mode .status-select option {
    background: var(--edit-select-option-bg);
    color: var(--edit-select-option-text);
    padding: 4px 8px;
}

body.edit-mode .status-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

body.edit-mode .status-select.dirty {
    background: var(--edit-field-dirty-bg);
    border-color: var(--edit-field-dirty-dot);
}

/* Status select hidden by default, shown in edit mode */
.status-select-wrapper {
    display: none;
}

body.edit-mode .status-select-wrapper {
    display: inline-flex;
}

body.edit-mode .status-badge-wrapper {
    display: none;
}

/* --- Branch Badge --- */

.branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: monospace;
    background: var(--bg-secondary, #f0f0f0);
    border: 1px solid var(--border-color, #ccc);
    margin-right: 8px;
}
.branch-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-neutral, #888);
}
.branch-status-dot.green  { background: #22c55e; }
.branch-status-dot.blue   { background: #3b82f6; }
.branch-status-dot.red    { background: #ef4444; }
.branch-status-dot.orange { background: #f59e0b; }
.branch-warning { color: #f59e0b; font-weight: bold; font-size: 1.3em; margin-left: 4px; cursor: help; }
.btn-sync {
    font-size: 0.95em;
    padding: 3px 10px;
    margin-right: 8px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    background: var(--bg-secondary, #f0f0f0);
    cursor: pointer;
    color: var(--text-primary, #333);
}
.btn-sync:hover { background: var(--bg-hover, #e0e0e0); }

/* --- Multi-Badge Container --- */
.branch-badges { display: inline-flex; align-items: center; gap: 4px; }

/* --- Branch Picker: Repo Tabs & Monorepo Toggle --- */
.branch-picker-tabs { padding: 0 16px 8px; }
.monorepo-toggle { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.monorepo-reason { color: var(--text-secondary, #888); font-size: 12px; }
.repo-tab-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.repo-tab { padding: 4px 10px; border: 1px solid var(--border-color, #ddd); border-radius: 4px; background: transparent; cursor: pointer; font-size: 12px; color: var(--text-primary, #333); }
.repo-tab.active { background: var(--accent-color, #2563eb); color: white; border-color: var(--accent-color, #2563eb); }
.repo-tab:disabled { cursor: default; }

/* --- Branch Picker Modal --- */

.branch-badge:hover {
    background: var(--bg-hover, #e0e0e0);
}

.branch-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    margin-top: 8px;
}

.branch-list-heading {
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #888);
    padding: 8px 10px 4px;
    margin: 0;
}

.branch-list-item {
    padding: 6px 12px;
    font-family: monospace;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.branch-list-item:hover {
    background: var(--bg-hover, #f0f0f0);
}

.branch-list-item.current {
    background: var(--bg-secondary, #e8e8e8);
    font-weight: 600;
    cursor: default;
}

.branch-list-item.current:hover {
    background: var(--bg-secondary, #e8e8e8);
}

.branch-list-item .branch-remote-tag {
    font-size: 0.75em;
    color: var(--text-secondary, #888);
    font-family: sans-serif;
}

.branch-list-item .branch-current-tag {
    font-size: 0.75em;
    color: var(--color-primary, #3b82f6);
    font-family: sans-serif;
    font-weight: normal;
}

/* --- Branch Creation Modal --- */

#branch-modal-overlay {
    z-index: 10000;
}
.modal-dialog {
    background: var(--bg-primary, #fff); border-radius: 8px; padding: 24px;
    min-width: 360px; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-title { font-size: 1.1em; font-weight: 600; margin-bottom: 16px; }
.modal-label { display: block; font-size: 0.9em; margin-bottom: 4px; color: var(--text-secondary, #666); }
.modal-input {
    width: 100%; padding: 8px; border: 1px solid var(--border-color, #ccc);
    border-radius: 4px; font-family: monospace; font-size: 0.95em; box-sizing: border-box;
}
.modal-input:focus { outline: 2px solid var(--color-primary, #3b82f6); }
.modal-error { color: #ef4444; font-size: 0.85em; margin-top: 8px; }
.modal-error.hidden { display: none; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* --- Push Modal File List --- */

.modal-file-list {
    max-height: 120px; overflow-y: auto;
    border: 1px solid var(--border-color, #ccc); border-radius: 4px; padding: 4px;
}
.modal-file { font-family: monospace; font-size: 0.85em; padding: 2px 6px; }
.modal-file.muted { color: var(--text-secondary, #999); }
.modal-file-checkbox {
    display: block; font-family: monospace; font-size: 0.85em;
    padding: 3px 6px; cursor: pointer; border-radius: 3px;
}
.modal-file-checkbox:hover { background: rgba(255,255,255,0.05); }
.modal-file-checkbox input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.modal-file-group-label {
    font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-secondary, #888); padding: 2px 6px;
}

/* --- Add REQ/JNY Modal --- */

.modal-section { margin-bottom: 12px; }
.modal-file-option {
    display: block;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85em;
    padding: 3px 6px;
    cursor: pointer;
    border-radius: 3px;
    color: var(--text-primary, #333);
}
.modal-file-option:hover { background: var(--row-hover, rgba(0,0,0,0.05)); }
.modal-file-option input[type="radio"] { margin-right: 6px; vertical-align: middle; }
.modal-id-display {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1em;
    font-weight: 600;
    padding: 6px 8px;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    color: var(--text-primary, #333);
}
.modal-primary-btn {
    padding: 8px 20px;
    background: var(--color-primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
}
.modal-primary-btn:hover { opacity: 0.9; }
.modal-cancel-btn {
    padding: 8px 20px;
    background: none;
    color: var(--text-secondary, #666);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
}
.modal-cancel-btn:hover { background: var(--row-hover, rgba(0,0,0,0.05)); }

/* --- Error Modal --- */

.error-modal-body {
    font-family: monospace;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    margin: 12px 0;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    color: var(--text-primary, #eee);
}

/* --- Push Button (Success) --- */

.btn-success { background: #22c55e; color: #fff; border: none; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Branch Picker: Two-Panel History Layout --- */

.branch-picker-panels {
    display: flex;
    gap: 16px;
    min-height: 300px;
}
.branch-picker-left {
    flex: 1;
    border-right: 1px solid var(--border-color, #333);
    padding-right: 16px;
    overflow-y: auto;
    max-height: 400px;
}
.branch-picker-right {
    flex: 1.5;
    overflow-y: auto;
    max-height: 400px;
}
.history-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}
.history-row.head {
    background: rgba(var(--accent-rgb, 42,170,102), 0.15);
}
.history-row:not(.head):hover {
    background: rgba(255,255,255,0.05);
    cursor: pointer;
}
.history-row.selected {
    background: rgba(var(--accent-rgb, 42,170,102), 0.25);
    outline: 1px solid var(--accent-color, #2a6);
}
.history-date {
    color: var(--text-secondary, #888);
    font-size: 11px;
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}
.history-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Loading Overlay --- */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}
.loading-overlay .loading-message {
    background: var(--bg-primary, #1a1a2e);
    padding: 24px 40px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #fff);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* --- Slide-to-Share Widget --- */

.share-track {
    display: inline-flex;
    align-items: center;
    height: 36px;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 18px;
    padding: 3px;
    min-width: 220px;
    position: relative;
    border: 1px solid var(--border-color, #333);
    user-select: none;
    touch-action: none;
}
.share-handle {
    width: 70px;
    height: 30px;
    background: var(--success-color, #2a6);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    cursor: grab;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: absolute;
    left: 3px;
    transition: left 0.15s ease-out;
}
.share-handle.dragging {
    cursor: grabbing;
    transition: none;
}
.share-handle.sharing {
    background: var(--primary-color, #47f);
    cursor: default;
}
.share-fill {
    position: absolute;
    left: 3px;
    top: 3px;
    bottom: 3px;
    width: 0;
    background: linear-gradient(90deg, rgba(var(--accent-rgb,42,170,102),0.2), rgba(var(--accent-rgb,42,170,102),0.1));
    border-radius: 15px;
    transition: width 0.15s ease-out;
}
.share-fill.dragging {
    transition: none;
}
.share-destination {
    position: absolute;
    right: 12px;
    font-size: 11px;
    color: var(--text-secondary, #666);
}

/* --- Hold-to-Share Keyboard Alternative --- */

.btn.hold-progress {
    position: relative;
    overflow: hidden;
}
.btn.hold-progress::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--primary-color, #47f);
    animation: hold-fill 1s linear forwards;
}
@keyframes hold-fill {
    from { width: 0; }
    to { width: 100%; }
}
