/* ==============================================
   Layout-only rules for PLANTA page structure.
   Component colors/fonts are in auto-generated
   pl-component-overrides.css and pl-variables.css.
   ============================================== */

/* --- Page Header: Breadcrumb bar --- */
.pl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 24px;
    border-bottom: 1px solid var(--pl-neutral-border-color-border);
    flex-shrink: 0;
    background: var(--pl-neutral-bg-color-bg-container);
}

/* Left side of the header: back affordance + menu tag + breadcrumb. */
.pl-breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Home icon as a click target: an unstyled button so the crumb's look is unchanged. */
.pl-breadcrumb-home {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}

.pl-breadcrumb-home:hover:not(:disabled) {
    color: var(--pl-neutral-text-color-text);
}

/* Drop the focus ring after a mouse click, but keep it for keyboard navigation. */
.pl-breadcrumb-home:focus:not(:focus-visible) {
    outline: none;
}

.pl-breadcrumb-home:disabled {
    cursor: default;
}

/* Home icon uses the primary text color (black) only when it is the last (only) crumb;
   otherwise it inherits the muted breadcrumb grey like any non-last item. */
.pl-breadcrumb-home-current {
    color: var(--pl-neutral-text-color-text);
}

/* Back button shown when inside a nested menu; navigates back out of it. */
.pl-breadcrumb-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--pl-neutral-border-color-border);
    border-radius: 3px;
    background: var(--pl-neutral-bg-color-bg-container);
    color: var(--pl-neutral-text-color-text);
    cursor: pointer;
}

.pl-breadcrumb-back:hover:not(:disabled) {
    background: var(--pl-neutral-fill-color-fill-tertiary);
}

/* Drop the focus ring after a mouse click, but keep it for keyboard navigation. */
.pl-breadcrumb-back:focus:not(:focus-visible) {
    outline: none;
}

.pl-breadcrumb-back:disabled {
    cursor: default;
    opacity: 0.4;
}

/* Nested-menu name shown as a tag: gear icon + title. */
.pl-breadcrumb-menu-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--pl-neutral-border-color-border);
    border-radius: 3px;
    background: var(--pl-neutral-fill-color-fill-tertiary);
    color: var(--pl-neutral-text-color-text);
    white-space: nowrap;
}

.pl-page-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* --- Page Title: Title + tags row --- */
.pl-page-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 12px 24px 8px;
    flex-shrink: 0;
    background: var(--pl-neutral-bg-color-bg-container);
}

.pl-page-title-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Overflow "..." button sizing — 32×32 content area per Figma */
.pl-page-title-more.ant-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Green status dot shape */
.pl-tag-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
}

/* --- Action Bar: between tab headers and content --- */
.pl-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    border-bottom: 1px solid var(--pl-neutral-border-color-border-secondary);
    flex-shrink: 0;
    background: var(--pl-neutral-bg-color-bg-container);
}

.pl-action-bar-left,
.pl-action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Allow the groups to shrink below their content so the fit observer sees the
       squeeze and can collapse items, instead of flexbox forcing an early overflow. */
    min-width: 0;
}

/* Zero-size anchor for the collapsed Filter/Ansicht overlays: their dropdowns anchor
   here (at the right ⋯ trigger) when the buttons themselves are collapsed. */
.pl-ab-collapsed-anchor {
    display: inline-block;
    width: 0;
    height: 0;
}

