/* Project Workspace dark palette + shared panel/row chrome (VETI-3418).
   Ported from the Claude Design "Frontend UI creation/Project_UI.dc.html" mockup's
   colors.css (section "02 - Inside a project"). Permanent dark palette scoped to
   .project-workspace, independent of the app-wide light/dark theme toggle - same
   precedent as ProjectList.razor's dashboard redesign (VETI-3210). Values intentionally
   duplicate education-tokens.css's unrelated VETI-3690 token set rather than sharing a
   file, since both are separate Claude Design exports on separate ticket trees.

   Design system rules (enforced throughout this file): never introduce new colours,
   never use box-shadows or gradients, borders are always 1px solid, hover feedback is
   translateY(-2px) + border-color->gold only. */

.project-workspace {
    --tl-navy: #0B1F3A;
    --tl-gold: #F4A623;
    --tl-blue: #2D6CDF;
    --tl-bg: #080F1A;
    --tl-surface: #0D1B2E;
    --tl-surface-alt: #152336;
    --tl-border: #1E2F45;
    --tl-text: #FFFFFF;
    --tl-text-2: #CBD5E1;
    --tl-text-muted: #64748B;
    --tl-link: #6C9BFF;
    --tl-gold-button-text: #1a1400;
    --tl-success-fg: #4ADE80;
    --tl-success-bg: #10261A;
    --tl-warning-fg: #F4A623;
    --tl-warning-bg: #2A2110;
    --tl-error-fg: #F87171;
    --tl-error-bg: #2A1414;
    --tl-info-fg: #60A5FA;
    --tl-info-bg: #12203A;
    --tl-ai-fg: #A78BFA;
    --tl-ai-bg: #1C1830;
    /* Global Tasks design tokens (values from the Global Tasks mockup). --tl-text-muted-aa is the
       readable muted grey (4.5:1+ on the surface; --tl-text-muted is not). The *-border tints
       outline banners of the matching state; the kind-*-bg fills are the task-kind tiles. */
    --tl-text-muted-aa: #8B9AB1;
    --tl-border-strong: #2B4262;
    --tl-row-hover: #0F2036;
    --tl-today-bg: #111F2F;
    --tl-error-border: #4A2424;
    --tl-ai-border: #352C59;
    --tl-info-border: #1F3A66;
    --tl-success-border: #1E4A2F;
    --tl-kind-personal-bg: #11233D;
    --tl-kind-project-bg: #1D1A10;
    --tl-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.project-workspace :focus-visible {
    outline: 2px solid var(--tl-gold);
    outline-offset: 2px;
}

/* Hero header */

.project-hero {
    border-radius: 12px;
    overflow: hidden;
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    margin-bottom: 16px;
    transition: transform 180ms var(--tl-ease), border-color 180ms var(--tl-ease);
}

.project-hero:hover {
    transform: translateY(-2px);
    border-color: var(--tl-gold);
}

.project-hero-banner {
    height: 132px;
    background: var(--tl-info-bg);
    border-bottom: 1px solid var(--tl-border);
}

.project-hero-body {
    padding: 24px;
}

.project-hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.project-hero-meta {
    font: 400 12px/1.6 'Inter', sans-serif;
    color: var(--tl-text-2);
}

.project-hero-title {
    margin: 0 0 16px;
    /* !important needed to beat app.css's global `h1, h2, ... { font-family: 'Cormorant
       Garamond' !important }` Academy-theme rule -- same precedent as ProjectList.razor's
       `.projects-dashboard h1/h2/h3/h4` override. */
    font: 600 24px/1.2 'Inter', sans-serif !important;
    letter-spacing: -0.02em;
    color: var(--tl-text);
}

.project-hero-owner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.project-hero-avatar {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: var(--tl-link);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 600 12px/1 'Inter', sans-serif;
    flex: 0 0 auto;
}

.project-hero-owner-text {
    font: 400 12px/1.6 'Inter', sans-serif;
    color: var(--tl-text-2);
}

.project-hero-progress-track {
    height: 7px;
    border-radius: 9999px;
    background: var(--tl-surface-alt);
    overflow: hidden;
    margin-bottom: 6px;
}

.project-hero-progress-fill {
    height: 100%;
    background: var(--tl-gold);
}

.project-hero-progress-label,
.project-hero-progress-empty {
    font: 400 12px/1.6 'Inter', sans-serif;
    color: var(--tl-text-2);
}

.project-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.project-hero-action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--tl-border);
    background: var(--tl-surface-alt);
    color: var(--tl-text);
    font: 500 13px/1 'Inter', sans-serif;
    cursor: pointer;
    transition: border-color 180ms var(--tl-ease);
}

.project-hero-action-button:hover:not(:disabled) {
    border-color: var(--tl-gold);
}

.project-hero-action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.project-hero-action-button--primary {
    background: var(--tl-gold);
    border-color: var(--tl-gold);
    color: var(--tl-gold-button-text);
    font-weight: 700;
}

/* Tab bar */

