
.form-control-no-border {
    border: none !important;
}

.checklist-text-checked{
    text-decoration: line-through;
    text-decoration-thickness: 1.25px;
    text-decoration-color: #cbd5e1;
    color: #94a3b8;
    opacity: .75;
}

.checklist-row:hover {
    background-color: #f9f9f9;
}
.form-control.checklist-input {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding-left: 0;
}
.form-control-plaintext:focus {
    border: none;
    outline: none;
    box-shadow: none;
}
 
.checklist-parent-text-checked {
    color: #9a9a9a; /* Nuanță de gri ajustată pentru o mai bună vizibilitate */
    transition: color 0.3s ease-in-out; /* Tranziție lină pentru schimbarea culorii */
}

.checklist-text {
    width: 100%; /* Face inputul sa ocupe tot spatiul orizontal disponibil */
    background-color: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    font-family: inherit;
}

/* Hover normal */
.check-list-focus-row:hover {
    background-color: #f1f5f9;
}

.check-list-focus-row:focus-within {
    background-color: #eff6ff;
    box-shadow: inset 2px 0 0 #3b82f6;
}

/* Checked rows — dim the whole row, no focus accent */
.check-list-focus-row:has(.ags-cl-circle--checked) {
    opacity: 0.65;
}

.check-list-focus-row:has(.ags-cl-circle--checked):focus-within {
    background-color: transparent;
    box-shadow: none;
}

.check-list-focus-row:has(.ags-cl-circle--checked):hover {
    background-color: #f1f5f9;
    opacity: 0.75;
}

.checklist-container {
    border: none;
}

/* Aliniere elemente pe rand: 3 puncte, numar, checkbox, text */
[data-ags-checklist-row="true"] {
    display: flex;
    align-items: flex-start !important;
    min-height: 2em;
    padding-top: 0.25em;
    padding-bottom: 0.25em;
}

[data-ags-checklist-row="true"] > * {
    flex-shrink: 0;
}

[data-ags-checklist-row="true"] .d-flex.flex-column {
    flex-shrink: 1;
    flex-grow: 1;
}

.checklist-list, .checklist-sublist {
    list-style-type: none;
    padding-left: 20px;
}

.checklist-item {
    margin-bottom: 5px;
}

.checklist-checkbox {
    margin-right: 10px;
}

.checklist-number {
    display: flex;
    align-items: center;
    height: 1.4em;
    line-height: 1.4em;
    margin-top: 0.45em;
}


.add-hoover {
    border: 1px solid #007BFF; /* bordură solidă de culoare albastră */
    border-radius: 10px; /* colțuri rotunjite */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* umbră ușoară pentru un efect 3D */
    transition: border-color 0.3s ease; /* tranziție pentru hover */
}


.add-hoover:hover {
    border-color: #4aa086; /* schimbă culoarea bordurii la hover */
}

.expandable-input-container {
    position: relative;
    width: 100%;
}

.expandable-input-container textarea {
    min-height: 1.5em;
    resize: none;
    transition: height 0.2s ease;
    width: 100%;
    line-height: 1.5em;
    font-family: inherit;
}


.form-control-no-border:focus {
    box-shadow: none;
}


/* Pentru dispozitive tactile, afișăm mereu butonul */
@media (hover: none) {
    .action-button {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}




.checkbox-context-container {
    position: relative;
    padding-left: 28px;
}

/* Leaf items (no collapse btn): muta three-dots pe pozitia placeholder-ului */
.checkbox-context-container:has(.checklist-collapse-placeholder) .action-button {
    left: 28px;
}

.action-button {
    position: absolute;
    left: 2px;
    top: 0.55em;
    transform: scale(0.85);
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    padding: 0;
}

.action-button i {
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.15s ease;
}

/* Apare când se hover-ează pe rând */
.checkbox-context-container:hover .action-button,
.action-button:focus {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Highlight cerc la hover direct pe buton */
.action-button:hover {
    background: rgba(13, 110, 253, 0.1);
}

.action-button:hover i {
    color: #0d6efd;
}

/* Apăsat */
.action-button:active {
    background: rgba(13, 110, 253, 0.2);
    transform: scale(0.92);
}

.action-button:focus {
    outline: none;
}

.action-button:focus-visible {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35);
}


.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.45em;
    margin-left: 0;
    background-color: #fff;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    flex-shrink: 0;
}

