/* komunita.bastlworld.eu — detail projektu */

.cm-show-wrap {
    padding: 6.5rem 0 2rem;
}

.cm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bw-muted);
    text-decoration: none;
    font-size: 0.86rem;
    margin-bottom: 18px;
    transition: color .15s;
}
.cm-back-link:hover { color: var(--bw-accent); }

.cm-show-header {
    margin-bottom: 24px;
}
.cm-show-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 6px 0 12px;
    color: #fff;
    line-height: 1.2;
}

.cm-show-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cm-show-cover {
    width: 100%;
    height: 260px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(11,15,26,.85);
    font-size: 5.5rem;
    margin-bottom: 24px;
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
    overflow: hidden;
}
.cm-show-cover-image { padding: 0; }
.cm-show-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cm-show-cover i {
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
}

/* ----- TABS ----- */
.cm-tabs {
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
}
.cm-tabs .nav-link {
    background: transparent;
    border: 0;
    color: var(--bw-muted);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 10px 14px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
}
.cm-tabs .nav-link:hover {
    color: var(--bw-accent);
    background: rgba(126,231,135,.06);
}
.cm-tabs .nav-link.active {
    color: var(--bw-accent);
    background: transparent;
    border-bottom-color: var(--bw-accent);
}
.cm-tab-count {
    background: rgba(255,255,255,.06);
    color: var(--bw-muted);
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
    margin-left: 4px;
}
.cm-tabs .nav-link.active .cm-tab-count {
    background: rgba(126,231,135,.18);
    color: var(--bw-accent);
}

.cm-tab-content {
    padding: 24px 0;
}
.cm-tab-content .lead { color: #c6d1d9; font-size: 1.02rem; }
.cm-tab-content ul, .cm-tab-content ol {
    color: #c6d1d9;
    padding-left: 1.3rem;
}
.cm-tab-content li { padding: 4px 0; }

/* ----- "Vše" — sekce pod sebou ----- */
.cm-section {
    padding: 22px 0 26px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.cm-section:last-child { border-bottom: 0; }
.cm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}
.cm-section-title i { color: var(--bw-accent); font-size: 1.1rem; }

/* ----- Parts ----- */
.cm-parts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cm-part-row {
    display: grid;
    grid-template-columns: 50px 1fr 90px auto;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bw-card);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    transition: border-color .15s;
}
.cm-part-row:hover { border-color: rgba(126,231,135,.2); }
.cm-part-qty {
    font-family: 'Roboto Mono', monospace;
    color: var(--bw-accent);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}
