/* Fluent UI Overrides and Custom Styles */
.ms-Fabric {
    font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* HL7 Raw Explorer */
.hl7-raw {
    font-family: 'Cascadia Code', 'Courier New', Courier, monospace;
    background-color: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 2px;
    padding: 12px;
    white-space: pre;
    overflow: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #323130;
}

.hl7-line-num {
    display: inline-block;
    width: 32px;
    color: #a19f9d;
    text-align: right;
    margin-right: 12px;
    user-select: none;
    border-right: 1px solid #edebe9;
    padding-right: 8px;
}

.hl7-line {
    cursor: pointer;
    display: block;
    padding: 0 8px;
    border-radius: 2px;
}

.hl7-line:hover {
    background-color: #f3f2f1;
}

.hl7-line.active {
    background-color: #deecf9;
    font-weight: 600;
}

/* Tree View */
fluent-tree-view {
    --tree-item-height: auto;
    background: transparent;
}

fluent-tree-item::part(content) {
    padding-top: 4px;
    padding-bottom: 4px;
}

.field-label {
    display: flex;
    align-items: center;
    min-width: 180px;
}

.field-id {
    font-size: 13px;
    white-space: nowrap;
}

.field-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.field-value-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
}

.field-value {
    margin-left: 12px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 767px) {
    .field-label {
        flex-direction: column;
        align-items: flex-start;
        min-width: 80px;
    }
    
    .field-name {
        margin-left: 0 !important;
        max-width: 100px;
    }

    .field-value {
        margin-left: 4px;
        font-size: 11px;
    }
}

fluent-tree-item [slot="actions"] {
    opacity: 0.8;
}

fluent-tree-item:hover [slot="actions"] {
    opacity: 1;
}

.component-badge {
    font-size: 11px;
    background-color: #eff6fc;
    color: #0078d4;
    padding: 1px 6px;
    border-radius: 12px;
    margin-right: 6px;
    font-weight: 600;
}

.subcomponent-badge {
    font-size: 10px;
    background-color: #f3f2f1;
    color: #605e5c;
    padding: 0px 5px;
    border-radius: 10px;
    margin-right: 4px;
    font-weight: 600;
}

code {
    font-family: 'Cascadia Code', Consolas, Monaco, monospace;
    background-color: #f3f2f1;
    color: #0078d4;
    padding: 2px 4px;
    border-radius: 2px;
}

.viewer-card {
    height: auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.viewer-header {
    border-bottom: 1px solid #edebe9;
    background-color: #ffffff;
}

.segments-list {
    flex-grow: 1;
}

.section-title {
    font-weight: 600;
    color: #323130;
}

fluent-text-area::part(control) {
    resize: vertical;
    height: 100%;
}
