/* ============================================================================
   OPERATIONS - Wikipedia Dark Mode Theme
   ============================================================================ */

.operation-block {
    position: absolute;
    width: 50px;               /* CONFIG.OPERATION_SIZE */
    height: 50px;              /* CONFIG.OPERATION_SIZE */
    background: linear-gradient(135deg, #27292a 0%, #2a2b2d 100%);
    border: 2px solid #eaecf0; /* CONFIG.OPERATION_BORDER_WIDTH */
    border-radius: 2px;
    cursor: move;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    padding-top: 6px; /* Reduced padding since buttons are overlays */
    backdrop-filter: blur(8px);
    z-index: 10;
}

.operation-block:hover {
    box-shadow: 0 2px 8px rgba(234, 236, 240, 0.3);
    z-index: 20;
}

/* Selected state */
.operation-block.selected {
    border-color: #447ff5;
    box-shadow: 0 0 0 2px rgba(68, 127, 245, 0.4);
    z-index: 25;
}

.operation-block.dragging {
    opacity: 0.7;
    cursor: grabbing;
    z-index: 1000;
}


.operation-icon {
    font-size: 1.4rem;
    line-height: 1;
    color: #eaecf0;
}

.operation-title {
    font-size: 0.55rem;
    font-weight: 600;
    text-align: center;
    color: #eaecf0;
    line-height: 1.1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.operation-controls-left {
    position: absolute;
    top: 3px;
    left: 3px;
    display: none; /* Hidden by default */
    gap: 2px;
    z-index: 15; /* Above content */
    background: rgba(0, 0, 0, 0.7);
    padding: 2px;
    border-radius: 2px;
}

.operation-controls-right {
    position: absolute;
    top: 3px;
    right: 3px;
    display: none; /* Hidden by default */
    gap: 2px;
    z-index: 15; /* Above content */
    background: rgba(0, 0, 0, 0.7);
    padding: 2px;
    border-radius: 2px;
}

/* Show controls when operation is selected */
.operation-block.selected .operation-controls-left,
.operation-block.selected .operation-controls-right {
    display: flex;
}

/* Add connector button */
.add-connector-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    background: rgba(51, 102, 204, 0.3);
    border: 1px solid #3366cc;
    border-radius: 50%;
    color: #6b9dff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 5;
}

.add-connector-btn:hover:not(:disabled) {
    background: rgba(51, 102, 204, 0.5);
    border-color: #447ff5;
    transform: scale(1.1);
}

.add-connector-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Operation settings modal */
.operation-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.operation-settings-modal.show {
    display: flex;
}

.operation-settings-content {
    background: #27292a;
    border: 1px solid #3a3b3c;
    border-radius: 2px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.operation-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.operation-settings-header h3 {
    margin: 0;
    color: #eaecf0;
    font-size: 1.1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.operation-settings-body {
    margin-bottom: 20px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    font-size: 0.85rem;
    color: #c8ccd1;
    margin-bottom: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.setting-item select {
    width: 100%;
    background: #202122;
    border: 1px solid #3a3b3c;
    border-radius: 2px;
    padding: 8px;
    color: #eaecf0;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.setting-item select:focus {
    outline: none;
    border-color: #3366cc;
}

.operation-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(10deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.2) rotate(-10deg); }
}