.cm-part-name { color: #fff; font-weight: 600; font-size: 0.92rem; }
.cm-part-note { color: var(--bw-muted); font-size: 0.78rem; }
.cm-part-price {
    font-family: 'Roboto Mono', monospace;
    color: #c6d1d9;
    font-weight: 700;
    font-size: 0.88rem;
    text-align: right;
}
.cm-part-action {
    text-align: right;
}

.cm-parts-total {
    padding: 12px 16px;
    background: var(--bw-card-2);
    border-radius: 10px;
    font-size: 0.95rem;
}
.cm-parts-total b { color: var(--bw-accent); }

@media (max-width: 575.98px) {
    .cm-part-row {
        grid-template-columns: 40px 1fr;
        gap: 8px;
    }
    .cm-part-price, .cm-part-action {
        grid-column: 2 / 3;
        text-align: left;
    }
}

/* ----- Schéma placeholder ----- */
.cm-schema-placeholder {
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px dashed rgba(255,255,255,.1);
    border-radius: 12px;
    background: var(--bw-card-2);
    color: var(--bw-muted);
}
.cm-schema-placeholder i { font-size: 3rem; color: var(--bw-accent); }

/* ----- Kód — multi-soubor viewer (Prism.js + tabs) ----- */
.cm-code-viewer {
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    background: #060a15;
}
.cm-code-files-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.02);
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 6px 8px;
    gap: 10px;
}
.cm-code-files-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.cm-code-files-tabs::-webkit-scrollbar { display: none; }
.cm-code-file-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--bw-muted);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cm-code-file-tab i { color: var(--bw-accent); font-size: 0.85rem; }
.cm-code-file-tab:hover {
    background: rgba(126,231,135,.06);
    color: #c6d1d9;
}
.cm-code-file-tab.active {
    background: rgba(126,231,135,.14);
    color: var(--bw-accent);
}
.cm-code-files-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.cm-code-files-actions .btn-sm {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.cm-code-files-panes {
    position: relative;
}
.cm-code-file-pane {
    display: none;
}
.cm-code-file-pane.active {
    display: block;
}
.cm-code-pre {
    margin: 0 !important;
    background: #060a15 !important;
    padding: 16px !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
    border-radius: 0 !important;
    overflow-x: auto;
}
.cm-code-pre code {
    font-family: 'Roboto Mono', monospace !important;
    font-size: inherit !important;
    background: transparent !important;
    text-shadow: none !important;
}

/* Prism Tomorrow override — sladit s naším zeleným akcentem */
.cm-code-pre .token.comment,
.cm-code-pre .token.prolog,
.cm-code-pre .token.doctype,
.cm-code-pre .token.cdata { color: #6b7280; font-style: italic; }

.cm-code-pre .token.keyword,
.cm-code-pre .token.boolean,
.cm-code-pre .token.macro.property { color: #7ee787; }

.cm-code-pre .token.string,
.cm-code-pre .token.char,
.cm-code-pre .token.attr-value { color: #ffd580; }

.cm-code-pre .token.number,
.cm-code-pre .token.constant { color: #a78bfa; }

.cm-code-pre .token.function,
.cm-code-pre .token.class-name { color: #7cc5ff; }

.cm-code-pre .token.operator,
.cm-code-pre .token.punctuation { color: #c6d1d9; }

.cm-code-pre .token.property,
.cm-code-pre .token.variable { color: #e6edf3; }

.cm-code-pre .token.directive,
.cm-code-pre .token.directive-hash,
.cm-code-pre .token.macro { color: #f59e0b; }

@media (max-width: 575.98px) {
    .cm-code-files-bar { flex-direction: column; align-items: stretch; gap: 6px; }
    .cm-code-files-actions { justify-content: flex-end; }
}

/* ----- Galerie ----- */
.cm-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.cm-gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
    cursor: zoom-in;
    transition: transform .15s, border-color .15s;
    display: block;
    background: var(--bw-card-2);
}
.cm-gallery-item:hover {
    transform: scale(1.03);
    border-color: rgba(126,231,135,.35);
}
.cm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.cm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(6, 10, 21, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.cm-lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.cm-lightbox-close,
.cm-lightbox-nav {
    position: absolute;
    background: rgba(11,15,26,.7);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background .15s, transform .15s;
}
.cm-lightbox-close:hover,
.cm-lightbox-nav:hover {
    background: rgba(126,231,135,.2);
    transform: scale(1.05);
}
.cm-lightbox-close { top: 20px; right: 20px; }
.cm-lightbox-prev { left: 20px; }
.cm-lightbox-next { right: 20px; }
.cm-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bw-muted);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.86rem;
    background: rgba(11,15,26,.7);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 575.98px) {
    .cm-lightbox-close,
    .cm-lightbox-nav { width: 36px; height: 36px; font-size: 0.95rem; }
}

/* ----- Komentáře ----- */
.cm-comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* ----- Sidebar — užší, jen akce ----- */
.cm-sidebar-sticky {
    position: sticky;
    top: 90px;
}
.cm-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bw-card);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 8px;
}
.cm-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #c6d1d9;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all .15s;
    width: 100%;
}
.cm-action-btn i {
    font-size: 1.05rem;
    color: var(--bw-muted);
    transition: color .15s;
}
.cm-action-btn span { flex: 1; }
.cm-action-btn b {
    font-size: 0.78rem;
    color: var(--bw-muted);
    font-weight: 700;
}
.cm-action-btn:hover {
    background: rgba(126,231,135,.06);
    color: var(--bw-accent);
}
.cm-action-btn:hover i { color: var(--bw-accent); }
.cm-action-btn:hover b { color: var(--bw-accent); }

.cm-action-primary {
    background: rgba(126,231,135,.12);
    color: var(--bw-accent);
}
.cm-action-primary i { color: var(--bw-accent); }
.cm-action-primary:hover { background: rgba(126,231,135,.18); }

.cm-action-like.active i,
.cm-action-like.active { color: #f87171; }

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
    .cm-sidebar-sticky { position: static; }
    .cm-sidebar-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cm-action-btn {
        flex: 1 1 calc(33% - 6px);
        flex-direction: column;
        gap: 4px;
        padding: 10px 6px;
        text-align: center;
    }
    .cm-action-btn span { flex: none; font-size: 0.78rem; }
    .cm-action-btn b { display: none; }
}
@media (max-width: 575.98px) {
    .cm-show-wrap { padding-top: 5.5rem; }
    .cm-show-title { font-size: 1.5rem; }
    .cm-show-cover { height: 180px; font-size: 3.5rem; }
}

/* ===== 3D modely v detailu projektu ===== */
.cm-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.cm-model-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bw-card-2);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all .15s;
}
.cm-model-card:hover {
    border-color: rgba(126,231,135,.35);
    background: rgba(126,231,135,.04);
    transform: translateY(-1px);
}
.cm-model-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(126,231,135,.14);
    color: var(--bw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.cm-model-card-body { flex: 1; min-width: 0; }
.cm-model-card-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cm-model-card-host {
    color: var(--bw-muted);
    font-size: 0.76rem;
    font-family: 'Roboto Mono', monospace;
    margin-top: 2px;
}
.cm-model-card-cta {
    color: var(--bw-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ===== Schéma v detailu ===== */
.cm-schema-image {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
}

/* Inline preview (SVG render z schema_data) */
.cm-schema-preview-wrap {
    background: var(--bw-card-2);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    overflow: hidden;
}
.cm-schema-preview-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,.015);
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: 0.85rem;
    color: var(--bw-muted);
}
.cm-schema-preview-meta i { color: var(--bw-accent); }
.cm-schema-preview-meta span b { color: #fff; }
.cm-schema-cad-link {
    color: var(--bw-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
}
.cm-schema-cad-link:hover { text-decoration: underline; }

.cm-schema-preview {
    width: 100%;
    height: 480px;
    background: #060a15;
    position: relative;
}
.cm-schema-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--bw-muted);
    font-size: 0.88rem;
}
.cm-schema-preview-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--bw-muted);
}
.cm-schema-preview-empty i {
    font-size: 2.5rem;
    color: var(--bw-muted);
}
.cm-schema-preview-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG vnitřní styly (sjednocené se SchemaBuilder) */
.cm-schema-preview-svg .bw-node-bg {
    fill: #11161f;
    stroke: rgba(126,231,135,.18);
    stroke-width: 1.5;
}
.cm-schema-preview-svg .bw-node-kicker {
    fill: #7ee787;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.cm-schema-preview-svg .bw-node-title {
    fill: #fff;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 700;
}
.cm-schema-preview-svg .bw-node-value {
    fill: #c6d1d9;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
}
.cm-schema-preview-svg .bw-pin-label {
    fill: #8b949e;
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
}

@media (max-width: 575.98px) {
    .cm-schema-preview { height: 320px; }
}

/* ===== Komentáře — empty state ===== */
.cm-comments-empty {
    text-align: center;
    padding: 32px 20px;
    border: 1px dashed rgba(255,255,255,.08);
    border-radius: 12px;
    background: var(--bw-card-2);
}
.cm-comments-empty-icon {
    font-size: 2rem;
    color: var(--bw-muted);
    display: block;
    margin-bottom: 8px;
}

/* ===== Markdown render — popis ===== */
.cm-md-body p {
    color: #c6d1d9;
    line-height: 1.65;
    margin-bottom: 12px;
}
.cm-md-body ul, .cm-md-body ol {
    color: #c6d1d9;
    padding-left: 22px;
    margin-bottom: 12px;
}
.cm-md-body li { margin-bottom: 4px; }
.cm-md-body h2, .cm-md-body h3, .cm-md-body h4 {
    color: #fff;
    margin-top: 20px;
    margin-bottom: 10px;
}
.cm-md-body code {
    background: rgba(126,231,135,.1);
    color: var(--bw-accent);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Roboto Mono', monospace;
}
.cm-md-body .cm-md-pre {
    background: #060a15;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 14px 16px;
    color: #e6edf3;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    overflow-x: auto;
    margin: 12px 0;
}
.cm-md-body .cm-md-pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
