/* Inline field editing component (GenericFieldUpdateView / field_inline.html).
   Loaded globally in core/base.html; used by the zones page and the network
   workspace. Colours come from Bootstrap's --bs-* tokens so theming flows from
   the core layer. This is the single source — do not re-declare these elsewhere. */

/* Hide Alpine components until initialised (prevents the view + edit flash). */
[x-cloak] {
    display: none !important;
}

.inline-edit-container,
.inline-view,
.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form {
    justify-content: flex-end; /* keep the error text aligned under the input */
}

/* Edit-mode wrapper. Deliberately NOT Bootstrap's .d-flex: its display:flex is
   !important and would beat Alpine x-show's inline display:none, leaking the edit
   form into view mode. */
.inline-edit-form {
    display: flex;
    flex-direction: column;
}

.inline-edit-input {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm);
    width: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-edit-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

.inline-icon-button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.1s;
}

.inline-icon-button:focus {
    outline: none;
}

.inline-icon-button:hover {
    transform: scale(1.1);
}

.inline-icon-button.save {
    color: var(--bs-success);
}

.inline-icon-button.cancel {
    color: var(--bs-secondary);
}

.inline-view,
.inline-form {
    transition: opacity 0.2s ease;
}

/* Boolean toggle switch should read as interactive. */
.inline-edit-container .form-check-input:not(:disabled) {
    cursor: pointer;
}

/* input grows to fill its container instead of the default compact width. */
.vc-inline-fill .inline-edit-form {
    width: 100%;
}

.vc-inline-fill .inline-edit-input {
    flex: 1 1 auto;
}