.pw-tabbar {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--tl-border);
    margin-bottom: 16px;
}

.pw-tab {
    flex: 0 0 auto;
    position: relative;
    padding: 11px 13px;
    border: none;
    background: transparent;
    color: var(--tl-text-2);
    font: 500 12px/1 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.pw-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: transparent;
    transition: background-color 120ms var(--tl-ease);
}

.pw-tab-active {
    color: var(--tl-text);
    font-weight: 700;
}

.pw-tab-active::after {
    background: var(--tl-gold);
}

.project-workspace-panel {
    animation: pw-fade-in 180ms var(--tl-ease);
}

@media (prefers-reduced-motion: reduce) {
    .project-workspace-panel {
        animation: none;
    }
}

@keyframes pw-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Shared panel chrome, used by every tab's content component */

.pw-panel {
    border-radius: 12px;
    background: var(--tl-surface);
    border: 1px solid var(--tl-border);
    padding: 24px;
    margin-bottom: 8px;
}

.pw-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pw-panel-title {
    font: 600 20px/1.2 'Inter', sans-serif;
    color: var(--tl-text);
    margin: 0;
}

.pw-panel-desc {
    color: var(--tl-text-2);
    font: 400 12px/1.6 'Inter', sans-serif;
    margin: 0 0 4px;
}

/* Shared row list, used inside .pw-panel */

.pw-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 0;
    border-top: 1px solid var(--tl-border);
    flex-wrap: wrap;
}

.pw-row-text {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.pw-row-text-title {
    font: 600 14px/1.4 'Inter', sans-serif;
    color: var(--tl-text);
}

.pw-row-text-subtitle {
    font: 400 12px/1.6 'Inter', sans-serif;
    color: var(--tl-text-2);
}

.pw-row-meta {
    margin-left: auto;
}

.pw-footnote {
    margin-top: 16px;
    padding-left: 11px;
    border-left: 2px solid var(--tl-border);
    color: var(--tl-text-2);
    font: 400 12px/1.6 'Inter', sans-serif;
}

.pw-footnote strong,
.pw-footnote b {
    color: var(--tl-text);
}

/* Badge/chip system (hero visibility+status badges, panel header badges, row meta chips) */

.pw-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    font: 700 12px/1.4 'Inter', sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
}

.pw-badge--blue {
    background: rgba(108, 155, 255, .16);
    color: var(--tl-link);
}

.pw-badge--success {
    background: rgba(46, 160, 102, .16);
    color: var(--tl-success-fg);
}

.pw-badge--gold {
    background: var(--tl-warning-bg);
    color: var(--tl-gold);
}

.pw-badge--ai {
    background: var(--tl-ai-bg);
    color: var(--tl-ai-fg);
}

.pw-badge--info {
    background: var(--tl-info-bg);
    color: var(--tl-info-fg);
}

.pw-badge--error {
    background: var(--tl-error-bg);
    color: var(--tl-error-fg);
}

.pw-badge--neutral {
    background: var(--tl-surface-alt);
    color: var(--tl-text-2);
}

/* Global Tasks design: the quiet tint for a Low priority and a Cancelled status -- the neutral
   fill with the readable muted grey (--tl-text-muted would fail WCAG AA here). */
.pw-badge--muted {
    background: var(--tl-surface-alt);
    color: var(--tl-text-muted-aa);
}

/* TaskRow's inline status changer -- a FluentSelect made to look like the pw-badge chips it sits
   next to, so cycling a task's status doesn't need a separate dialog. The ::part() overrides
   strip FluentSelect's own control chrome (padding/min-height/border) so the .pw-badge classes
   also applied on this element (padding, font, uppercase, radius) are what the closed state
   actually reads as, instead of Fluent's default listbox-button box model fighting them. */
.project-workspace .pw-status-select {
    min-width: 0;
    height: auto;
    border: none;
    cursor: pointer;
    --neutral-fill-rest: transparent;
    --neutral-fill-hover: var(--tl-surface-alt);
    --neutral-stroke-rest: transparent;
    --neutral-stroke-hover: var(--tl-border);
}

.project-workspace .pw-status-select::part(control) {
    padding: 0;
    min-height: 0;
    height: auto;
    border: none;
    font: inherit;
    text-transform: inherit;
    color: inherit;
}

.project-workspace .pw-status-select::part(indicator) {
    margin-left: 4px;
    width: 10px;
}

.project-workspace .pw-status-select::part(listbox) {
    background: var(--tl-surface-alt);
    border: 1px solid var(--tl-border);
    color: var(--tl-text);
    text-transform: none;
    font-weight: 400;
}

/* Same top-layer inheritance break dialog-theme.css documents for ".tl-dialog fluent-option" --
   the listbox background above is themed, but each fluent-option still resolves its own
   custom properties from FAST's defaults once promoted into the top layer, so without this it
   renders every option in FAST's default grey instead of the navy/gold theme. */
