/* ================================================================
   NEURAL NETWORK BUILDER — 3-panel variable mapping styles
   Estilos do construtor de mapeamento de variaveis por DnD
   ================================================================ */

/* Header with back button and title */
.nn-builder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.nn-builder-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    flex: 1;
}

/* 3-column layout */
.nn-builder {
    display: flex;
    gap: 12px;
    min-height: 420px;
    max-height: 60vh;
}

/* ----------------------------------------------------------------
   Left panel — Variable catalog
   ---------------------------------------------------------------- */

.nn-catalog-panel {
    flex: 0 0 200px;
    overflow-y: auto;
    padding-right: 8px;
    border-right: 1px solid var(--neutral-200);
}

.nn-catalog-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--window-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--neutral-200);
}

.nn-catalog-category {
    margin-bottom: 10px;
}

.nn-catalog-category-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--window-muted);
    padding: 4px 8px;
    margin-bottom: 4px;
}

/* Draggable variable pill */
.nn-variable-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 12px;
    color: var(--window-text);
    border-radius: var(--radius-lg);
    cursor: grab;
    transition: background 0.12s, opacity 0.12s;
    -webkit-user-select: none;
    user-select: none;
}

.nn-variable-pill:hover {
    background: var(--overlay-subtle);
}

.nn-variable-pill:active {
    cursor: grabbing;
}

.nn-variable-pill.nn-pill-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.nn-variable-pill.nn-pill-dragging {
    opacity: 0.5;
}

.nn-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nn-pill-unit {
    font-size: 10px;
    color: var(--window-muted);
    margin-left: auto;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Center panel — Input/Output mapping zones
   ---------------------------------------------------------------- */

.nn-mapping-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nn-mapping-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nn-mapping-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--window-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.nn-mapping-divider {
    text-align: center;
    color: var(--neutral-400);
    padding: 2px 0;
}

/* Drop zone — dashed border target for variables */
.nn-dropzone {
    flex: 1;
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-xl);
    padding: 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s, background 0.15s;
}

.nn-dropzone.drag-over {
    border-color: var(--accent-primary);
    background: var(--overlay-subtle);
}

.nn-dropzone-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 11px;
    color: var(--neutral-400);
    text-align: center;
    padding: 16px;
}

/* Mapped variable in the dropzone */
.nn-mapped-var {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-size: 12px;
}

.nn-mapped-name {
    font-family: monospace;
    font-weight: 500;
    color: var(--window-text);
}

.nn-mapped-unit {
    font-size: 10px;
    color: var(--window-muted);
    margin-left: auto;
}

.nn-mapped-remove {
    background: none;
    border: none;
    color: var(--neutral-400);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.12s;
}

.nn-mapped-remove:hover {
    color: var(--accent-red);
}

/* ----------------------------------------------------------------
   Right panel — Normalization bounds
   ---------------------------------------------------------------- */

.nn-norm-panel {
    flex: 0 0 220px;
    overflow-y: auto;
    padding-left: 8px;
    border-left: 1px solid var(--neutral-200);
}

.nn-norm-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--window-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--neutral-200);
}

.nn-norm-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 12px;
    color: var(--neutral-400);
}

.nn-norm-card {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    overflow: hidden;
}

.nn-norm-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--neutral-100);
    font-size: 12px;
    color: var(--window-text);
}

.nn-norm-card-header strong {
    font-family: monospace;
    font-size: 11px;
}

.nn-norm-card-body {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
}

.nn-norm-field {
    flex: 1;
}

.nn-norm-field label {
    display: block;
    font-size: 10px;
    color: var(--window-muted);
    margin-bottom: 4px;
}

.nn-norm-field .form-control {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-300);
    background: var(--neutral-0);
    color: var(--window-text);
}

.nn-norm-field .form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 25%, transparent);
    outline: none;
}

/* Footer with save button */
.nn-builder-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--neutral-200);
}