.form-check-input:disabled {
    background-color: #e9ecef;
    opacity: 0.5;
}

.form-check-input:checked:disabled {
    background-color: #4b90f4;
    border-color: #0d6efd;
    opacity: 0.5;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check-label {
    padding-left: 0.5em;
    font-size: 1.1em;
}

/* ── Circle checkbox (Todoist-style) ── */
.ags-cl-circle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 0.45em;
    margin-right: 0.5rem;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-shadow: none;
}

.ags-cl-circle:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.ags-cl-circle--checked {
    background: #22c55e;
    border-color: #22c55e;
}

.ags-cl-circle--checked:hover {
    background: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Inner span ensures pixel-perfect centering of the icon */
.ags-cl-circle-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.ags-cl-circle-inner i {
    font-size: 0.72rem;
    line-height: 1;
    color: #fff;
    display: block;
}

/* ── Disabled state for circle checkbox ── */
.disabled-style .ags-cl-circle {
    pointer-events: none;
    opacity: 0.5;
}

/* ── Row-level delete (X) button — far right, visible only on row hover ── */
.ags-cl-remove-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 0.45em;
    margin-left: 2px;
    margin-right: 10px;
    border: none;
    background: none;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    line-height: 1;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.12s ease, color 0.15s ease, background 0.15s ease;
}

.ags-cl-remove-btn i {
    display: block;
    line-height: 1;
}

.check-list-focus-row:hover .ags-cl-remove-btn {
    opacity: 1;
}

.ags-cl-remove-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.ags-cl-remove-btn:active {
    color: #dc2626;
    background: #fecaca;
}

/* ── Show/hide checked items toggle button ── */
.ags-cl-visibility-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
    margin-right: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.ags-cl-visibility-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.ags-cl-visibility-btn:active {
    background: rgba(59, 130, 246, 0.2);
}

.ags-cl-visibility-btn--active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

/* ── Expand / Collapse all tree buttons ── */
.ags-cl-tree-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, background 0.15s ease,
                color 0.15s ease, box-shadow 0.15s ease;
}

.ags-cl-tree-btn:hover {
    border-color: #c4b5fd;
    background: #f8f7ff;
    color: #6d28d9;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.12);
}

.ags-cl-tree-btn:active {
    background: #ede9fe;
    border-color: #a78bfa;
    color: #5b21b6;
    box-shadow: none;
}

/* ── Item enter animation — fires only when element is added to DOM ── */
@keyframes checklist-item-enter {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.check-list-focus-row {
    animation: checklist-item-enter 160ms ease both;
    border-radius: 8px;
    transition: background-color 0.12s ease;
}

/* ── Collapse / expand toggle button for parent items ── */
.checklist-collapse-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    width: 20px;
    height: 26px;
    margin-top: 0.30rem;
    margin-right: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    font-size: 0.8rem;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    line-height: 1;
}

/* Apare când se hover-ează pe rând */
.checkbox-context-container:hover .checklist-collapse-btn,
.checklist-collapse-btn:focus {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Highlight cerc la hover direct pe buton */
.checklist-collapse-btn:hover {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.checklist-collapse-btn:hover .checklist-collapse-icon {
    color: #0d6efd;
}

/* Apăsat */
.checklist-collapse-btn:active {
    background: rgba(13, 110, 253, 0.2);
    transform: scale(0.92);
}

.checklist-collapse-btn:focus {
    outline: none;
}

.checklist-collapse-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35);
}

/* The chevron icon rotates smoothly on expand/collapse */
.checklist-collapse-icon {
    display: inline-block;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.checklist-collapse-btn.is-expanded .checklist-collapse-icon {
    transform: rotate(90deg);
}

/* Placeholder keeping alignment for leaf items (no children) */
/* Must match the total width of .checklist-collapse-btn (20px + 1px = 21px) */
.checklist-collapse-placeholder {
    flex-shrink: 0;
    width: 20px;
    margin-right: 1px;
}

/* ── Mobile: move collapse button to the right, enlarge tap target ── */
@media (pointer: coarse) {
    .checklist-collapse-btn {
        order: 99;
        margin-right: 8px;
        margin-left: 4px;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }

    /* No placeholder needed — button is at the far right */
    .checklist-collapse-placeholder {
        display: none;
    }

    /* Larger tap target for the three-dots trigger */
    .action-button {
        width: 40px;
        height: 40px;
    }

    /* Larger tap target for the circle checkbox */
    .ags-cl-circle {
        width: 28px;
        height: 28px;
    }
}

/* ── Mobile contextual action float ──
   Appears just below the tapped item (top set via inline style in C#).
   Panels (colour / style) stack above the action bar inside the same card. ── */
.mobile-action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

/* Floating card that contains panels + action bar */
.mobile-action-float {
    position: fixed;
    left: 8px;
    right: 8px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    animation: slideUpPanel 160ms ease both;
}

/* Colour / style picker panel inside the float card */
.mobile-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #dee2e6;
}

