/* ==========================================================================
   Aeon.WorX Zero — Application Styles
   Built on Tabler v1.4 (Bootstrap 5)
   ========================================================================== */

/* ---- Base theme: orange (default when no data-bs-theme-primary set) ---- */
:root {
    --tblr-primary: #f76707;
    --tblr-primary-rgb: 247, 103, 7;
}

/* ---- Compact card headers ---- */
.card {
    --tblr-card-cap-padding-y: 0.5rem;
    --tblr-card-cap-padding-x: 1rem;
    /* --tblr-card-spacer-y: 0.5rem; */
    --tblr-card-spacer-x: 1rem;
} 

/* ---- Status badges (Tabler-compatible) ---- */
.status-badge {
    font-size: 0.75rem;
    font-weight: var(--tblr-font-weight-medium, 500);
    padding: 0.125rem 0.625rem;
    border-radius: var(--tblr-border-radius, 4px);
    display: inline-block;
    line-height: 1.5;
}
.status-draft {
    background: var(--tblr-light, #e9ecef);
    color: var(--tblr-secondary, #495057);
}
.status-progress {
    background: var(--tblr-primary-lt, #cfe2ff);
    color: var(--tblr-primary, #084298);
}
.status-review {
    background: var(--tblr-warning-lt, #fff3cd);
    color: var(--tblr-warning, #664d03);
}
.status-done {
    background: var(--tblr-success-lt, #d1e7dd);
    color: var(--tblr-success, #0a3622);
}
.status-closed {
    background: var(--tblr-danger-lt, #f8d7da);
    color: var(--tblr-danger, #58151c);
}

/* ---- Utility ---- */
.edit-lock-indicator { cursor: pointer; }

/* ---- Owner dropdown: button-style with searchable avatar list ---- */
.dropdown-menu-owner {
    min-width: 260px;
    padding: 0;
}
.dropdown-menu-owner .owner-user-list .dropdown-item {
    padding: 0.375rem 0.75rem;
}

/* ---- TipTap editor toolbar ---- */
.tt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 6px;
    background: var(--tblr-bg-surface, #f4f6fa);
    border: 1px solid var(--tblr-border-color, #dadcde);
    border-bottom: none;
    border-radius: var(--tblr-border-radius, 4px) var(--tblr-border-radius, 4px) 0 0;
}
.tt-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: var(--tblr-border-radius, 3px);
    background: transparent;
    color: var(--tblr-secondary, #495057);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}
.tt-toolbar button:hover {
    background: var(--tblr-light, #e6e8eb);
    border-color: var(--tblr-border-color-translucent, #c6c8cb);
}
.tt-toolbar button.is-active {
    background: var(--tblr-primary-lt, #cfe2ff);
    color: var(--tblr-primary, #0d6efd);
    border-color: #9ec5fe;
}
.tt-toolbar .tt-separator {
    width: 1px;
    background: var(--tblr-border-color, #dadcde);
    margin: 2px 4px;
    align-self: stretch;
}
.tt-toolbar select {
    height: 28px;
    font-size: 13px;
    padding: 0 4px;
    border: 1px solid var(--tblr-border-color, #dadcde);
    border-radius: var(--tblr-border-radius, 3px);
    background: var(--tblr-bg-forms, #fff);
    cursor: pointer;
}

/* ---- TipTap editor area ---- */
.tt-editor {
    border: 1px solid var(--tblr-border-color, #dadcde);
    border-radius: 0 0 var(--tblr-border-radius, 4px) var(--tblr-border-radius, 4px);
    background: var(--tblr-bg-forms, #fff);
    border-top: none;
}
.tt-editor .tiptap {
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 12px;
    outline: none;
    font-size: 0.875rem;
    line-height: 1.6;
}
.tt-editor .tiptap p {
    margin: 0 0 0.5em;
}
.tt-editor .tiptap p:last-child {
    margin-bottom: 0;
}

/* ---- Richtext read-only display ---- */
.richtext-display {
    min-height: 80px;
    height: auto;
    overflow: auto;
    padding: 0.5625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ---- Empty state (Tabler-compatible) ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--tblr-secondary, #868e96);
    margin-bottom: 1rem;
}
.empty-state .empty-title {
    font-size: 1.125rem;
    font-weight: var(--tblr-font-weight-medium, 500);
    margin-bottom: 0.5rem;
}
.empty-state .empty-subtitle {
    color: var(--tblr-secondary, #868e96);
    margin-bottom: 1.5rem;
}

/* ---- Comment styles ---- */
.comment {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--tblr-border-color, #e5e7eb);
}
.comment:last-child {
    border-bottom: none;
}

/* ---- Cytoscape graph container ---- */
.graph-container {
    border: 1px solid var(--tblr-border-color, #dee2e6);
    border-radius: var(--tblr-border-radius, 6px);
    background: var(--tblr-bg-surface, #fafbfc);
    overflow: hidden;
}

/* ---- Reference / doc links ---- */
.reference-link,
.doclink,
.file-link {
    font-weight: var(--tblr-font-weight-medium, 500);
    color: var(--tblr-primary, #0d6efd);
}
.reference-link:hover,
.doclink:hover,
.file-link:hover {
    color: var(--tblr-primary-darken, #0a58ca);
    text-decoration: underline;
}

/* ---- Dark mode adjustments ---- */
[data-bs-theme="dark"] .richtext-display {
    background: var(--tblr-dark, #1a2234);
}
[data-bs-theme="dark"] .comment {
    border-color: var(--tblr-border-color-translucent, rgba(101, 109, 119, 0.16));
}

/* ---- Graph legend ---- */
.legend-line {
    display: inline-block;
    width: 18px;
    height: 3px;
    vertical-align: middle;
    border-radius: 2px;
}

/* ---- Guard detail accordion in transitions table ---- */
.guard-detail-row.collapsing {
    transition: height 0.2s ease;
}
.guard-toggle .guard-chevron {
    transition: transform 0.2s ease;
}
.guard-toggle:not(.collapsed) .guard-chevron {
    transform: rotate(-180deg);
}

/* Card descriptions — remove trailing whitespace from Markdown-rendered paragraphs */
.card-description p:last-child,
.card-description blockquote:last-child,
.popover-body p:last-child,
.richtext-display p:last-child { margin-bottom: 0; }

/* Fix badge vertical alignment in timeline headings */
.timeline-event-card h4 .badge {
    vertical-align: middle;
}

/* ---- Relationship Groupboxes (Parent, Children, Associations) ---- */
.relationship-groupbox .card-header,
.association-groupbox .card-header {
    background: var(--tblr-bg-surface, #f4f6fa);
    border-bottom: 1px solid var(--tblr-border-color, #dadcde);
}

.relationship-groupbox .list-group-item,
.association-groupbox .list-group-item {
    border-left: none;
    border-right: none;
    font-size: 0.85rem;
}

.assoc-dropzone,
.parent-dropzone,
.child-dropzone {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin: 4px 6px;
    border: 2px dashed var(--tblr-border-color, #dadcde);
    border-radius: var(--tblr-border-radius, 4px);
    background: var(--tblr-bg-surface, #fafbfc);
    color: var(--tblr-secondary, #868e96);
    font-size: 0.8rem;
    min-height: 32px;
    cursor: default;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.assoc-dropzone.dropzone-active,
.parent-dropzone.dropzone-active,
.child-dropzone.dropzone-active {
    border-color: var(--tblr-primary, #f76707);
    background: var(--tblr-primary-lt, rgba(247, 103, 7, 0.08));
    color: var(--tblr-primary, #f76707);
}

.assoc-dropzone .dropzone-error,
.parent-dropzone .dropzone-error,
.child-dropzone .dropzone-error {
    margin-left: auto;
}

.association-groupbox .list-group-item {
    border-left: none;
    border-right: none;
    font-size: 0.85rem;
}