.project-workspace .pw-status-select fluent-option {
    --neutral-fill-stealth-rest: var(--tl-surface-alt) !important;
    --neutral-fill-stealth-hover: var(--tl-surface) !important;
    --neutral-fill-stealth-active: var(--tl-surface) !important;
    --neutral-fill-stealth-focus: var(--tl-surface-alt) !important;
    --neutral-fill-secondary-rest: var(--tl-surface) !important;
    --neutral-fill-secondary-hover: var(--tl-surface) !important;
    --neutral-fill-secondary-active: var(--tl-surface) !important;
    --neutral-foreground-rest: var(--tl-text) !important;
    --neutral-foreground-hover: var(--tl-text) !important;
    --accent-fill-rest: var(--tl-gold) !important;
    --accent-fill-hover: var(--tl-gold) !important;
    --accent-fill-active: var(--tl-gold) !important;
}

/* People tab's Invite button -- kept on the blue accent already used by InviteMemberDialog's own
   row buttons and the app's other non-reskinned dialogs (WorkspaceDetailsDialog,
   WelcomeCourseDialog), rather than the gold used by the hero's primary CTA, so it stays visually
   consistent with the dialog it opens. Wired to --tl-blue explicitly instead of leaving it on
   whatever the ambient/tenant accent color resolves to -- same --tl-blue focus-ring precedent as
   ProjectList.razor's .projects-dashboard fluent-button. */
.project-workspace .pw-invite-button {
    --accent-fill-rest: var(--tl-blue);
    --accent-fill-hover: var(--tl-blue);
    --accent-fill-active: var(--tl-blue);
    --accent-stroke-control-rest: var(--tl-blue);
    --foreground-on-accent-rest: #FFFFFF;
}

.project-workspace .pw-invite-button::part(control) {
    border-radius: 8px;
    box-shadow: none;
}

.project-workspace .pw-invite-button:hover:not(:disabled)::part(control) {
    opacity: 0.9;
}

.project-workspace .pw-invite-button::part(control):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tl-blue) 35%, transparent);
}

.pw-row-action {
    border: 1px solid var(--tl-border);
    cursor: pointer;
    transition: border-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pw-row-action:hover,
.pw-row-action:focus-visible {
    border-color: var(--tl-gold);
}

/* Icon-only row action (Documents tab's preview/download) -- same 26x26 footprint as
   .pw-row-badge, bordered/hover-gold like .pw-row-action, but circular with a centered icon
   instead of a text pill. */
.pw-row-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--tl-border);
    color: var(--tl-text-2);
    cursor: pointer;
    flex: 0 0 auto;
    transition: border-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1), color 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pw-row-icon-action:hover,
.pw-row-icon-action:focus-visible {
    border-color: var(--tl-gold);
    color: var(--tl-text);
}

/* Numbered/icon row badges (26x26 rounded squares) - same tint palette as .pw-badge */

.pw-row-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 700 12px/1 'Inter', sans-serif;
    flex: 0 0 auto;
}

.pw-row-badge--blue {
    background: rgba(108, 155, 255, .16);
    color: var(--tl-link);
}

.pw-row-badge--success {
    background: rgba(46, 160, 102, .16);
    color: var(--tl-success-fg);
}

.pw-row-badge--gold {
    background: var(--tl-warning-bg);
    color: var(--tl-gold);
}

.pw-row-badge--ai {
    background: var(--tl-ai-bg);
    color: var(--tl-ai-fg);
}

.pw-row-badge--neutral {
    background: var(--tl-surface-alt);
    color: var(--tl-text-2);
}

/* Scoped overrides so Fluent-native controls (data grids, dialogs, inputs, progress rings)
   don't clash with the dark panel chrome around them. Fluent internals are kept per-tab;
   only their visual chrome is retargeted to the page's dark tokens. */

.project-workspace .pw-panel .fluent-data-grid,
.project-workspace .pw-panel fluent-data-grid {
    --neutral-layer-1: var(--tl-surface);
    --neutral-layer-2: var(--tl-surface-alt);
    --neutral-layer-3: var(--tl-surface-alt);
    --neutral-stroke-rest: var(--tl-border);
    --neutral-foreground-rest: var(--tl-text);
    --neutral-foreground-hint: var(--tl-text-2);
}

.project-workspace .pw-panel fluent-card,
.project-workspace .pw-panel fluent-dialog {
    --neutral-layer-1: var(--tl-surface-alt);
    --neutral-stroke-rest: var(--tl-border);
    --neutral-foreground-rest: var(--tl-text);
    box-shadow: none !important;
}

/* FluentCard/FluentInputFile render as plain (non-shadow-DOM) divs with these classes,
   defaulting to a generic dark gray that clashes with the navy panel chrome - confirmed
   live via browser_evaluate against a running Documents tab upload area. */
.project-workspace .pw-panel .fluent-card-minimal-style,
.project-workspace .pw-panel .fluent-inputfile-container {
    background: var(--tl-surface-alt) !important;
    border-color: var(--tl-border) !important;
    color: var(--tl-text) !important;
}

.project-workspace .pw-panel [style*="dashed"] {
    border-color: var(--tl-border) !important;
}
