/* =============================================================================
   GOVERNMENT BUILDER MAIN CONTROLLER STYLES
   ============================================================================= */

/* =============================================================================
   MAIN CONTAINER
   ============================================================================= */
.government-builder {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 16px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* =============================================================================
   CONTROLS
   ============================================================================= */
.add-step-select {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.add-step-select:hover {
    border-color: #4a90e2;
}

.add-step-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* =============================================================================
   CANVAS SYSTEM
   ============================================================================= */
.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* Re-enable text selection for input, textarea, and select elements */
.government-builder input,
.government-builder textarea,
.government-builder select {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.canvas-content {
    --grid-line-width: 1px;
    --grid-size: 50px;
    --grid-line-width-large: 1px;
    --grid-size-large: 500px;
    position: absolute;
    width: 10000px;
    height: 10000px;
    transform-origin: 0 0;
    left: 0;
    top: 0;
    margin: 0;
    transform: translate(0, 0) scale(1);
    background: #f0f0f0;
    background-image:
        linear-gradient(to right, rgba(180, 180, 180, 0.7) var(--grid-line-width), transparent var(--grid-line-width)),
        linear-gradient(to bottom, rgba(180, 180, 180, 0.7) var(--grid-line-width), transparent var(--grid-line-width));
    background-size: var(--grid-size) var(--grid-size);
    background-position: 0 0;
}

.canvas-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(to right, rgba(180, 180, 180, 0.9) var(--grid-line-width-large), transparent var(--grid-line-width-large)),
        linear-gradient(to bottom, rgba(180, 180, 180, 0.9) var(--grid-line-width-large), transparent var(--grid-line-width-large));
    background-size: var(--grid-size-large) var(--grid-size-large);
    background-position: 0 0;
    pointer-events: none;
}

.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 1;
}

.canvas-element.dragging {
    opacity: 0.8;
    z-index: 1000;
}

/* =============================================================================
   NODE SYSTEM
   ============================================================================= */
.node {
    font-family: Arial, sans-serif;
    width: 300px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px 2px rgba(0,0,0,0.25);
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.node-header {
    position: relative;
    height: 24px;
    margin-bottom: 5px;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
}

.node-label {
    text-align: left;
    flex: 1;
}

.node-body {
    border-radius: 10px;
    padding: 15px 10px;
    color: #000;
    text-align: center;
    margin-bottom: 10px;
    background-color: #ff0000; /*indicating this node's styles are not applied, and need to be*/
}

/* =============================================================================
   NODE ICONS
   ============================================================================= */
.drag-icon {
    width: 24px;
    height: 16px;
    transform: translateX(-50%) rotate(90deg);
    position: absolute;
    left: 50%;
}

.help-icon, .copy-icon, .node-header .delete-icon {
    margin-left: 8px;
    margin-right: 0px;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    cursor: pointer;
}

/* Drag handle icon color styling */
.drag-icon[src*="drag-handle.svg"] {
    filter: brightness(0) saturate(100%) invert(65%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
}

/* Trash icon color styling */
.delete-icon[src*="trash.svg"],
.chit-delete-icon[src*="trash.svg"] {
    filter: brightness(0) saturate(100%) invert(65%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
}

/* Help icon color styling */
.help-icon[src*="Help.svg"],
.help-icon[src*="help.svg"] {
    filter: brightness(0) saturate(100%) invert(65%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
}

/* Copy icon color styling */
.copy-icon[src*="copy.svg"] {
    filter: brightness(0) saturate(100%) invert(65%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
}

/* =============================================================================
   NODE ANCHOR POINTS
   ============================================================================= */
/* Anchor point styles are now defined in CommonNodeComponents/AnchorPoint.css */

/* Membership Management styles moved to GroupDefinition.css */

/* Reaction System styles moved to ApprovalPhase.css */

/* =============================================================================
   NODE SECTIONS
   ============================================================================= */
.top-node-setting-section {
    padding: 10px;
    padding-top: 5px;
    margin-bottom: 10px;
}

.middle-node-setting-section {
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.bottom-node-setting-section {
    padding: 10px;
    padding-bottom: 5px;
    margin-top: 10px;
}

.only-node-setting-section {
    padding: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* =============================================================================
   INPUT ANCHOR SYSTEM
   ============================================================================= */
.input-anchor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-anchor-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 8px;
    background-color: var(--color-not-connected-node-lightest);
    border-radius: 10px;
}

.input-anchor-list-item-label {
    font-size: 13px;
    color: #333;
}

.add-input-anchor {
    margin-top: 6px;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    text-align: left;
    padding: 4px;
}

/* =============================================================================
   NODE SELECTION DRAWER
   ============================================================================= */
.menu-icon {
    position: absolute;
    top: 25px;
    left: 25px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    border-radius: 50%;
    font-size: 16px;
    z-index: 25;
}

.menu-icon:hover {
    background: #8f8f8f;
}

.menu-icon img {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 5px;
    left: 5px;
}

.node-drawer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: #e7e7e7;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    transition: height 0.25s ease;
    z-index: 20;
    overflow: hidden;
    filter: drop-shadow(2px 4px 6px grey);
}

.node-drawer.open {
    height: 60px;
}

.drawer-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    margin-left: 10px;
    flex-shrink: 0;
}

.drawer-toggle:hover {
    text-decoration: underline;
}

.drawer-toggle img {
    width: 16px;
    height: 16px;
}

.drawer-content {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 0 8px;
    overflow-x: auto;
    white-space: nowrap;
    align-items: center;
}

.drawer-content::-webkit-scrollbar {
    height: 4px;
    background: transparent;
}

.drawer-content::-webkit-scrollbar-track {
    background: transparent;
}

.drawer-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.drawer-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.node-entry {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    flex-shrink: 0;
}

.node-entry:hover {
    text-decoration: underline;
}

.section-divider {
    display: flex;
    width: 1px;
    height: 30px;
    background: #ccc;
    align-self: center;
    flex-shrink: 0;
    margin: 0 8px;
}

/* =============================================================================
   SUBNODE SYSTEM
   ============================================================================= */
.subnode-element {
    z-index: 2;
}

/* =============================================================================
   ZOOM CONTROLS
   ============================================================================= */
.zoom-ui {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.zoom-btn:hover {
    background-color: #f0f0f0;
}

.zoom-btn img {
    width: 16px;
    height: 16px;
}

/* =============================================================================
   STANDARD LABEL STYLE
   ============================================================================= */
.regular-label-style {
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}

/* =============================================================================
   DEV TOOLS
   ============================================================================= */
.dev-tools-ui {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
}

.settings-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.settings-btn:hover {
    background-color: #f0f0f0;
}

.settings-btn img {
    width: 20px;
    height: 20px;
}

.dev-tools-menu {
    position: absolute;
    bottom: 50px;
    left: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 150px;
}

.dev-tools-menu.visible {
    display: flex;
}

.menu-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.menu-item:hover {
    background-color: #f0f0f0;
}