/* Cheap width reducer for the variant selector, which never collapses into overflow. */
.pl-variant-trigger-title {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Gap between icon and label inside action-bar buttons (any variant — primary,
   default, dashed, …). The auto-generated pl-component-overrides.css only
   targets `ant-btn-default`, leaving other variants without a gap. */
.pl-action-bar .ant-btn > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Geometry for OLE icons opting into `currentColor` painting. BinaryCssGenerator emits the
   per-UID mask; this supplies what the mask needs but the generator can't know: a masked
   element is not a replaced element, so it has none of the intrinsic size the `content: url()`
   image it replaces would have had, and would collapse to 0×0 without an explicit box.
   Consumers set that box themselves (`.pl-action-bar-icon` and PlButton both do). */
.pl-recolor-icon {
    display: inline-block;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Explicit box for recolored button icons (PlButton and PlLinkField both render `.pl-button-icon`,
   in different CSS-isolation scopes, so this shared rule is their only common home). Sized in `em`
   so the icon tracks the button's size variant, matching `i.pl-button-icon`'s `font-size: 1.1em`;
   `mask-size: contain` above keeps the source aspect ratio. */
.pl-button-icon.pl-recolor-icon {
    width: 1.1em;
    height: 1.1em;
}

/* Fallback recolor for raster OLEs, which cannot be masked. Each button variant defines its own
   `--pl-icon-filter` (a `filter` chain) and the icon picks it up: `brightness(0)` flattens any
   source to black (preserving alpha); a trailing `invert(1)` then turns black into white.
   This can only ever produce black or white — never the hover blue or the danger red — and has
   no `:hover`/`:active` variant, so SVG OLEs take the `.pl-recolor-icon` route above instead and
   are excluded here. Also excludes the static mask-based icons (`pl-action-bar-icon-plus`,
   `-filter`, `-view`, `-schedule`), which already render in `currentColor`; they are matched by
   the `pl-icon-{UID}` attribute selector only, so their names deliberately avoid that prefix. */
.pl-action-bar .ant-btn .pl-action-bar-icon[class*="pl-icon-"]:not(.pl-recolor-icon) {
    filter: var(--pl-icon-filter, none);
}

.pl-action-bar .ant-btn-primary,
.pl-action-bar .ant-btn-dangerous {
    --pl-icon-filter: brightness(0) invert(1);
}

.pl-action-bar .ant-btn-default {
    --pl-icon-filter: brightness(0);
}

/* --- Board sidebar toggle (Pulse board action bar) --- */
/* Hand-written, not in the generated pl-component-overrides.css: these glyphs
   are board-only and form an open/closed state pair. Sizing and mask base come
   from the generated .pl-action-bar-icon rule; the names avoid the pl-icon-*
   recolor filter above by design. */
.pl-action-bar-icon-sidebar-right {
    background-color: currentColor;
    -webkit-mask-image: url('/icons/icon-sidebar-right.svg');
    mask-image: url('/icons/icon-sidebar-right.svg');
}

.pl-action-bar-icon-sidebar-right-filled {
    background-color: currentColor;
    -webkit-mask-image: url('/icons/icon-sidebar-right-filled.svg');
    mask-image: url('/icons/icon-sidebar-right-filled.svg');
}

/* Icon-only squares with identical geometry for the edit-view and sidebar
   toggle neighbors. The toggle can't use the Icon parameter (custom mask span),
   so it misses ant-btn-icon-only; the edit button's anticon baseline offset
   floats it ~4px high inside the Tooltip's inline wrapper. Flex-centering both
   and opting out of baseline alignment pins the pair to the same center. */
.pl-action-bar .board-edit-btn.ant-btn,
.pl-action-bar .board-sidebar-toggle-btn.ant-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: top;
}

/* Pressed while the sidebar is open. Ties with the generated ant-btn-text
   hover/active rules on specificity and wins by file order (pl-layout.css
   loads after pl-component-overrides.css). */
.pl-action-bar .board-sidebar-toggle-btn.active {
    color: var(--pl-semantic-primary-color-primary);
    background: var(--pl-semantic-primary-color-primary-bg);
}

/* --- Variant Dropdown inside Action Bar --- */
.pl-variant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.pl-variant-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.pl-variant-create-input {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
}

/* --- Tabs container — fills remaining vertical space --- */
.pl-site-navigation-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--pl-neutral-bg-color-bg-container);
}

/* Content area fills remaining height */
.pl-site-navigation-tabs > .ant-tabs-content-holder {
    flex: 1;
    overflow: hidden;
}

.pl-site-navigation-tabs > .ant-tabs-content-holder > .ant-tabs-content {
    height: 100%;
}

.pl-site-navigation-tabs > .ant-tabs-content-holder .ant-tabs-tabpane-active {
    height: 100%;
}

/* Tab bar padding and height */
.pl-site-navigation-tabs > .ant-tabs-nav {
    margin: 0;
    padding: 0 24px;
    height: 40px;
}

/* Hide the tab navigation bar when only a single tab is available — there is nothing
   to navigate between. Driven by the rendered tab count (via :has) rather than the
   module count so that a single Agile module showing multiple sub-tabs (overview,
   open boards, project settings) still keeps its navigation. */
.pl-site-navigation-tabs:not(:has(.ant-tabs-tab ~ .ant-tabs-tab)) > .ant-tabs-nav {
    display: none;
}

