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

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

/* Recolor action-bar button icons to match the button's text color.
   The `pl-icon-{UID}` class paints the SVG/PNG via `content: url(...)`, so
   the icon would otherwise keep its own colors. 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 when needed.
   Scoped to icons with a `pl-icon-{UID}` class so it doesn't apply to the
   static mask-based icons (`pl-action-bar-icon-plus`, `-filter`, `-view`,
   `-schedule`) — those already render in `currentColor` and would be flattened
   to black by the filter. */
.pl-action-bar .ant-btn .pl-action-bar-icon[class*="pl-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);
}

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

.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;
}
