/* Enhanced @ Mention System Styles */
.pill-wrapper {
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
}

.chameleon-variable {
    display: inline-flex;
    align-items: center;
    background-color: rgba(228, 230, 235, 0.7);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.9em;
    margin: 0 2px;
    cursor: grab;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.chameleon-variable:hover {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chameleon-variable::before {
    content: '@';
    color: #3b82f6;
    font-weight: 600;
    margin-right: 4px;
}

.enhanced-mention-popup {
    position: fixed;
    width: 480px;
    max-height: 600px;
    background: #ffffff;
    border: 1px solid #dce1e6;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.enhanced-mention-popup.show {
    display: flex;
}

.popup-persistent-header {
    background: #f7f8fa;
    border-bottom: 1px solid #e9ecef;
    padding: 16px;
}

.popup-context-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #555;
}

.context-crumb {
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.context-crumb:hover {
    background-color: #e9ecef;
}

.context-crumb.active {
    background-color: #3b82f6;
    color: white;
}

.context-separator {
    color: #8a929a;
    margin: 0 4px;
}

.popup-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dce1e6;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.popup-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.popup-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-view {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.popup-view.active {
    display: flex;
}

.popup-tabs {
    display: flex;
    background: #f7f8fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    border-right: 1px solid #e9ecef;
    transition: all 0.2s;
}

.popup-tab:last-child {
    border-right: none;
}

.popup-tab:hover {
    background-color: #e9ecef;
}

.popup-tab.active {
    background-color: #3b82f6;
    color: white;
}

.popup-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.popup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-list li {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-list li:hover {
    background-color: #f7f8fa;
}

.popup-list li.selected {
    background-color: #3b82f6;
    color: white;
}

.popup-item-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    margin-bottom: 4px;
}

.result-origin {
    font-size: 12px;
    color: #8a929a;
    font-weight: normal;
}

.popup-list li.selected .result-origin {
    color: rgba(255, 255, 255, 0.8);
}

.popup-item-desc {
    font-size: 13px;
    color: #8a929a;
    line-height: 1.4;
}

.popup-list li.selected .popup-item-desc {
    color: rgba(255, 255, 255, 0.9);
}

.scope-navigator-body {
    display: flex;
    height: 400px;
    overflow: hidden;
}

.navigator-column {
    flex: 1;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.navigator-column:last-child {
    border-right: none;
}

.navigator-column-header {
    padding: 12px 16px;
    background: #f7f8fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 14px;
    color: #1c1e21;
}

.navigator-column-content {
    flex: 1;
    overflow-y: auto;
}

.navigator-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    color: #1c1e21;
    transition: background-color 0.2s;
}

.navigator-item:hover {
    background-color: #f7f8fa;
}

.navigator-item.active {
    background-color: #3b82f6;
    color: white;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}