/* Comprehensive Guidance UI Styles — Per-Technology Dropdowns */

/* ── Root container ── */
.cg-root {
    margin: 16px 0 8px;
    border-radius: 10px;
    overflow: hidden;
}

/* ── Header bar ── */
.cg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
    border-radius: 10px 10px 0 0;
}

.cg-title {
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #8b8fa3);
}

.cg-count {
    font-size: 0.72rem;
    color: var(--text-secondary, #8b8fa3);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* ── Technology list ── */
.cg-techs {
    border: 1px solid var(--border-color, #2e3148);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

/* ── Individual tech dropdown ── */
.cg-tech-dropdown {
    border-bottom: 1px solid var(--border-color, #2e3148);
}

.cg-tech-dropdown:last-child {
    border-bottom: none;
}

/* ── Summary row (collapsed) ── */
.cg-tech-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: rgba(15, 17, 23, 0.6);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    transition: background 0.15s ease;
    font-size: 0.88rem;
}

.cg-tech-summary::-webkit-details-marker {
    display: none;
}

.cg-tech-summary::marker {
    content: '';
}

.cg-tech-summary:hover {
    background: var(--bg-tertiary, #1e2030);
}

.cg-tech-dropdown[open] > .cg-tech-summary {
    background: var(--bg-tertiary, #1e2030);
    border-bottom: 1px solid var(--border-color, #2e3148);
}

/* ── Icon ── */
.cg-tech-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cg-tech-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ── Name ── */
.cg-tech-name {
    font-weight: 500;
    color: var(--text-primary, #e4e5ea);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Badges (cost / effort) on summary line ── */
.cg-badges {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.cg-badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.cg-badge-cost {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.cg-badge-effort {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.cg-badge-fedramp-high {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.cg-badge-fedramp-mod {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.cg-badge-fedramp-ip {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.cg-badge-spa {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.cg-badge-cui {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.cg-badge-crma {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* ── Chevron ── */
.cg-chevron {
    flex-shrink: 0;
    color: var(--text-secondary, #8b8fa3);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.cg-tech-dropdown[open] > .cg-tech-summary .cg-chevron {
    transform: rotate(180deg);
}

/* ── Body (expanded content) ── */
.cg-tech-body {
    padding: 14px 16px 16px;
    background: rgba(10, 10, 15, 0.5);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary, #e4e5ea);
}

/* ── Service / Feature tags ── */
.cg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.cg-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary, #1e2030);
    color: var(--accent-blue, #6c8aff);
    border: 1px solid var(--border-color, #2e3148);
    font-weight: 500;
    white-space: nowrap;
}

/* ── Approach / summary text ── */
.cg-approach {
    margin: 0 0 12px;
    color: var(--text-secondary, #8b8fa3);
    font-style: italic;
}

.cg-approach strong {
    font-style: normal;
    color: var(--text-primary, #e4e5ea);
}

/* ── Implementation steps ── */
.cg-steps {
    margin: 10px 0;
}

.cg-steps-title {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #8b8fa3);
    margin-bottom: 6px;
}

.cg-steps ol,
.cg-steps ul {
    margin: 0 0 0 20px;
    padding: 0;
}

.cg-steps li {
    margin-bottom: 5px;
    line-height: 1.55;
}

.cg-steps li strong {
    color: var(--accent-blue, #6c8aff);
}

/* ── Code examples ── */
.cg-code {
    margin: 10px 0;
    border: 1px solid var(--border-color, #2e3148);
    border-radius: 6px;
    overflow: hidden;
}

.cg-code summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue, #6c8aff);
    background: var(--bg-tertiary, #1e2030);
    user-select: none;
    list-style: none;
}

.cg-code summary::-webkit-details-marker {
    display: none;
}

.cg-code summary::marker {
    content: '';
}

.cg-code summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cg-code summary svg {
    flex-shrink: 0;
    color: var(--accent-blue, #6c8aff);
}

.cg-code pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-color, #2e3148);
}

.cg-code code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-primary, #e4e5ea);
}

/* ── Verification ── */
.cg-verify {
    margin: 12px 0 4px;
}

.cg-verify-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #34d399;
    margin-bottom: 6px;
}

.cg-verify ul {
    margin: 0 0 0 20px;
    padding: 0;
}

.cg-verify li {
    margin-bottom: 4px;
    line-height: 1.5;
    color: var(--text-primary, #e4e5ea);
}

/* ── Cost meta row (inside body) ── */
.cg-meta-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cg-meta {
    font-size: 0.76rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
}

.cg-meta-cost {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cg-tech-summary {
        padding: 8px 10px;
        gap: 8px;
        font-size: 0.82rem;
    }

    .cg-tech-body {
        padding: 10px 12px 14px;
    }

    .cg-badges {
        display: none;
    }

    .cg-code pre {
        font-size: 0.75rem;
    }
}

/* ── Unified top-level guidance sections ── */
.cg-objective-summary {
    margin: 0 0 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary, #e4e5ea);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent-blue, #6c8aff);
    border-radius: 0 6px 6px 0;
}

.cg-unified-section {
    margin: 8px 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.cg-unified-section p {
    margin: 4px 0 0;
    color: var(--text-primary, #e4e5ea);
}

.cg-unified-section ul,
.cg-unified-section ol {
    margin: 6px 0 0 20px;
    padding: 0;
}

.cg-unified-section li {
    margin-bottom: 4px;
    line-height: 1.55;
    color: var(--text-primary, #e4e5ea);
}

.cg-unified-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #8b8fa3);
}

.cg-unified-section-title svg {
    flex-shrink: 0;
}

.cg-unified-steps {
    margin: 6px 0 0 20px;
    padding: 0;
}

.cg-unified-steps li {
    margin-bottom: 5px;
    line-height: 1.55;
    color: var(--text-primary, #e4e5ea);
}

.cg-quick-win {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 6px;
    font-size: 0.82rem;
    color: #34d399;
}

.cg-quick-win strong {
    color: #34d399;
}

/* Automation section */
.cg-unified-automation {
    border-left: 3px solid var(--accent-blue, #6c8aff);
}

.cg-unified-automation .cg-unified-section-title {
    color: var(--accent-blue, #6c8aff);
}

/* Human intervention section */
.cg-unified-human {
    border-left: 3px solid #f59e0b;
}

.cg-unified-human .cg-unified-section-title {
    color: #f59e0b;
}

/* Human-in-the-loop section */
.cg-unified-human-loop {
    border-left: 3px solid #f59e0b;
}

.cg-unified-human-loop .cg-unified-section-title {
    color: #f59e0b;
}

/* Policy evidence section */
.cg-unified-policy {
    border-left: 3px solid #60a5fa;
}

.cg-unified-policy .cg-unified-section-title {
    color: #60a5fa;
}

/* Manual evidence section */
.cg-unified-manual {
    border-left: 3px solid #a78bfa;
}

.cg-unified-manual .cg-unified-section-title {
    color: #a78bfa;
}

/* Evidence methodology */
.cg-unified-methodology {
    border-left: 3px solid #34d399;
}

.cg-unified-methodology .cg-unified-section-title {
    color: #34d399;
}

/* Verification steps */
.cg-unified-verify {
    border-left: 3px solid #34d399;
}

.cg-unified-verify .cg-unified-section-title {
    color: #34d399;
}

/* Evidence artifacts */
.cg-unified-evidence {
    border-left: 3px solid #60a5fa;
}

.cg-unified-evidence .cg-unified-section-title {
    color: #60a5fa;
}

/* Common pitfalls */
.cg-unified-pitfalls {
    border-left: 3px solid #f59e0b;
}

.cg-unified-pitfalls .cg-unified-section-title {
    color: #f59e0b;
}

/* Small business guidance */
.cg-unified-smallbiz {
    border-left: 3px solid var(--text-secondary, #8b8fa3);
}

/* Machine-readable artifact */
.cg-unified-artifact {
    margin: 8px 0;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary, #8b8fa3);
}

.cg-unified-artifact code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--accent-blue, #6c8aff);
    background: rgba(108, 138, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

/* CLI commands section */
.cg-unified-cli-section {
    margin: 8px 0;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    overflow: hidden;
}

.cg-unified-cli-section > summary {
    cursor: pointer;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.015);
    list-style: none;
}

.cg-unified-cli-section > summary::-webkit-details-marker {
    display: none;
}

.cg-unified-cli-section > summary::marker {
    content: '';
}

.cg-clickable {
    cursor: pointer;
}

.cg-clickable:hover {
    background: rgba(255, 255, 255, 0.03);
}

.cg-unified-cli-list {
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cg-unified-cli-item {
    padding: 6px 10px;
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid var(--border-color, #2e3148);
    border-radius: 6px;
    overflow-x: auto;
}

.cg-unified-cli-item code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-primary, #e4e5ea);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Documentation link */
.cg-unified-doclink {
    margin: 8px 0;
    font-size: 0.82rem;
}

.cg-unified-doclink a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-blue, #6c8aff);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(108, 138, 255, 0.06);
    border: 1px solid rgba(108, 138, 255, 0.15);
    transition: background 0.15s ease;
}

.cg-unified-doclink a:hover {
    background: rgba(108, 138, 255, 0.12);
    text-decoration: underline;
}

/* ── Platform-specific collapsed section ── */
.cg-platforms-section {
    margin-top: 8px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
    border-radius: 10px;
    overflow: hidden;
}

.cg-platforms-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary, #8b8fa3);
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.15s ease;
}

.cg-platforms-summary::-webkit-details-marker {
    display: none;
}

.cg-platforms-summary::marker {
    content: '';
}

.cg-platforms-summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.cg-platforms-summary svg {
    flex-shrink: 0;
    color: var(--text-secondary, #8b8fa3);
}

.cg-platforms-section[open] > .cg-platforms-summary {
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.05));
}

.cg-platforms-section .cg-techs {
    border: none;
    border-radius: 0;
}

/* ── Print ── */
@media print {
    .cg-tech-dropdown {
        page-break-inside: avoid;
    }

    .cg-tech-dropdown[open] > .cg-tech-body {
        display: block !important;
    }

    .cg-chevron {
        display: none;
    }

    .cg-unified-section {
        page-break-inside: avoid;
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cg-unified-section {
        padding: 8px 10px;
    }

    .cg-unified-cli-item code {
        font-size: 0.72rem;
    }
}