/* --- Tab header inside TabTemplate (PlModuleTabItem) --- */
.pl-tab-header {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 320px;
}

.pl-tab-header .pl-tab-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.pl-tab-header .pl-tab-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Close button for extra (closable) module tabs */
.pl-tab-header .pl-tab-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    margin-left: 2px;
    flex-shrink: 0;
    opacity: 0.7;
    border-radius: 3px;
}

.pl-tab-header .pl-tab-close-btn img {
    width: 16px;
    height: 16px;
}

.pl-tab-header .pl-tab-close-btn:hover {
    opacity: 1;
}

.pl-tab-header .pl-tab-close-btn:focus-visible {
    opacity: 1;
    outline: 2px solid var(--pl-neutral-border-color-border);
    outline-offset: 2px;
}

/* AntDesign wraps a Dropdown trigger in an inline-block of its own. Here it wraps the whole tab
   header, so it has to behave like the header did as a direct child — stretch to the tab's box
   rather than shrink-wrap as an inline-block, whose baseline also shifted the label. Its
   line-height must be left alone: zeroing it collapsed the label's line box and the tabs
   rendered blank. */
.ant-tabs-tab .antblazor-overlay-trigger-wrapper {
    display: flex !important;
    align-items: center;
    width: 100% !important;
}

.pl-tab-header .pl-notification-dot {
    position: absolute;
    top: 4px;
    right: -7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--pl-semantic-warning-color-warning, #F19822);
    pointer-events: none;
}

.pl-site-navigation-tabs .ant-tabs-tab .ant-tabs-tab-btn {
    overflow: visible;
}

/* --- News Feed Badge dot position --- */
.pl-page-header-actions .ant-badge-dot {
    top: 8px;
    right: 8px;
}

/* --- News Feed Dropdown (AntDesign overlay) --- */
.pl-news-feed-dropdown {
    padding: 0;
}

.pl-news-feed-dropdown .news-feed-container {
    width: 400px;
    min-height: 200px;
    max-height: 524px;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    box-shadow: 0 7px 8px 0 rgba(0, 0, 0, 0.12);
}

.pl-news-feed-dropdown .news-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.pl-news-feed-dropdown .news-feed-title {
    color: #000;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.pl-news-feed-dropdown .news-feed-close-btn {
    color: #838c97;
    font-size: 16px;
}

.pl-news-feed-dropdown .news-feed-tabs {
    display: flex;
    height: 40px;
    align-items: center;
    padding-left: 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.pl-news-feed-dropdown .news-feed-tab {
    color: #000;
    height: 100%;
    width: 40px;
    padding: 12px 8px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.pl-news-feed-dropdown .news-feed-tab.is-active {
    font-weight: bold;
    border-bottom: 3px solid #005794;
}

.pl-news-feed-dropdown .news-feed-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pl-news-feed-dropdown .news-feed-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px 12px;
    border-bottom: 1px solid #dee2e6;
    border-left: 4px solid rgba(241, 152, 35, 0.4);
}

.pl-news-feed-dropdown .news-feed-item.is-read {
    padding-left: 16px;
    border-left: none;
}

.pl-news-feed-dropdown .planta-system-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 50%;
    background: linear-gradient(65deg, #98d5c9 12.14%, #00b2f5 88.19%);
}

.pl-news-feed-dropdown .planta-avatar-logo {
    margin: 5px 10px 0 10px;
    flex-shrink: 0;
}

.pl-news-feed-dropdown .news-feed-item-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pl-news-feed-dropdown .news-feed-item-header {
    display: flex;
    justify-content: space-between;
}

.pl-news-feed-dropdown .news-feed-item-label {
    display: inline-flex;
    padding: 2px 8px;
    align-items: center;
    border-radius: 4px;
    background: #d3effd;
}

.pl-news-feed-dropdown .news-feed-item-date {
    color: #525b65;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
}

.pl-news-feed-dropdown .news-feed-item-title {
    color: #000;
    font-size: 16px;
}

.pl-news-feed-dropdown .news-feed-item-banner {
    margin: 10px 0;
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.pl-news-feed-dropdown .news-feed-item-content {
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.pl-news-feed-dropdown .read-more-button {
    display: inline-flex;
    padding: 6px 12px;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    background: #005794;
    box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.08);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 19.02px;
    width: 112px;
}

.pl-news-feed-dropdown .news-feed-empty {
    color: #525b65;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