.mobile-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 6px;
}

.mob-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    color: #495057;
    font-size: 1.35rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mob-action-btn:active,
.mob-action-btn:hover {
    background-color: #f0f2f5;
    color: #0d6efd;
}

.mob-action-btn--active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.mob-action-btn--danger        { color: #dc3545; }
.mob-action-btn--danger:active,
.mob-action-btn--danger:hover  { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }

.mob-action-divider {
    width: 1px;
    height: 26px;
    background-color: #dee2e6;
    flex-shrink: 0;
    margin: 0 2px;
}

@keyframes slideUpPanel {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.mobile-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* ── Collapse indicator: blue chevron when subtree is hidden ── */
.checklist-collapse-btn:not(.is-expanded) {
    color: #0d6efd;
}

/* ── Parent items (any item that has a collapse button) ──────────────────
   Signals: bold text + larger/bolder chevron always visible.
   ──────────────────────────────────────────────────────────────────────── */
.check-list-focus-row:has(.checklist-collapse-btn) textarea,
.check-list-focus-row:has(.checklist-collapse-btn) .checklist-number {
    font-weight: 700;
    color: #3730a3;
}

.check-list-focus-row:has(.checklist-collapse-btn) .checklist-collapse-btn {
    opacity: 0.65;
    visibility: visible;
    color: #6366f1;
    font-size: 1.1rem;
    font-weight: 900;
}

/* Collapsed state — full opacity chevron */
.check-list-focus-row:has(.checklist-collapse-btn:not(.is-expanded)) textarea,
.check-list-focus-row:has(.checklist-collapse-btn:not(.is-expanded)) .checklist-number {
    color: #312e81;
}

.check-list-focus-row:has(.checklist-collapse-btn:not(.is-expanded)) .checklist-collapse-btn {
    opacity: 1;
    color: #4f46e5;
    font-size: 1.1rem;
    font-weight: 900;
}

/* ── Heading-aware alignment for all first-line-anchored elements ──
   When H1/H2/H3 is applied, the textarea's first line is taller so every
   sibling element (checkbox, row number, chevron, placeholder) needs the
   same margin-top shift to stay aligned with line 1 of the text.
   .checklist-collapse-btn has its own font-size:0.8rem, so rem is used
   there (instead of em) to get the identical pixel value as the others. ── */
/* ── Heading-aware alignment — mathematically derived ──────────────────
   Formula: first_line_center = padding_top(6px) + (font_size × line_height) / 2
   Each sibling needs margin/top = first_line_center - (element_height / 2)
   Root: 16px. form-control-plaintext padding-top: 0.375rem (6px). line-height: 1.5.
   ─────────────────────────────────────────────────────────────────────── */

/* typology 1 — H3 / fs-5 (1.25rem = 20px) → first-line center = 6 + 15 = 21px */
[data-ags-checklist-row="true"][data-typology="1"] .ags-cl-circle {
    width: 20px; height: 20px;           /* half = 10px */
    margin-top: 0.6875rem;                /* 21 − 10 = 11px */
}
[data-ags-checklist-row="true"][data-typology="1"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="1"] .checklist-collapse-btn,
[data-ags-checklist-row="true"][data-typology="1"] .checklist-collapse-placeholder {
    margin-top: 0.525rem;                 /* 21 − (1.05×1.5×16/2)=12.6 → 8.4px */
}
[data-ags-checklist-row="true"][data-typology="1"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="1"] .checklist-collapse-btn { font-size: 1.05rem; }
[data-ags-checklist-row="true"][data-typology="1"] .checklist-drag-handle  { padding-top: 0.525rem; }
[data-ags-checklist-row="true"][data-typology="1"] .ags-cl-remove-btn      { margin-top: 0.625rem; } /* 21 − 11 = 10px */
[data-ags-checklist-row="true"][data-typology="1"] .action-button          { top: 0.50rem; }         /* 21 − 13 = 8px */

/* typology 2 — H2 / fs-4 (1.5rem = 24px) → first-line center = 6 + 18 = 24px */
[data-ags-checklist-row="true"][data-typology="2"] .ags-cl-circle {
    width: 23px; height: 23px;           /* half = 11.5px */
    margin-top: 0.78125rem;              /* 24 − 11.5 = 12.5px */
}
[data-ags-checklist-row="true"][data-typology="2"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="2"] .checklist-collapse-btn,
[data-ags-checklist-row="true"][data-typology="2"] .checklist-collapse-placeholder {
    margin-top: 0.66rem;                 /* 24 − (1.12×1.5×16/2)=13.44 → 10.56px */
}
[data-ags-checklist-row="true"][data-typology="2"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="2"] .checklist-collapse-btn { font-size: 1.12rem; }
[data-ags-checklist-row="true"][data-typology="2"] .checklist-drag-handle  { padding-top: 0.66rem; }
[data-ags-checklist-row="true"][data-typology="2"] .ags-cl-remove-btn      { margin-top: 0.8125rem; } /* 24 − 11 = 13px */
[data-ags-checklist-row="true"][data-typology="2"] .action-button          { top: 0.6875rem; }        /* 24 − 13 = 11px */

/* typology 3 — H1 / fs-3 (1.75rem = 28px) → first-line center = 6 + 21 = 27px */
[data-ags-checklist-row="true"][data-typology="3"] .ags-cl-circle {
    width: 26px; height: 26px;           /* half = 13px */
    margin-top: 0.875rem;                /* 27 − 13 = 14px */
}
[data-ags-checklist-row="true"][data-typology="3"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="3"] .checklist-collapse-btn,
[data-ags-checklist-row="true"][data-typology="3"] .checklist-collapse-placeholder {
    margin-top: 0.8025rem;               /* 27 − (1.18×1.5×16/2)=14.16 → 12.84px */
}
[data-ags-checklist-row="true"][data-typology="3"] .checklist-number,
[data-ags-checklist-row="true"][data-typology="3"] .checklist-collapse-btn { font-size: 1.18rem; }
[data-ags-checklist-row="true"][data-typology="3"] .checklist-drag-handle  { padding-top: 0.8025rem; }
[data-ags-checklist-row="true"][data-typology="3"] .ags-cl-remove-btn      { margin-top: 1.0rem; }    /* 27 − 11 = 16px */
[data-ags-checklist-row="true"][data-typology="3"] .action-button          { top: 0.875rem; }          /* 27 − 13 = 14px */


/* ── Drag & Drop ──────────────────────────────────────────────────────── */

/* Marker semantic pentru JS drag — fara stiluri vizuale de opacitate.
   Aplicat pe numar, checkbox si grip. Cursor grab + no-select. */
.checklist-drag-trigger {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.checklist-drag-trigger:active {
    cursor: grabbing;
}

/* Grip handle — apare la hover pe rand, intre numar si checkbox */
.checklist-drag-handle {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 0.45em;
    width: 16px;
    margin-right: 4px;
    cursor: grab;
    color: #adb5bd;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    font-size: 0.9rem;
}

.check-list-focus-row:hover .checklist-drag-handle {
    opacity: 1;
}

.checklist-drag-handle:hover {
    color: #495057;
}

.checklist-drag-handle:active {
    cursor: grabbing;
}

/* Randul care este tras devine semitransparent */
.checklist-dragging {
    opacity: 0.35;
}

/* In timp ce un drag e activ, sub-elementele interactive nu mai
   intercepteaza pointer events — altfel textarea/checkbox consuma
   evenimentul 'drop' inainte sa ajunga la container. */
.ags-checklist-dragging textarea,
.ags-checklist-dragging input,
.ags-checklist-dragging button {
    pointer-events: none;
}

/* Highlight pentru drop ca "copil" al elementului tinta */
.checklist-drop-child {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    border-radius: 4px;
    background-color: rgba(13, 110, 253, 0.05);
}

/* Pe mobile nu afisam drag handle (exista mobile action bar) */
@media (pointer: coarse) {
    .checklist-drag-handle {
        display: none;
    }
}


