/* File: /assets/css/project.css */
/* Purpose: Shared Project page styling with improved consistency for setup,
   media, navigation, dashboard-linked states, and responsive actions. */

.project-page {
    max-width: 1240px;
    margin: 0 auto;
    padding-bottom: 2.5rem;
}

.project-back-link {
    display: inline-block;
    margin: 1.25rem 0 0;
    color: #155eef;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.project-back-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.project-hero {
    margin: 1rem 0 0;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 0.85rem 0.85rem 0 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(251, 191, 36, 0.18),
            transparent 35%
        ),
        linear-gradient(135deg, #0f172a, #1e293b 65%, #0f766e);
    color: #ffffff;
}

.project-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.project-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.project-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    margin-top: 0.75rem;
    color: #dbeafe;
    font-size: 0.9rem;
}

.project-hero-meta span::before {
    margin-right: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    content: '•';
}

.project-hero-meta span:first-child::before {
    display: none;
}

.project-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.project-button {
    display: inline-block;
    padding: 0.65rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.project-button:hover {
    transform: translateY(-1px);
}

.project-button-primary {
    background: #fbbf24;
    color: #422006;
}

.project-button-primary:hover {
    background: #f59e0b;
    color: #422006;
}

.project-button-secondary {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.project-button-secondary:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(15, 23, 42, 0.34);
    color: #ffffff;
}

.project-hero-progress {
    margin-top: 1.65rem;
}

.project-hero-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 800;
}

.project-hero-progress-track {
    width: 100%;
    height: 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.project-hero-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fbbf24, #fde68a);
}

.project-navigation {
    display: flex;
    overflow-x: auto;
    border: 1px solid #dfe3e8;
    border-top: 0;
    background: #ffffff;
}

.project-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border-bottom: 3px solid transparent;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.project-navigation a:hover,
.project-navigation a.active {
    border-bottom-color: #0f766e;
    color: #0f766e;
}

.project-nav-count {
    display: inline-flex;
    min-width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.38rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.project-navigation a:hover .project-nav-count,
.project-navigation a.active .project-nav-count {
    background: #ccfbf1;
    color: #0f766e;
}

.project-content {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #dfe3e8;
    border-radius: 0.65rem;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e4e9ef;
    background: #f8fafc;
}

.project-card-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.project-card-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.project-card-action {
    display: inline-block;
    padding: 0.48rem 0.65rem;
    border-radius: 0.35rem;
    background: #0f766e;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.project-card-action:hover {
    background: #115e59;
    color: #ffffff;
    transform: translateY(-1px);
}

.project-media-card .project-card-header {
    align-items: flex-start;
}

.project-media-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.project-media-card-actions .project-card-action {
    text-align: center;
}

.project-card-body {
    padding: 1.25rem;
}

.project-muted {
    color: #64748b;
    font-size: 0.84rem;
}

.project-summary {
    margin: 0;
    color: #334155;
    line-height: 1.65;
}

.project-completion-record {
    padding: 1rem 0;
    border-bottom: 1px solid #edf0f4;
}

.project-completion-record:first-child {
    padding-top: 0;
}

.project-completion-record:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.project-completion-record h3 {
    margin: 0 0 0.35rem;
    color: #0f172a;
    font-size: 0.92rem;
}

.project-completion-record p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

.project-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.project-spec {
    padding: 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
}

.project-spec span {
    display: block;
    margin-bottom: 0.2rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.project-spec strong {
    display: block;
    color: #0f172a;
    font-size: 0.9rem;
}

.project-build-area {
    padding: 0.95rem 0;
    border-bottom: 1px solid #edf0f4;
}

.project-build-area:first-child {
    padding-top: 0;
}

.project-build-area:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.project-build-area-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-build-area-name {
    font-size: 0.93rem;
    font-weight: 800;
}

.project-build-area-link {
    color: #0f172a;
    text-decoration: none;
}

.project-build-area-link:hover {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.project-build-area-open-link {
    display: inline-block;
    margin-top: 0.4rem;
    color: #0f766e;
    font-size: 0.77rem;
    font-weight: 800;
    text-decoration: none;
}

.project-build-area-open-link:hover {
    color: #115e59;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.project-build-area-meta {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.8rem;
}

.project-build-area-progress {
    width: 100%;
    height: 0.45rem;
    margin-top: 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.project-build-area-progress div {
    height: 100%;
    border-radius: inherit;
    background: #2dd4bf;
}

.project-status-badge {
    display: inline-block;
    padding: 0.23rem 0.48rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.project-status-idea,
.project-status-planning {
    background: #fef3c7;
    color: #92400e;
}

.project-status-building,
.project-status-in_progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.project-status-paused,
.project-status-archived,
.project-status-not_started,
.project-status-skipped {
    background: #e2e8f0;
    color: #475569;
}

.project-status-completed,
.project-status-complete {
    background: #d1fae5;
    color: #047857;
}

.project-component,
.project-update {
    padding: 0.9rem 0;
    border-bottom: 1px solid #edf0f4;
}

.project-component:first-child,
.project-update:first-child {
    padding-top: 0;
}

.project-component:last-child,
.project-update:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.project-component strong,
.project-update strong {
    display: block;
    color: #0f172a;
    font-size: 0.92rem;
}

.project-component-meta,
.project-update-meta {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.8rem;
}

.project-update-content {
    margin: 0.45rem 0 0;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.5;
}

.project-stat-list {
    display: grid;
    gap: 0.75rem;
}

.project-stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #edf0f4;
}

.project-stat-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.project-stat-row span {
    color: #64748b;
    font-size: 0.84rem;
}

.project-stat-row strong {
    color: #0f172a;
    font-size: 0.92rem;
    text-align: right;
}

.project-empty {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: center;
}

.project-alert {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 0.55rem;
}

.project-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.project-not-found {
    max-width: 720px;
    margin: 3rem auto;
    padding: 2rem;
    border: 1px solid #dfe3e8;
    border-radius: 0.7rem;
    background: #ffffff;
    text-align: center;
}

.project-not-found h1 {
    margin: 0;
    color: #0f172a;
}

.project-not-found p {
    margin: 0.75rem 0 1.25rem;
    color: #64748b;
    line-height: 1.55;
}

/* Added shared documentation/setup state helpers */
.project-setup-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.project-setup-chip {
    display: inline-block;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.project-setup-chip-neutral {
    background: #e2e8f0;
    color: #475569;
}

.project-setup-chip-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.project-setup-chip-success {
    background: #d1fae5;
    color: #047857;
}

.project-setup-chip-warning {
    background: #fef3c7;
    color: #92400e;
}

.project-setup-chip-danger {
    background: #fee2e2;
    color: #991b1b;
}

.project-helper-text {
    margin-top: 0.55rem;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.45;
}

.project-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.project-inline-link {
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.project-inline-link:hover {
    color: #115e59;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

@media (max-width: 960px) {
    .project-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .project-hero-top,
    .project-build-area-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-hero-actions {
        justify-content: flex-start;
    }

    .project-spec-grid {
        grid-template-columns: 1fr;
    }

    .project-media-card .project-card-header {
        flex-direction: column;
    }

    .project-media-card-actions {
        justify-content: flex-start;
    }

    .project-navigation a {
        padding: 0.85rem 0.9rem;
    }
}