/**
 * DETAIL-PAGES.CSS
 * Standalone detail page styles for competency and ontology views.
 * Loaded with brainstem-home.css + admin-bs.css.
 */

/* ========================================
   Layout
   ======================================== */

.detail-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.detail-breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-500, #64748b);
    margin-bottom: 1.25rem;
}

.detail-breadcrumb a {
    color: var(--gray-600, #475569);
    text-decoration: none;
}

.detail-breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ========================================
   Header Card
   ======================================== */

.detail-header {
    background: var(--white, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 0.75rem);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.detail-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary, #1e3a5f);
    margin: 0 0 0.15rem;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.detail-subtitle {
    font-size: 0.88rem;
    color: var(--gray-500, #64748b);
}

.detail-description {
    margin-top: 0.75rem;
    color: var(--gray-600, #475569);
    font-size: 0.9rem;
    line-height: 1.6;
}

.detail-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ========================================
   Badges
   ======================================== */

.detail-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-md, 0.375rem);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
}

.detail-badge-llm      { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.detail-badge-rust     { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.detail-badge-http     { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.detail-badge-sql      { background: rgba(6, 182, 212, 0.12); color: #0891b2; }
.detail-badge-action   { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.detail-badge-loop     { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.detail-badge-workflow { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.detail-badge-default  { background: var(--gray-100, #f1f5f9); color: var(--gray-600, #475569); }

.detail-badge-healthy   { background: rgba(16, 185, 129, 0.12); color: #059669; }
.detail-badge-degraded  { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.detail-badge-unhealthy { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.zone-approve { background: rgba(16, 185, 129, 0.12); color: #059669; }
.zone-review  { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.zone-reject  { background: rgba(220, 38, 38, 0.12); color: #dc2626; }

/* ========================================
   Sections
   ======================================== */

.detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--primary, #1e3a5f);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.detail-card {
    background: var(--white, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 0.75rem);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* ========================================
   Metadata Grid
   ======================================== */

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
}

.detail-meta-grid dt {
    color: var(--gray-400, #94a3b8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.detail-meta-grid dd {
    color: var(--gray-700, #334155);
    margin-bottom: 0.4rem;
}

/* ========================================
   Schema Grid
   ======================================== */

.detail-schema-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 800px) {
    .detail-schema-grid { grid-template-columns: 1fr; }
}

.detail-schema-grid h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700, #334155);
    margin: 0 0 0.5rem;
}

/* ========================================
   Code / Pre
   ======================================== */

.detail-card code {
    background: var(--gray-100, #f1f5f9);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm, 0.25rem);
    font-size: 0.86em;
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    color: var(--gray-700, #334155);
}

.detail-pre {
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.5rem);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    color: var(--gray-700, #334155);
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-prompt-wrap {
    max-height: 400px;
    overflow-y: auto;
}

/* ========================================
   Tables
   ======================================== */

.detail-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.detail-card th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--gray-400, #94a3b8);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.detail-card td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--gray-700, #334155);
}

.detail-card tr:hover td {
    background: var(--gray-50, #f8fafc);
}

/* ========================================
   Details / Summary
   ======================================== */

.detail-page details {
    margin-bottom: 1rem;
}

.detail-page summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary, #1e3a5f);
    padding: 0.5rem 0;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.detail-page summary:hover {
    color: var(--primary-light, #2d5a87);
}

/* ========================================
   Use Cases List
   ======================================== */

.detail-use-cases {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-use-cases li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
    color: var(--gray-700, #334155);
    font-size: 0.85rem;
}

.detail-use-cases li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--primary, #1e3a5f);
    font-weight: bold;
}

/* ========================================
   Health Bar
   ======================================== */

.detail-health-bar {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: var(--gray-200, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.detail-health-fill {
    height: 100%;
    border-radius: 3px;
}

/* ========================================
   Links
   ======================================== */

.detail-card a {
    color: var(--primary, #1e3a5f);
    text-decoration: none;
}

.detail-card a:hover {
    text-decoration: underline;
    color: var(--primary-light, #2d5a87);
}

/* ========================================
   Tools list
   ======================================== */

.detail-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}
