/* Projects list: grid, cards, filters, listing chrome */
/* Projects domain (list, detail, wizard, creator) - extracted from main.css */

/* --- Projects Placeholder --- */
.projects-placeholder {
    text-align: center;
    grid-column: 1 / -1;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* --- Projects Section --- */
.projects-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.filter-btn {
    height: 28px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.filter-btn:hover {
    color: var(--text-secondary);
}

.filter-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* --- Projects Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.project-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.project-group-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-group-count {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 650;
}

.projects-placeholder.compact {
    min-height: 92px;
    display: flex;
    align-items: center;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

@media (max-width: 1100px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .projects-grid { grid-template-columns: 1fr; }
}

/* --- Project Card --- */
.project-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition-speed),
                border-color var(--transition-speed),
                box-shadow var(--transition-speed);
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.project-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.project-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-repo {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.project-card-pct {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.project-card-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-badge {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.status-pill {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.project-overview-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.project-overview-summary {
    padding: 2px 2px 20px;
}

.project-overview-summary h2 {
    margin: 6px 0 8px;
    font-size: 20px;
    line-height: 1.25;
}

.project-overview-summary > p {
    margin: 0;
    max-width: 68ch;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-overview-details {
    border-top: 1px solid var(--border);
}

.overview-detail-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 2px;
    border-bottom: 1px solid var(--border);
}

.overview-detail-row:last-child {
    border-bottom: 0;
}

.overview-detail-icon,
.overview-stage-indicator {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.overview-stage-indicator {
    gap: 3px;
}

.overview-stage-indicator span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
}

.overview-stage-indicator.active span {
    background: var(--accent);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.overview-stage-indicator.active span:nth-child(2) { animation-delay: 0.2s; }
.overview-stage-indicator.active span:nth-child(3) { animation-delay: 0.4s; }

.overview-detail-content {
    min-width: 0;
}

.overview-detail-value {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

a.overview-detail-value:hover {
    color: var(--accent);
}

.overview-detail-help {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.overview-edit-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.overview-edit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.overview-edit-row .btn-sm {
    min-height: 40px;
}

.overview-kicker {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.repo-destination-options {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.repo-destination-option {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    background: transparent;
    text-align: left;
}

button.repo-destination-option:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--text-muted) 62%, transparent);
    background: var(--bg-hover);
}

.repo-destination-option.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.repo-destination-option.unavailable {
    color: var(--text-secondary);
}

.repo-destination-option:disabled {
    cursor: wait;
    opacity: 0.72;
}

.repo-destination-option strong,
.repo-destination-option small {
    display: block;
}

.repo-destination-option strong {
    font-size: 14px;
}

.repo-destination-option small {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.repo-destination-radio {
    width: 14px;
    height: 14px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
}

.repo-destination-option.selected .repo-destination-radio {
    border: 4px solid var(--accent);
}

.repo-visibility-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 48px;
    padding: 2px 0 0;
}

.repo-visibility-copy strong,
.repo-visibility-copy small {
    display: block;
}

.repo-visibility-copy strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.repo-visibility-copy small {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.repo-visibility-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    padding: 2px;
    border: 0;
    border-radius: 999px;
    background: var(--bg-hover);
    transition: background-color 160ms ease;
}

.repo-visibility-switch > span {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 160ms ease;
}

.repo-visibility-switch.on {
    background: var(--accent);
}

.repo-visibility-switch.on > span {
    transform: translateX(20px);
}

.repo-visibility-switch:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}

.repo-visibility-switch:disabled {
    cursor: wait;
    opacity: 0.7;
}

.repo-check-connection {
    margin-top: 24px;
}

.repo-destination-preview {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.repo-destination-preview code {
    min-width: 0;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .repo-destination-option {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .repo-destination-option .btn-sm {
        grid-column: 2;
        width: fit-content;
    }
}

.status-dev {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-released {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.btn-ghost.btn-sm {
    height: 26px;
    padding: 0 10px;
    font-size: 14px;
}

.project-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-card-avatars {
    display: flex;
    align-items: center;
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: -6px;
}

.mini-avatar:first-child {
    margin-left: 0;
}

.mini-avatar.extra {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 14px;
}

.delivery-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    transition: background var(--transition-speed);
}

.delivery-link:hover {
    background: rgba(34, 197, 94, 0.1);
}

.delivery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.project-card-activity {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card wrapper hosts the full-card link plus a sibling "open in new tab"
   affordance. The button is a sibling (not nested in the card anchor) to keep
   the markup valid - anchors can't nest.
 */
.project-card-wrap {
    position: relative;
}

.project-card-open {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    opacity: 0.55;
    transition: opacity var(--transition-speed),
                color var(--transition-speed),
                background var(--transition-speed),
                border-color var(--transition-speed);
}

.project-card-wrap:hover .project-card-open {
    opacity: 1;
}

.project-card-open:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.project-card-open:focus-visible {
    opacity: 1;
    outline: none;
    border-color: var(--text-muted);
}

/* Project list status pills */
.status-live {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-working {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-stalled {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-planning {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.status-idle {
    background: rgba(113, 113, 122, 0.15);
    color: var(--text-muted);
}

/* Light mode: the pill text colours above are tuned for a dark translucent
   chip. On the near-white light card the same pastels fail contrast, so swap to
   deeper 700-level shades (faint tint + dark text = standard readable badge). */
[data-theme="light"] .status-live {
    color: #15803d;
}

[data-theme="light"] .status-done {
    color: #047857;
}

[data-theme="light"] .status-working {
    color: #1d4ed8;
}

[data-theme="light"] .status-stalled {
    color: #b45309;
}

[data-theme="light"] .status-planning {
    color: #7e22ce;
}

[data-theme="light"] .status-idle {
    color: #52525b;
}


/* --- Projects Listing --- */
/* Projects list page fills the available width: drop the fixed 1280px cap and
   let cards reflow by min-width so the column count grows on wide screens and
   collapses on zoom-in. Scoped to the list page; dashboard grids keep
   their fixed 3-column layout. */
.projects-listing .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.projects-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

