/* ============================================================================
   markdown-heading-visualizer.css - Markdown Heading Hierarchy Visualizer only
   ============================================================================
   Loaded by:  webdev-tools/markdown-heading-hierarchy-visualizer.php
   Purpose:    Scoped styles for that tool's heading-tree output (.mdhv-*):
               output area, tree structure, toggles, level badges, heading
               text and the statistics panel.
   Load order: AFTER tool-input.css. Scoped to .mdhv-* so the styles never
               leak into other tool pages.
   ============================================================================ */

.mdhv-output {
    min-height: 300px;
    max-height: 300px;
    overflow: auto;
    font-size: 15px;
    line-height: 1.6;
}

.mdhv-placeholder,
.ccv-placeholder {
    color: #999;
    font-style: normal;
    padding: 10px 4px;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    pointer-events: none;
}

.mdhv-placeholder code,
.ccv-placeholder code {
    background: #eef2f7;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 14px;
}

/* Tree structure */
.mdhv-root,
.mdhv-root .mdhv-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdhv-root .mdhv-children {
    padding-left: 16px;
}

.mdhv-node {
    position: relative;
}

.mdhv-node::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 26px;
    bottom: 6px;
    width: 1px;
    background: #d0d7e0;
}

.mdhv-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    border-radius: 4px;
}

.mdhv-item:hover {
    background: #f4f7fb;
}

/* Toggle button */
.mdhv-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    color: #0d6efd;
    background: #e8f0fd;
    border: 1px solid #c7d9fa;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background 0.15s;
}

.mdhv-toggle:hover {
    background: #d5e3fb;
    border-color: #a8c4f5;
}

.mdhv-spacer {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

/* Level badges */
.mdhv-level {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    text-align: center;
    min-width: 28px;
}

.mdhv-level-1 { background: #d7f0de; color: #0f7a2f; }
.mdhv-level-2 { background: #d9e8fc; color: #0b5ed7; }
.mdhv-level-3 { background: #fcf0cf; color: #8f6110; }
.mdhv-level-4 { background: #fce1de; color: #bd3226; }
.mdhv-level-5 { background: #eadcf7; color: #7a39ac; }
.mdhv-level-6 { background: #e6e9ee; color: #6f7885; }

/* Heading text */
.mdhv-text {
    font-size: 15px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Statistics panel */
.mdhv-stats {
    padding: 8px 4px;
}

.mdhv-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}

.mdhv-stat-row:last-child {
    margin-bottom: 0;
}

.mdhv-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
}

.mdhv-stat-num {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.mdhv-stat-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mdhv-stat-total .mdhv-stat-num {
    font-size: 16px;
    color: #555;
}

