/* ==========================================================================
   Project Detail Pages Stylesheet (Modern, Tech-Forward, Consistent)
   ========================================================================== */

.project-detail-main {
    padding-top: 40px;
    padding-bottom: 80px;
}

.project-detail-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Breadcrumb & Top Bar */
.detail-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-hairline);
    transition: all 0.25s ease;
}

.detail-back-link:hover {
    color: var(--accent-teal);
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(-3px);
}

.detail-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(251, 146, 60, 0.12);
    color: #FB923C;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

/* Hero Section */
.detail-hero {
    margin-bottom: 48px;
}

.detail-hero-header {
    margin-bottom: 28px;
}

.detail-hero-title {
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 14px;
    font-family: 'Montserrat', sans-serif;
}

.detail-hero-subtitle {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 820px;
    margin-bottom: 20px;
}

.detail-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
}

.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-hairline);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.detail-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.detail-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* 16:9 Cover Image Slot */
.detail-cover-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #0E1626;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    margin-bottom: 48px;
}

.detail-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #090E17;
    display: block;
}

/* Fallback Cover Placeholder */
.detail-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 32px;
    text-align: center;
    background: #0E1626;
}

.detail-placeholder-icon-wrap {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #38BDF8;
}

.detail-placeholder-badge {
    position: relative;
    z-index: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #E2E8F0;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.detail-placeholder-meta {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Sections Architecture */
.detail-section {
    margin-bottom: 56px;
}

.detail-section-title {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-section-icon {
    color: var(--accent-teal);
    display: inline-flex;
}

.detail-prose {
    color: #CBD5E1;
    font-size: 16px;
    line-height: 1.75;
}

.detail-prose p {
    margin-bottom: 16px;
}

.detail-prose strong {
    color: #F8FAFC;
    font-weight: 600;
}

/* Grid & Cards within detail sections */
.detail-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-card {
    background: #111B2E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-card-title {
    font-size: 17px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-primary);
    margin: 0;
}

.detail-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}

/* Key Metrics / Overview Pills */
.detail-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.overview-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-hairline);
    border-radius: 14px;
    padding: 16px;
}

.overview-pill-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-teal);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.overview-pill-value {
    font-size: 14.5px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Workflow Step-by-Step Flow */
.workflow-steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 28px;
}

.workflow-steps-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-teal) 0%, rgba(56, 189, 248, 0.1) 100%);
}

.workflow-step-item {
    position: relative;
    background: #111B2E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.workflow-step-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(4px);
}

.workflow-step-marker {
    position: absolute;
    left: -28px;
    top: 24px;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0B1120;
    border: 2px solid var(--accent-teal);
    color: var(--accent-teal);
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.workflow-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-step-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}

.workflow-step-node-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #94A3B8;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.workflow-step-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Visual Interactive Flow / Diagram Box */
.diagram-canvas-card {
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 24px;
    overflow-x: auto;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.diagram-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.diagram-title-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-teal);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Horizontal Pipeline / Branching Visuals */
.pipeline-visual {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 600px;
}

.pipeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-stage {
    flex: 1;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
    transition: all 0.25s ease;
}

.pipeline-stage:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: #243248;
}

.pipeline-stage-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #94A3B8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pipeline-stage-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #F8FAFC;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 2px;
}

.pipeline-stage-sub {
    font-size: 11.5px;
    color: #94A3B8;
    line-height: 1.4;
}

.pipeline-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38BDF8;
    flex-shrink: 0;
}

/* Tech Highlights List */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.highlight-item {
    background: #111B2E;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.highlight-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    color: #38BDF8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.highlight-content h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    margin: 0 0 4px 0;
}

.highlight-content p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

/* Limitations / Caveats Box */
.limitations-box {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #F59E0B;
    border-radius: 12px;
    padding: 20px 24px;
}

.limitations-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #FCD34D;
    margin-bottom: 10px;
}

.limitations-list {
    margin: 0;
    padding-left: 20px;
    color: #94A3B8;
    font-size: 14px;
    line-height: 1.6;
}

