/* 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;
}

/* --- 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-warning { color: #ef4444; font-weight: bold; font-size: 1.1em; }
.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); }

/* --- 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); }

/* --- 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; }
