/* =========================
   TAXONOMY MANAGER
   ========================= */


#tax-tree-container {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 500px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

ul.tax-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.tax-tree ul {
    padding-left: 24px;
    /* Indentation for children */
    position: relative;
}

/* Optional: Tree Guide Lines */
ul.tax-tree ul::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 15px;
    /* Stop before last item ideally, but harder in pure CSS without :last-child logic handling */
    width: 1px;
    background: #E2E8F0;
}

.tax-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    margin-bottom: 2px;
    background: #FFFFFF;
}

.tax-node:hover {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

.tax-node.selected {
    background: #EFF6FF;
    /* Blue-50 */
    border-color: #DBEAFE;
    /* Blue-200 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.node-icon {
    font-size: 16px;
    opacity: 0.6;
}

.node-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.node-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.tax-node.selected .node-name {
    color: #1D4ED8;
    /* Blue-700 */
    font-weight: 600;
}

.node-slug {
    font-size: 11px;
    color: var(--muted);
    font-family: monospace;
}

.node-badge {
    font-size: 10px;
    text-transform: uppercase;
    background: #F1F5F9;
    color: #64748B;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Editor Panel */
#tax-editor-container {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-height: 500px;
    /* Match height */
}

.editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    text-align: center;
    opacity: 0.6;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.editor-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

.editor-id {
    font-size: 12px;
    color: var(--muted);
    font-family: monospace;
    margin-top: 4px;
}

.editor-vertical-badge {
    background: #F1F5F9;
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.05em;
    border: 1px solid #E2E8F0;
}

.editor-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.input.disabled {
    background-color: #F8FAFC;
    color: #94A3B8;
    border-color: #E2E8F0;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid dashed var(--border);
}

.btn-danger {
    background: #FEF2F2;
    color: #EF4444;
    border-color: #FECACA;
}

.btn-danger:hover {
    background: #FEE2E2;
    border-color: #F87171;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    height: 32px;
}

.full-width {
    width: 100%;
    justify-content: center;
}

.editor-section {
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-head h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.attr-list {
    min-height: 40px;
}

.attr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.attr-item:last-child {
    margin-bottom: 0;
}

.badge-red {
    font-size: 10px;
    background: #FEE2E2;
    color: #EF4444;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.skeleton-line {
    height: 12px;
    background: #E2E8F0;
    border-radius: 4px;
    width: 60%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* --- Dynamic Filter Styles --- */
.dynamic-search-field {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.bg-muted {
    background: #f9fafb;
}

.range-row {
    display: flex;
    gap: 5px;
}

.range-input {
    width: 70px;
}