.limitations-list li {
    margin-bottom: 8px;
}

.limitations-list li:last-child {
    margin-bottom: 0;
}

/* Bottom Project-to-Project Navigation */
.project-pagination-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination-card {
    background: #111B2E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 24px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.25s ease;
}

.pagination-card.next-card {
    text-align: right;
    align-items: flex-end;
}

.pagination-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
    background: #15223A;
}

.pagination-direction {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-teal);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-title {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-primary);
}

/* Light Mode Overrides for Detail Pages */
body.light-mode .detail-top-nav .detail-back-link {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #475569;
}

body.light-mode .detail-top-nav .detail-back-link:hover {
    background: #E2E8F0;
    color: #0284C7;
}

body.light-mode .detail-cover-slot {
    background: #F8FAFC;
    border-color: #E2E8F0;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.1);
}

body.light-mode .detail-cover-placeholder {
    background: radial-gradient(circle at 50% 30%, rgba(2, 132, 199, 0.08), #F8FAFC);
}

body.light-mode .detail-placeholder-icon-wrap {
    background: #FFFFFF;
    border-color: rgba(2, 132, 199, 0.25);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.15);
}

body.light-mode .detail-card,
body.light-mode .workflow-step-item,
body.light-mode .highlight-item,
body.light-mode .pagination-card {
    background: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.06);
}

body.light-mode .detail-hero-title,
body.light-mode .detail-section-title,
body.light-mode .detail-card-title,
body.light-mode .workflow-step-title,
body.light-mode .highlight-content h4,
body.light-mode .pagination-title {
    color: #0F172A;
}

body.light-mode .detail-prose {
    color: #334155;
}

body.light-mode .detail-prose strong {
    color: #0F172A;
}

body.light-mode .detail-card p,
body.light-mode .workflow-step-desc,
body.light-mode .highlight-content p,
body.light-mode .detail-hero-subtitle {
    color: #64748B;
}

body.light-mode .overview-pill {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

body.light-mode .overview-pill-value {
    color: #0F172A;
}

body.light-mode .detail-badge {
    background: #F1F5F9;
    border-color: #E2E8F0;
    color: #1E293B;
}

body.light-mode .diagram-canvas-card {
    background: #F8FAFC;
    border-color: #CBD5E1;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-mode .diagram-header-bar {
    border-bottom-color: #E2E8F0;
}

body.light-mode .pipeline-stage {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

body.light-mode .pipeline-stage:hover {
    background: #F1F5F9;
    border-color: #38BDF8;
}

body.light-mode .pipeline-stage-name {
    color: #0F172A;
}

body.light-mode .pipeline-stage-sub,
body.light-mode .pipeline-stage-type {
    color: #64748B;
}

body.light-mode .workflow-steps-list::before {
    background: linear-gradient(180deg, #0284C7 0%, rgba(2, 132, 199, 0.15) 100%);
}

body.light-mode .workflow-step-marker {
    background: #FFFFFF;
    border-color: #0284C7;
    color: #0284C7;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.25);
}

body.light-mode .limitations-box {
    background: #FFFBEB;
    border-color: #FDE68A;
    border-left-color: #D97706;
}

body.light-mode .limitations-box-header {
    color: #B45309;
}

body.light-mode .limitations-list {
    color: #78350F;
}

body.light-mode .project-pagination-nav {
    border-top-color: #E2E8F0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .project-detail-container {
        padding: 0 18px;
    }

    .detail-grid-2 {
        grid-template-columns: 1fr;
    }

    .project-pagination-nav {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pagination-card.next-card {
        text-align: left;
        align-items: flex-start;
    }

    .workflow-steps-list {
        padding-left: 20px;
    }

    .workflow-steps-list::before {
        left: 8px;
    }

    .workflow-step-marker {
        left: -20px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .workflow-step-item {
        padding: 16px 18px;
    }

    .detail-card {
        padding: 18px 20px;
    }
}
